Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: Add flags dictionary input to spm.Level1Design #2861

Merged
merged 2 commits into from
Feb 24, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion nipype/interfaces/spm/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ 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 +126,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 +153,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