Skip to content

Commit 0fd77fc

Browse files
committed
Add first remarks from PR
1 parent d1cee47 commit 0fd77fc

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

nipype/interfaces/spm/preprocess.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from ...utils.filemanip import (fname_presuffix, filename_to_list,
2424
list_to_filename, split_filename)
2525
from ..base import (OutputMultiPath, TraitedSpec, isdefined,
26-
traits, InputMultiPath, File)
26+
traits, InputMultiPath, File, Str)
2727
from .base import (SPMCommand, scans_for_fname, func_is_3d,
2828
scans_for_fnames, SPMCommandInputSpec)
2929

@@ -39,7 +39,7 @@ class FieldMapInputSpec(SPMCommandInputSpec):
3939
magnitude = File(mandatory=True, exists=True, copyfile=False,
4040
field='subj.data.presubphasemag.magnitude',
4141
desc='presubstracted magnitude file')
42-
et = traits.List(traits.Float(), minlen=2, maxlen=2, mandatory=True,
42+
et = traits.Tuple(traits.Float, traits.Float, mandatory=True,
4343
field='subj.defaults.defaultsval.et',
4444
desc='short and long echo times')
4545
maskbrain = traits.Bool(True, usedefault=True,
@@ -71,7 +71,7 @@ class FieldMapInputSpec(SPMCommandInputSpec):
7171
field='subj.defaults.defaultsval.uflags.ws',
7272
desc='weighted smoothing');
7373
# Brain mask defaults parameters
74-
template = traits.File(copyfile=False, exists=True,
74+
template = File(copyfile=False, exists=True,
7575
field='subj.defaults.defaultsval.mflags.template',
7676
desc='template image for brain masking');
7777
fwhm = traits.Range(low=0, value=5, usedefault=True,
@@ -90,19 +90,19 @@ class FieldMapInputSpec(SPMCommandInputSpec):
9090
field='subj.defaults.defaultsval.mflags.reg',
9191
desc='regularization value used in the segmentation');
9292
# EPI unwarping for quality check
93-
epi = traits.File(copyfile=False, exists=True, mandatory=True,
93+
epi = File(copyfile=False, exists=True, mandatory=True,
9494
field='subj.session.epi',
9595
desc='EPI to unwarp');
9696
matchvdm = traits.Bool(True, usedefault=True,
9797
field='subj.matchvdm',
9898
desc='match VDM to EPI');
99-
sessname = traits.String('_run-', usedefault=True,
99+
sessname = Str('_run-', usedefault=True,
100100
field='subj.sessname',
101101
desc='VDM filename extension');
102102
writeunwarped = traits.Bool(False, usedefault=True,
103103
field='subj.writeunwarped',
104104
desc='write unwarped EPI');
105-
anat = traits.File(copyfile=False, exists=True,
105+
anat = File(copyfile=False, exists=True,
106106
field='subj.anat',
107107
desc='anatomical image for comparison');
108108
matchanat = traits.Bool(True, usedefault=True,
@@ -115,9 +115,9 @@ class FieldMapOutputSpec(TraitedSpec):
115115

116116

117117
class FieldMap(SPMCommand):
118-
"""Use spm to calculate fieldmap vdm.
118+
"""Use the fieldmap toolbox from spm to calculate the voxel displacement map (VDM).
119119
120-
http://www.fil.ion.ucl.ac.uk/spm/doc/manual.pdf#page=19
120+
http://www.fil.ion.ucl.ac.uk/spm/doc/manual.pdf#page=173
121121
122122
To do
123123
-----
@@ -145,9 +145,7 @@ class FieldMap(SPMCommand):
145145
def _format_arg(self, opt, spec, val):
146146
"""Convert input to appropriate format for spm
147147
"""
148-
if opt == 'phase' or opt == 'magnitude' or opt == 'anat':
149-
return scans_for_fname(filename_to_list(val))
150-
if opt == 'epi' or opt == 'magnitude':
148+
if opt in ['phase', 'magnitude', 'anat', 'epi']:
151149
return scans_for_fname(filename_to_list(val))
152150

153151
return super(FieldMap, self)._format_arg(opt, spec, val)

0 commit comments

Comments
 (0)