@@ -253,24 +253,32 @@ class BIDSDataGrabber(SimpleInterface):
253
253
>>> bids_src.inputs.subject_data = bids_collect_data(
254
254
... str(datadir / 'ds114'), '01', bids_validate=False)[0]
255
255
>>> bids_src.inputs.subject_id = '01'
256
+ >>> bids_src._require_t1w
257
+ True
258
+ >>> bids_src._require_funcs
259
+ True
256
260
>>> res = bids_src.run()
257
261
>>> res.outputs.t1w # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
258
262
['.../ds114/sub-01/ses-retest/anat/sub-01_ses-retest_T1w.nii.gz',
259
263
'.../ds114/sub-01/ses-test/anat/sub-01_ses-test_T1w.nii.gz']
260
264
265
+ >>> bids_src = BIDSDataGrabber(require_t1w=False)
266
+ >>> bids_src._require_t1w
267
+ False
261
268
"""
262
269
263
270
input_spec = _BIDSDataGrabberInputSpec
264
271
output_spec = _BIDSDataGrabberOutputSpec
265
272
_require_funcs = True
266
273
267
274
def __init__ (self , * args , ** kwargs ):
268
- anat_only = kwargs .pop ('anat_only' )
275
+ anat_only = kwargs .pop ('anat_only' , None )
269
276
anat_derivatives = kwargs .pop ('anat_derivatives' , None )
277
+ require_t1w = kwargs .pop ('require_t1w' , True )
270
278
super ().__init__ (* args , ** kwargs )
271
279
if anat_only is not None :
272
280
self ._require_funcs = not anat_only
273
- self ._require_t1w = anat_derivatives is None
281
+ self ._require_t1w = require_t1w and anat_derivatives is None
274
282
275
283
def _run_interface (self , runtime ):
276
284
bids_dict = self .inputs .subject_data
0 commit comments