Skip to content

Commit

Permalink
Merge pull request nipy#2861 from hstojic/patch-SPM-Level1Design
Browse files Browse the repository at this point in the history
ENH: Add flags dictionary input to spm.Level1Design
  • Loading branch information
effigies authored Feb 24, 2019
2 parents efb4645 + 1f9f106 commit a3f5115
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion nipype/interfaces/spm/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ class Level1DesignInputSpec(SPMCommandInputSpec):
desc=('Model serial correlations '
'AR(1), FAST or none. FAST '
'is available in SPM12'))
flags = traits.Dict(
desc='Additional arguments to the job, e.g., a common SPM operation is to '
'modify the default masking threshold (mthresh)')


class Level1DesignOutputSpec(TraitedSpec):
Expand All @@ -125,6 +128,7 @@ class Level1Design(SPMCommand):
>>> level1design.inputs.interscan_interval = 2.5
>>> level1design.inputs.bases = {'hrf':{'derivs': [0,0]}}
>>> level1design.inputs.session_info = 'session_info.npz'
>>> level1design.inputs.flags = {'mthresh': 0.4}
>>> level1design.run() # doctest: +SKIP
"""
Expand All @@ -151,7 +155,11 @@ def _parse_inputs(self):
"""validate spm realign options if set to None ignore
"""
einputs = super(Level1Design,
self)._parse_inputs(skip=('mask_threshold'))
self)._parse_inputs(skip=('mask_threshold', 'flags'))
if isdefined(self.inputs.flags):
einputs[0].update(
{flag: val
for (flag, val) in self.inputs.flags.items()})
for sessinfo in einputs[0]['sess']:
sessinfo['scans'] = scans_for_fnames(
ensure_list(sessinfo['scans']), keep4d=False)
Expand Down

0 comments on commit a3f5115

Please sign in to comment.