Skip to content

Normalize12 does not accept an existing file as "apply_to_files" input #3030

Closed
@fednem

Description

@fednem

Summary

When I try to provide the path towards the file to whom apply the deformation field it throws an error message

Actual behavior

When I provide the path towards the file to whom apply the deformation field as in

nrm = Normalize12()
nrm.inputs.apply_to_files = "/path/to/file.nii"

it throws the following error

TraitError: Each element of the 'apply_to_files' trait of a Normalize12InputSpec instance must be a pathlike object or string representing an existing file or a list of items which are a pathlike object or string representing an existing file, but a value of '/media/zipat/DATA/temp/AD_75_T1.nii' <class 'str'> was specified.

Expected behavior

The expected behavior would be to accept the input, especially since it takes as deformation_field a file in the same directory and I have double checked that the files I am providing exist.

Script/Workflow details

https://gist.github.com/fednem/e4725d8812af75a51d681214da3b401f

Platform details:

/home/zipat/anaconda3/lib/python3.6/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters
{'commit_hash': '4b69cfcfa',
 'commit_source': 'installation',
 'networkx_version': '2.1',
 'nibabel_version': '2.4.0',
 'nipype_version': '1.2.2',
 'numpy_version': '1.14.3',
 'pkg_path': '/home/zipat/anaconda3/lib/python3.6/site-packages/nipype',
 'scipy_version': '1.1.0',
 'sys_executable': '/home/zipat/anaconda3/bin/python',
 'sys_platform': 'linux',
 'sys_version': '3.6.5 |Anaconda, Inc.| (default, Apr 29 2018, 16:14:56) \n'
                '[GCC 7.2.0]',
 'traits_version': '5.1.2'}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions