nipy / nipype

Workflows and interfaces for neuroimaging packages
https://nipype.readthedocs.org/en/latest/
Other
741 stars 523 forks source link

'MeshFixInputSpec' object has no attribute 'save_as_vrml' #2755

Closed MartinGrignard closed 5 years ago

MartinGrignard commented 5 years ago

Summary

Hi, I'm a newbie and am currently trying to revive a 4 years old repository. This code makes use of MeshFix interface. When running an example I get an AttributeError.

Actual behavior

The code where the issue occures is the following:

input_to_fsmesh = pe.Node(interface=mf.MeshFix(), name='input_to_fsmesh')
input_to_fsmesh.inputs.dont_clean = True
input_to_fsmesh.inputs.save_as_freesurfer_mesh = True

It stops running at the last line with the error: AttributeError: 'MeshFixInputSpec' object has no attribute 'save_as_vrml' The complete message is the following:

Exception occurred in traits notification handler for object: 
args = <undefined>
cut_inner = <undefined>
cut_outer = <undefined>
decouple_inin = <undefined>
decouple_outin = <undefined>
decouple_outout = <undefined>
dilation = <undefined>
dont_clean = True
environ = {}
epsilon_angle = <undefined>
finetuning_distance = <undefined>
finetuning_inwards = <undefined>
finetuning_outwards = <undefined>
finetuning_substeps = <undefined>
in_file1 = <undefined>
in_file2 = <undefined>
join_closest_components = <undefined>
join_overlapping_largest_components = <undefined>
laplacian_smoothing_steps = <undefined>
number_of_biggest_shells = <undefined>
out_filename = <undefined>
output_type = off
quiet_mode = <undefined>
remove_handles = <undefined>
save_as_freesurfer_mesh = True
save_as_stl = <undefined>
save_as_vmrl = <undefined>
set_intersections_to_one = <undefined>
uniform_remeshing_steps = <undefined>
uniform_remeshing_vertices = <undefined>
x_shift = <undefined>
, trait: save_as_freesurfer_mesh, old value: <undefined>, new value: True

Traceback (most recent call last):
File "/home/martin/local/miniconda3/lib/python3.5/site-packages/traits/trait_notifiers.py", line 519, 
in _dispatch_change_event
        self.dispatch( handler, *args )  
File "/home/martin/local/miniconda3/lib/python3.5/site-packages/traits/trait_notifiers.py", line 482, 
in dispatch
    handler( *args )  
File "/home/martin/local/miniconda3/lib/python3.5/site-packages/nipype/interfaces/base/specs.py", line 112, 
in _xor_warn    
        if isdefined(getattr(self, trait_name)):
AttributeError: 'MeshFixInputSpec' object has no attribute 'save_as_vrml'
Exception occurred in traits notification handler.

Platform details:

{'commit_hash': '%h',
 'commit_source': 'archive substitution',
 'networkx_version': '2.1',
 'nibabel_version': '2.3.1',
 'nipype_version': '1.1.3',
 'numpy_version': '1.15.2',
 'pkg_path': '/home/martin/local/miniconda3/lib/python3.5/site-packages/nipype',
 'scipy_version': '1.1.0',
 'sys_executable': '/home/martin/local/miniconda3/bin/python',
 'sys_platform': 'linux',
 'sys_version': '3.5.6 |Anaconda, Inc.| (default, Aug 26 2018, 21:41:56) \n'
                '[GCC 7.3.0]',
 'traits_version': '4.6.0'}

To tell the exact truth my platform is WSL Ubuntu 18.04 as I have a Windows 10 laptop.

Execution environment

My python environment outside container.

effigies commented 5 years ago

Looks like it should be save_as_vmrl, not save_as_vrml.

MartinGrignard commented 5 years ago

But I don't see any call to this attribute neither to MeshFixInputSpec anywhere in my code so why (and where) would there be such a typo?

effigies commented 5 years ago

Ah. I see, there's a typo here:

https://github.com/nipy/nipype/blob/704b97dee7848283692bac38f04541c5af2a87b5/nipype/interfaces/meshfix.py#L48-L51

Which is causing problems because of these lines:

    input_to_fsmesh = pe.Node(interface=mf.MeshFix(), name='input_to_fsmesh')
    input_to_fsmesh.inputs.dont_clean = True
    input_to_fsmesh.inputs.save_as_freesurfer_mesh = True

Any interest in submitting a quick patch? It will involve fixing the line in nipype/interfaces/meshfix.py and running make specs.

MartinGrignard commented 5 years ago

It would be great as it would allow me to work but if not possible, I can try to compile it from modified sources.

MartinGrignard commented 5 years ago

Fix solved this issue. Many thanks!