Skip to content

Commit 6d0895f

Browse files
author
qtabs
committed
BF - added SPM realign_unwarp function to SPM-preprocessing
1 parent d6b6786 commit 6d0895f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

nipype/interfaces/spm/preprocess.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
# Local imports
1717
from ...utils.filemanip import (fname_presuffix, ensure_list,
18-
simplify_list, split_filename, filename_to_list)
18+
simplify_list, split_filename)
1919
from ..base import (OutputMultiPath, TraitedSpec, isdefined,
2020
traits, InputMultiPath, File, Str)
2121
from .base import (SPMCommand, scans_for_fname, func_is_3d,
@@ -406,8 +406,8 @@ def _list_outputs(self):
406406
if not isinstance(imgf, list) and func_is_3d(imgf):
407407
break
408408
if self.inputs.jobtype == "estimate":
409-
outputs['realigned_files'] = self.inputs.in_files
410-
if (self.inputs.jobtype == "estimate"
409+
outputs['realigned_files'] = self.inputs.in_file
410+
s if (self.inputs.jobtype == "estimate"
411411
or self.inputs.jobtype == "estwrite"):
412412
outputs['modified_in_files'] = self.inputs.in_files
413413
if self.inputs.jobtype == "write" or self.inputs.jobtype == "estwrite":
@@ -612,7 +612,7 @@ def _format_arg(self, opt, spec, val):
612612
"""Convert input to appropriate format for spm
613613
"""
614614
if opt == 'in_files':
615-
return scans_for_fnames(filename_to_list(val),
615+
return scans_for_fnames(ensure_list(val),
616616
keep4d=False,
617617
separate_sessions=True)
618618
return super(RealignUnwarp, self)._format_arg(opt, spec, val)
@@ -668,10 +668,10 @@ def _list_outputs(self):
668668

669669
if resliced_all:
670670
outputs['realigned_unwarped_files'] = []
671-
for idx, imgf in enumerate(filename_to_list(self.inputs.in_files)):
671+
for idx, imgf in enumerate(ensure_list(self.inputs.in_files)):
672672
realigned_run = []
673673
if isinstance(imgf, list):
674-
for i, inner_imgf in enumerate(filename_to_list(imgf)):
674+
for i, inner_imgf in enumerate(ensure_list(imgf)):
675675
newfile = fname_presuffix(inner_imgf,
676676
prefix=self.inputs.out_prefix)
677677
realigned_run.append(newfile)

0 commit comments

Comments
 (0)