Thanks to visit codestin.com
Credit goes to github.com

Skip to content

LaplacianThickness() trait error path like object #3390

Closed
@relyativist

Description

@relyativist

Summary

LaplacianThickness() trait an error The 'output_image' trait of a LaplacianThicknessOutputSpec instance must be a pathlike object or string representing an existing file, but a value of '/input/wc2sub-1_struct-Flair_thickness.nii' <class 'str'> was specified.

Actual behavior

doesn't the output thickness file if called with from nipype.interfaces.ants import LaplacianThickness, with an error The 'output_image' trait of a LaplacianThicknessOutputSpec instance must be a pathlike object or string representing an existing file, but a value of '/input/wc2sub-1_struct-Flair_thickness.nii' <class 'str'> was specified.

Expected behavior

produces thickness file. If it called with function in shell, not in python:
LaplacianThickness wc2sub-1_struct-Flair.nii wc1sub-1_struct-Flair.nii thickness_sub-1_struct-Flair.nii,
output file successfully produced.

How to replicate the behavior

Script/Workflow details

cort_thick = LaplacianThickness()
cort_thick.inputs.input_wm = 'wc2sub-1_struct-Flair.nii'
cort_thick.inputs.input_gm = 'wc1sub-1_struct-Flair.nii'
cort_thick.inputs.output_image = 'thickness_sub-1_struct-Flair.nii'
cort_thick.run()

print(cort_thick.cmdline)
#cort_thick.inputs.output_image = 'thickness_sub-1_struct-Flair.nii'
#print(cort_thick.cmdline)

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

Platform details:

{'commit_hash': '<not found>',
 'commit_source': '(none found)',
 'networkx_version': '2.6.3',
 'nibabel_version': '3.2.1',
 'nipype_version': '1.6.1',
 'numpy_version': '1.21.2',
 'pkg_path': '/src/nipype/nipype',
 'scipy_version': '1.7.1',
 'sys_executable': '/opt/miniconda-latest/envs/neuro/bin/python3.8',
 'sys_platform': 'linux',
 'sys_version': '3.8.12 | packaged by conda-forge | (default, Sep 29 2021, '
                '19:52:28) \n'
                '[GCC 9.4.0]',
 'traits_version': '6.2.0'}

Execution environment

Choose one

  • Container [Tag: latest]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions