Skip to content

Commit 8cfa00f

Browse files
author
Shoshana Berleant
committed
don't load the whole thing into memory
1 parent 7c7dcd2 commit 8cfa00f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

nipype/interfaces/fsl/epi.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -354,14 +354,14 @@ class ApplyTOPUP(FSLCommand):
354354
355355
>>> from nipype.interfaces.fsl import ApplyTOPUP
356356
>>> applytopup = ApplyTOPUP()
357-
>>> applytopup.inputs.in_files = ["epi.nii", "epi_rev.nii"]
357+
>>> applytopup.inputs.in_files = ["ds003_sub-01_mc.nii.gz", "ds003_sub-01_mc.nii.gz"]
358358
>>> applytopup.inputs.encoding_file = "topup_encoding.txt"
359359
>>> applytopup.inputs.in_topup_fieldcoef = "topup_fieldcoef.nii.gz"
360360
>>> applytopup.inputs.in_topup_movpar = "topup_movpar.txt"
361361
>>> applytopup.inputs.output_type = "NIFTI_GZ"
362362
>>> applytopup.cmdline # doctest: +ELLIPSIS +IGNORE_UNICODE
363-
'applytopup --datain=topup_encoding.txt --imain=epi.nii,epi_rev.nii \
364-
--inindex=1,2 --topup=topup --out=epi_corrected.nii.gz'
363+
'applytopup --datain=topup_encoding.txt --imain=ds003_sub-01_mc.nii.gz,ds003_sub-01_mc.nii.gz \
364+
--inindex=1,2 --topup=topup --out=ds003_sub-01_mc_corrected.nii.gz'
365365
>>> res = applytopup.run() # doctest: +SKIP
366366
367367
"""
@@ -374,7 +374,7 @@ def _parse_inputs(self, skip=None):
374374
skip = []
375375

376376
for filename in self.inputs.in_files:
377-
ndims = nib.load(filename).get_data().ndim
377+
ndims = nib.load(filename).header['dim'][0]
378378
if ndims != 4:
379379
raise ValueError('Input in_files for ApplyTopUp must be 4-D. {} is {}-D.'
380380
.format(filename, ndims))

0 commit comments

Comments
 (0)