Error using Nipype FSL example

Hi all,

I’m writing a script for first- and second-level modeling using this example from the Nipype documentation. Here’s the relevant bit of code from that example:

modelfit = pe.Workflow(name='modelfit')

modelspec = pe.Node(interface=model.SpecifyModel(), name="modelspec")

level1design = pe.Node(interface=fsl.Level1Design(), name="level1design")

modelgen = pe.MapNode(interface=fsl.FEATModel(), name='modelgen',
                      iterfield=['fsf_file', 'ev_files'])

modelestimate = pe.MapNode(interface=fsl.FILMGLS(smooth_autocorr=True,
                           iterfield=['design_file', 'in_file'])

conestimate = pe.MapNode(interface=fsl.ContrastMgr(), name='conestimate',
                         iterfield=['tcon_file', 'param_estimates',
                                    'sigmasquareds', 'corrections',

    (modelspec, level1design, [('session_info', 'session_info')]),
    (level1design, modelgen, [('fsf_files', 'fsf_file'),
                              ('ev_files', 'ev_files')]),
    (modelgen, modelestimate, [('design_file', 'design_file')]),
    (modelgen, conestimate, [('con_file', 'tcon_file')]),
    (modelestimate, conestimate, [('param_estimates', 'param_estimates'),
                                  ('sigmasquareds', 'sigmasquareds'),
                                  ('corrections', 'corrections'),
                                  ('dof_file', 'dof_file')]),

When I tried running the code above, I couldn’t connect the nodes together. Instead, I got this error:

Exception: Some connections were not found
Module modelestimate has no output called corrections

And, indeed, there isn’t any field called “corrections” in modelestimate.outputs:

Bunch(copes=<undefined>, dof_file=<undefined>, fstats=<undefined>, logfile=<undefined>,
param_estimates=<undefined>, residual4d=<undefined>, results_dir=<undefined>, 
sigmasquareds=<undefined>, thresholdac=<undefined>, tstats=<undefined>, 
varcopes=<undefined>, zfstats=<undefined>, zstats=<undefined>)

How else should I feed the corrections to the contrast manager? For reference, I’m using nipype version 0.13.1.


corrections was removed from FSL in recent releases. you can remove that pair.

1 Like

Thanks for the quick response! It seems to be working now.

Hi here, Apologies for replying to such an old thread. However, I’m running into this issue and the offered solution does not work. I can not find any help/documentation online to solve this problem.
When I run the workflow with corrections added as iterfield for the ContrastMgr() it requires and input. When I then add the connection from the modelestimate module, it raises an error because modelestimate does not generate corrections output (we know this). But then when I remove the corrections from the iterfield and in the connections, it raises an error that ContrastMgr() requires this input, as if it was not deprecated. I have not been able to find a fix. Suggestions?

Could you please let us know which versions of FSL and Nipype you are using?

Thanks for your fast reply! FSL version 6.0 and Nipype version 1.1.8.

those two should work together. however contrast manger is deprecated after FSL 5.0.7, so your workflow would have to use a form like this: