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):
822
822
save_json (infofile , meta_info )
823
823
824
824
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 ).
827
827
Returns True if that is the case, otherwise returns False
828
828
829
829
Parameters
830
830
----------
831
831
bval_file : file with the bvals
832
- threshold : b-value below which they are considered to be zero. (Default: 5)
833
832
834
833
Returns
835
834
-------
@@ -839,4 +838,5 @@ def bvals_are_zero(bval_file, threshold=5):
839
838
with open (bval_file ) as f :
840
839
bvals = f .read ().split ()
841
840
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