gallantlab / pycortex

Pycortex is a python-based toolkit for surface visualization of fMRI data
https://gallantlab.github.io/pycortex
BSD 2-Clause "Simplified" License
597 stars 139 forks source link

Errors with calling cortex.align.manual() #258

Open sunjc73 opened 6 years ago

sunjc73 commented 6 years ago

When cortex.align.manual("S1", "fullhead") was called, the error was raised as "TraitError: The 'input' trait of a DecimatePro instance is 'read only'."

`----> 1 cortex.align.manual("S1", "fullhead")

/home/sunjc/program/anaconda2/lib/python2.7/site-packages/cortex/align.pyc in manual(subject, xfmname, reference, kwargs) 77 78 ---> 79 m = get_aligner(subject, xfmname, epifile=reference, kwargs) 80 m.save_callback = view_callback if view_only_mode else save_callback 81 m.configure_traits()

/home/sunjc/program/anaconda2/lib/python2.7/site-packages/cortex/mayavi_aligner.pyc in get_aligner(subject, xfmname, epifile, xfm, xfmtype, decimate) 984 985 if decimate: --> 986 pts, polys = polyutils.decimate(pts, polys) 987 988 return Align(pts, polys, epifile, xfm=dbxfm if xfm is None else xfm, xfmtype=xfmtype)

/home/sunjc/program/anaconda2/lib/python2.7/site-packages/cortex/polyutils.pyc in decimate(pts, polys) 959 from tvtk.common import configure_input # my code 960 pd = tvtk.PolyData(points=pts, polys=polys) --> 961 dec = tvtk.DecimatePro(input=pd) 962 963 # dec = tvtk.DecimatePro() # my code

/home/sunjc/program/anaconda2/lib/python2.7/site-packages/mayavi-4.5.0-py2.7-linux-x86_64.egg/tvtk/tvtk_classes.zip/tvtk_classes/decimate_pro.py in init(self, obj, update, traits) 101 """ 102 def init(self, obj=None, update=True, traits): --> 103 tvtk_base.TVTKBase.init(self, vtk.vtkDecimatePro, obj, update, **traits) 104 105 pre_split_mesh = tvtk_base.false_bool_trait(help=\

/home/sunjc/program/anaconda2/lib/python2.7/site-packages/mayavi-4.5.0-py2.7-linux-x86_64.egg/tvtk/tvtk_base.pyc in init(self, klass, obj, update, traits) 334 # anyway. 335 self._in_set = 1 --> 336 super(TVTKBase, self).init(traits) 337 self._in_set = 0 338

/home/sunjc/program/anaconda2/lib/python2.7/site-packages/traits/trait_handlers.pyc in _read_only(object, name, value) 102 def _read_only ( object, name, value ): 103 raise TraitError, "The '%s' trait of %s instance is 'read only'." % ( --> 104 name, class_of( object ) ) 105 106 def _undefined_get ( object, name ):

TraitError: The 'input' trait of a DecimatePro instance is 'read only'. ` my develop env configures as follows: glrework-merged branch vtk version:7.0.0 mayavi version:4.5.0 traits version:4.5.0

When I revise the function decimate(pts, polys), no errors raised. I replaced dec = tvtk.DecimatePro(input=pd) with from tvtk.common import configure_input dec = tvtk.DecimatePro() configure_input(dec, pd)

However, the graph cannot be displayed normally. The graph was shown as:

2018-02-13 19-50-57

So, as you can see, the surface cannot be shown correctly. Does anyone encounter this problem, and how to resolve it?

cheers Jiancheng Sun

seelikat commented 5 years ago

Has this ever been solved or is the underlying issue known? Is there any known workaround?