File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -265,12 +265,13 @@ class BIDSDataGrabber(SimpleInterface):
265265 _require_funcs = True
266266
267267 def __init__ (self , * args , ** kwargs ):
268- anat_only = kwargs .pop ('anat_only' )
268+ anat_only = kwargs .pop ('anat_only' , None )
269269 anat_derivatives = kwargs .pop ('anat_derivatives' , None )
270+ require_t1w = kwargs .pop ('require_t1w' , True )
270271 super ().__init__ (* args , ** kwargs )
271272 if anat_only is not None :
272273 self ._require_funcs = not anat_only
273- self ._require_t1w = anat_derivatives is None
274+ self ._require_t1w = require_t1w and anat_derivatives is None
274275
275276 def _run_interface (self , runtime ):
276277 bids_dict = self .inputs .subject_data
Original file line number Diff line number Diff line change @@ -793,3 +793,16 @@ def test_fsdir_min_version(tmp_path, min_version):
793793 assert not patched_subject_dir .exists ()
794794 else :
795795 assert patched_subject_dir .exists ()
796+
797+
798+ def test_BIDSDataGrabber ():
799+ x = bintfs .BIDSDataGrabber (anat_only = True )
800+ assert x ._require_t1w is True
801+ assert x ._require_funcs is False
802+
803+ x = bintfs .BIDSDataGrabber (anat_only = False , require_t1w = False )
804+ assert x ._require_t1w is False
805+ assert x ._require_funcs is True
806+
807+ x = bintfs .BIDSDataGrabber (anat_derivatives = 'derivatives' )
808+ assert x ._require_t1w is False
You can’t perform that action at this time.
0 commit comments