nipype icon indicating copy to clipboard operation
nipype copied to clipboard

McFlirt incorrect output filename expected

Open stebo85 opened this issue 2 years ago • 3 comments
trafficstars

Summary

The mcflirt node crashes when .inputs.stats_imgs = True

when using FSL 6.0.5.1:57b01774 because

it expects the output filename to be: BASEFILENAME_variance.nii.gz

but FSL outputs: BASEFILENAME.nii.gz_variance.nii.gz

There is a switch here that seems to fix this: https://github.com/nipy/nipype/blob/450be34b4540a0c3c6761cc04cc9132fdac5f5c8/nipype/interfaces/fsl/preprocess.py#L914

There it seems that this is a behavior for older FSL versions below 6.0.0. Is anyone else getting this in newer versions as well? Should this version switch be adapted to include newer versions as well?

Actual behavior

FSL 6.0.5.1:57b01774 outputs: BASEFILENAME.nii.gz_variance.nii.gz Nipype expects BASEFILENAME_variance.nii.gz

Expected behavior

Nipype should expect: BASEFILENAME.nii.gz_variance.nii.gz

How to replicate the behavior

mcflirt_run1 = fsl.MCFLIRT() mcflirt_run1.inputs.ref_vol = 0 mcflirt_run1.inputs.save_mats = True mcflirt_run1.inputs.save_plots = True

#error when stats_img = True -> works with False because image is not expected mcflirt_run1.inputs.stats_imgs = True

mcflirt_run1.inputs.in_file = 'bold.nii.gz' mcflirt_run1.inputs.out_file = 'mcflirt_bold.nii.gz'

mcflirt_run1.run()

Script/Workflow details

Please put URL to code or code here (if not too long).

Platform details:

{'commit_hash': '%h',
 'commit_source': 'archive substitution',
 'networkx_version': '2.8.8',
 'nibabel_version': '4.0.2',
 'nipype_version': '1.8.5',
 'numpy_version': '1.23.5',
 'pkg_path': '/opt/conda/lib/python3.10/site-packages/nipype',
 'scipy_version': '1.9.3',
 'sys_executable': '/opt/conda/bin/python',
 'sys_platform': 'linux',
 'sys_version': '3.10.4 | packaged by conda-forge | (main, Mar 24 2022, '
                '17:38:57) [GCC 10.3.0]',
 'traits_version': '6.4.1'}

stebo85 avatar Apr 26 '23 23:04 stebo85

@kimsin98 - it looks like you added this if condition in 2019 - did you get a different behaviour with versions newer than 6.0.0?

stebo85 avatar Apr 27 '23 02:04 stebo85

I think this was added when FSL 6.0 was pretty new. If more recent versions changed outputs again, they should be fixed!

https://github.com/nipy/nipype/issues/2925 https://neurostars.org/t/output-files-issue-with-mcflirt-nipype-1-2-0/4840

kimsin98 avatar Apr 27 '23 08:04 kimsin98

@stebo85 Please feel free to submit a PR.

effigies avatar Jul 05 '23 21:07 effigies