Skip to content

Commit dbd2a97

Browse files
authored
Merge pull request #545 from bpinsard/fix/skip_t1w_check_if_precom_anat
fix: skip t1w file existence check if anat_derivatives are provided
2 parents b7f01bb + fc4cfdc commit dbd2a97

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

niworkflows/interfaces/bids.py

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

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

229231
def _run_interface(self, runtime):
230232
bids_dict = self.inputs.subject_data
231233

232234
self._results["out_dict"] = bids_dict
233235
self._results.update(bids_dict)
234236

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

0 commit comments

Comments
 (0)