Skip to content

Commit 39e292e

Browse files
tsalooesteban
authored andcommitted
Check inputs against multiecho argument in EstimateReferenceImage.
1 parent b1ddee0 commit 39e292e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

niworkflows/interfaces/registration.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,8 +462,16 @@ def _run_interface(self, runtime):
462462

463463
self._results["n_volumes_to_discard"] = n_volumes_to_discard
464464

465+
if multiecho and (len(self.inputs.in_file) < 2):
466+
raise ValueError("Argument 'multiecho' is True but "
467+
"'in_file' has only one element")
468+
465469
out_ref_fname = os.path.join(runtime.cwd, "ref_bold.nii.gz")
466470
if isdefined(self.inputs.sbref_file):
471+
if multiecho and (len(self.inputs.sbref_file) < 2):
472+
raise ValueError("Argument 'multiecho' is True but "
473+
"'sbref_file' has only one element")
474+
467475
# Select first SBRef file
468476
ref_name = self.inputs.sbref_file[0]
469477
ref_nii = nb.squeeze_image(nb.load(ref_name))

0 commit comments

Comments
 (0)