diff --git a/niworkflows/interfaces/bids.py b/niworkflows/interfaces/bids.py index 5412446876a..793713f6381 100644 --- a/niworkflows/interfaces/bids.py +++ b/niworkflows/interfaces/bids.py @@ -253,18 +253,11 @@ class BIDSDataGrabber(SimpleInterface): >>> bids_src.inputs.subject_data = bids_collect_data( ... str(datadir / 'ds114'), '01', bids_validate=False)[0] >>> bids_src.inputs.subject_id = '01' - >>> bids_src._require_t1w - True - >>> bids_src._require_funcs - True >>> res = bids_src.run() >>> res.outputs.t1w # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE ['.../ds114/sub-01/ses-retest/anat/sub-01_ses-retest_T1w.nii.gz', '.../ds114/sub-01/ses-test/anat/sub-01_ses-test_T1w.nii.gz'] - >>> bids_src = BIDSDataGrabber(require_t1w=False) - >>> bids_src._require_t1w - False """ input_spec = _BIDSDataGrabberInputSpec diff --git a/niworkflows/interfaces/tests/test_bids.py b/niworkflows/interfaces/tests/test_bids.py index 3b3c991dda7..9549c404315 100644 --- a/niworkflows/interfaces/tests/test_bids.py +++ b/niworkflows/interfaces/tests/test_bids.py @@ -793,3 +793,16 @@ def test_fsdir_min_version(tmp_path, min_version): assert not patched_subject_dir.exists() else: assert patched_subject_dir.exists() + + +def test_BIDSDataGrabber(): + x = bintfs.BIDSDataGrabber(anat_only=True) + assert x._require_t1w is True + assert x._require_funcs is False + + x = bintfs.BIDSDataGrabber(anat_only=False, require_t1w=False) + assert x._require_t1w is False + assert x._require_funcs is True + + x = bintfs.BIDSDataGrabber(anat_derivatives='derivatives') + assert x._require_t1w is False