Skip to content

Commit 7c7dcd2

Browse files
author
Shoshana Berleant
committed
check and error if input to fsl ApplyTopUp is not 4 dimensional
1 parent b04d4e7 commit 7c7dcd2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

nipype/interfaces/fsl/epi.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,12 @@ def _parse_inputs(self, skip=None):
373373
if skip is None:
374374
skip = []
375375

376+
for filename in self.inputs.in_files:
377+
ndims = nib.load(filename).get_data().ndim
378+
if ndims != 4:
379+
raise ValueError('Input in_files for ApplyTopUp must be 4-D. {} is {}-D.'
380+
.format(filename, ndims))
381+
376382
# If not defined, assume index are the first N entries in the
377383
# parameters file, for N input images.
378384
if not isdefined(self.inputs.in_index):

0 commit comments

Comments
 (0)