Skip to content

LaplacianThickness() trait error path like object #3390

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
relyativist opened this issue Oct 12, 2021 · 1 comment · Fixed by #3393
Closed

LaplacianThickness() trait error path like object #3390

relyativist opened this issue Oct 12, 2021 · 1 comment · Fixed by #3393

Comments

@relyativist
Copy link

relyativist commented Oct 12, 2021

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]
@effigies
Copy link
Member

Looks like we need to change that parameter from File to Str. Would you mind submitting a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants