COPE and VARCOPE not generated by nipype's FILMGLS outputs

Dear community
I would like to run a within-subject cross-run (4 runs) GLM with fsl.FLAMEO using first-level analysis results from fsl.FILMGLS (which is highly inspired by this work: https://doi.org/10.3389/fnimg.2022.953215

Using Nipype version 1.8.5. and fsl 6.0.5.1 I only manage to output parameter estimates (param_estimates), but not contrast estimates (cope) or variance estimates (varcope), which are required as fsl.FLAMEO inputs.

Is there a way to output cope and varcope files with Nipype 1.8.5. and fsl.FILMGLS or what are alternatives to get to these outputs in order to subsequently use them for the further analysis (fsl.FLAMEO) ?

Code extracts from the first level analysis:

level1estimate = MapNode(
interface=fsl.FILMGLS(smooth_autocorr=True, threshold=1000),
name=‘level1estimate’,
iterfield=[‘design_file’, ‘in_file’])

wf.connect([
(datagrabber,level1estimate,[(‘func’,‘in_file’)]),
(modelgen,level1estimate,[(‘design_file’,‘design_file’)])
])
datasink = Node(DataSink(), name=‘sinker’)
datasink.inputs.base_directory=opj(experiment_dir, “level1_fsl_results”)

wf.connect(infosource, ‘subject_id’, datasink, ‘container’)

wf.connect([(level1estimate, datasink, [(‘results_dir’, ‘results_dir’)])])

results_dir only outputs parameter estimates here. Also, if I explicitely try to output cope and varcopes into datasink I retrieve parameter estimates only:
wf.connect([(level1estimate, datasink, [(‘results_dir’, ‘results_dir’),
(‘copes’, ‘wf.@reg_copes’),
(‘varcopes’, ‘wf.@reg_varcopes’),
]) ])

Code extracts from the within-subject cross-run analysis where the cope and varcope files are needed:


copemerge = pe.Node(
interface=fsl.Merge(dimension=‘t’),
iterfield=[‘in_files’],
name=“copemerge”)

varcopemerge = pe.Node(
interface=fsl.Merge(dimension=‘t’),
iterfield=[‘in_files’],
name=“varcopemerge”)

wf.connect(dg, ‘reg_copes’, copemerge, ‘in_files’)
wf.connect(dg, ‘reg_varcopes’, varcopemerge, ‘in_files’)

maskcope = pe.Node(
interface=fsl.ImageMaths(op_string=’-mas’),
iterfield=[‘in_file’, ‘in_file2’],
name=‘maskcope’)

maskvarcope = pe.Node(
interface=fsl.ImageMaths(op_string=’-mas’),
iterfield=[‘in_file’, ‘in_file2’],
name=‘maskvarcope’)

wf.connect(copemerge, ‘merged_file’, maskcope, ‘in_file’)
wf.connect(minmask, ‘out_file’, maskcope, ‘in_file2’)
wf.connect(varcopemerge, ‘merged_file’, maskvarcope, ‘in_file’)
wf.connect(minmask, ‘out_file’, maskvarcope, ‘in_file2’)

level2estimate = pe.Node(
interface=fsl.FLAMEO(run_mode=‘fe’),
name=“level2estimate”,
iterfield=[‘cope_file’, ‘var_cope_file’])

wf.connect([
(maskcope, level2estimate, [(‘out_file’, ‘cope_file’)]),
(maskvarcope, level2estimate, [(‘out_file’, ‘var_cope_file’)]),
(minmask, level2estimate, [(‘out_file’, ‘mask_file’)]),
(level2model, level2estimate, [(‘design_mat’, ‘design_file’),
(‘design_con’, ‘t_con_file’),
(‘design_grp’, ‘cov_split_file’)]),

Thank you very much,
Moni