Skip to content

Commit fc197ca

Browse files
committed
skip t1w file existence check if anat_derivatives are provided
1 parent b7f01bb commit fc197ca

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

niworkflows/interfaces/bids.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,17 +222,20 @@ class BIDSDataGrabber(SimpleInterface):
222222

223223
def __init__(self, *args, **kwargs):
224224
anat_only = kwargs.pop("anat_only")
225+
anat_derivatives = kwargs.pop("anat_derivatives")
225226
super(BIDSDataGrabber, self).__init__(*args, **kwargs)
226227
if anat_only is not None:
227228
self._require_funcs = not anat_only
229+
if anat_derivatives is not None:
230+
self._require_t1w = not anat_derivatives
228231

229232
def _run_interface(self, runtime):
230233
bids_dict = self.inputs.subject_data
231234

232235
self._results["out_dict"] = bids_dict
233236
self._results.update(bids_dict)
234237

235-
if not bids_dict["t1w"]:
238+
if self._require_t1w and not bids_dict['t1w']:
236239
raise FileNotFoundError(
237240
"No T1w images found for subject sub-{}".format(self.inputs.subject_id)
238241
)

0 commit comments

Comments
 (0)