Skip to content

Commit a29c46f

Browse files
committed
ENH: Specify motion parameter source in modelgen
1 parent beec4be commit a29c46f

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

nipype/algorithms/modelgen.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,9 @@ class SpecifyModelInputSpec(BaseInterfaceInputSpec):
187187
realignment_parameters = InputMultiPath(File(exists=True),
188188
desc="Realignment parameters returned by motion correction algorithm",
189189
copyfile=False)
190+
parameter_source = traits.Enum("SPM", "FSL", "AFNI", "NiPy", "FSFAST",
191+
desc="Source of motion parameters",
192+
mandatory=False)
190193
outlier_files = InputMultiPath(File(exists=True),
191194
desc="Files containing scan outlier indices that should be tossed",
192195
copyfile=False)
@@ -375,10 +378,16 @@ def _generate_standard_design(self, infolist,
375378
def _generate_design(self, infolist=None):
376379
"""Generate design specification for a typical fmri paradigm
377380
"""
381+
par_selection = slice(6)
382+
if isdefined(self.inputs.parameter_source):
383+
source = self.inputs.parameter_source
384+
if source == 'FSFAST':
385+
par_selection = slice(1, 7)
378386
realignment_parameters = []
379387
if isdefined(self.inputs.realignment_parameters):
380388
for parfile in self.inputs.realignment_parameters:
381-
realignment_parameters.append(np.loadtxt(parfile))
389+
realignment_parameters.append(
390+
np.loadtxt(parfile)[:, par_selection])
382391
outliers = []
383392
if isdefined(self.inputs.outlier_files):
384393
for filename in self.inputs.outlier_files:

0 commit comments

Comments
 (0)