Skip to content

different error message from SPM interaces  #2120

Closed
@djarecka

Description

@djarecka

Summary

#1949 introduced ImageFileSPM that gives a nice error message, when input file is nii.gz, but Realign gives still the old error message " the path '/data/ds000114/sub-03/func/sub-03_task-fingerfootlips_bold.nii.gz' does not exist."

How to replicate the behavior

Compare these two codes:

from nipype.interfaces.spm import Smooth
smooth = Smooth(in_files='/existing/file.nii.gz')
smooth.run()

and

from nipype.interfaces.spm import Realign
realign = Realign(in_files='/existing/file.nii.gz')
realign.run()

Actual behavior

The first code gives a nice error:
TraitError: /existing/file.nii.gz is not included in allowed types: .img, .nii, .hdr
the second gives:
TraitError: Each element of the 'in_files' trait of a RealignInputSpec instance must be a list of items which are an existing file name or an existing file name, but a value of '/existing/file.nii.gz' <class 'str'> was specified.

Expected behavior

Both examples should give the same error.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions