File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -822,14 +822,13 @@ def add_taskname_to_infofile(infofiles):
822822 save_json (infofile , meta_info )
823823
824824
825- def bvals_are_zero (bval_file , threshold = 5 ):
826- """Checks if all entries in a bvals file are zero (or below the threshold ).
825+ def bvals_are_zero (bval_file ):
826+ """Checks if all entries in a bvals file are zero (or 5, for Siemens files ).
827827 Returns True if that is the case, otherwise returns False
828828
829829 Parameters
830830 ----------
831831 bval_file : file with the bvals
832- threshold : b-value below which they are considered to be zero. (Default: 5)
833832
834833 Returns
835834 -------
@@ -839,4 +838,5 @@ def bvals_are_zero(bval_file, threshold=5):
839838 with open (bval_file ) as f :
840839 bvals = f .read ().split ()
841840
842- return all (float (b ) <= threshold for b in bvals )
841+ bvals_unique = set (float (b ) for b in bvals )
842+ return bvals_unique == {0. } or bvals_unique == {5. }
You can’t perform that action at this time.
0 commit comments