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

Streamtube visualization problem with vtk 8.1 #1490

Closed
jimcost opened this Issue Mar 29, 2018 · 7 comments

Comments

Projects
3 participants
@jimcost

jimcost commented Mar 29, 2018

Description

I am in the midst of using nibabel and dipy to help run/visualize post-processing analyses. I am working through the 'Tractography...' example and the code fails on

ren = fvtk.ren()
ren.SetBackground(1, 1, 1)
fvtk.add(ren, fvtk.streamtube(streamlines, fvtk.colors.white))
fvtk.record(ren, n_frames=1, out_path='fornix_initial.png', size=(600, 600))


AttributeError Traceback (most recent call last)
in ()
1 ren = fvtk.ren()
2 ren.SetBackground(1, 1, 1)
----> 3 fvtk.add(ren, fvtk.streamtube(streamlines, fvtk.colors.white))
4 fvtk.record(ren, n_frames=1, out_path='fornix_initial.png', size=(600, 600))
5

~/anaconda3/lib/python3.6/site-packages/dipy/viz/actor.py in streamtube(lines, colors, opacity, linewidth, tube_sides, lod, lod_points, lod_points_size, spline_subdiv, lookup_colormap)
333 poly_mapper.SetScalarModeToUsePointFieldData()
334 poly_mapper.SelectColorArray("Colors")
--> 335 poly_mapper.GlobalImmediateModeRenderingOn()
336 poly_mapper.Update()
337

AttributeError: 'vtkRenderingOpenGL2Python.vtkOpenGLPolyDataMapper' object has no attribute 'GlobalImmediateModeRenderingOn'

Way to reproduce

OS:
Darwin-17.4.0-x86_64-i386-64bit
Python:
3.6.3 |Anaconda, Inc.| (default, Oct 6 2017, 12:04:38)
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)]
dipy:
0.13.0
Numpy:
1.13.3
Scipy:
0.19.1
Nibabel:
2.2.1
H5PY:
2.7.0
CVXPY:
0.4.11
VTK:
8.1.0

@jimcost

This comment has been minimized.

jimcost commented Mar 29, 2018

I commented out line 335 in 'actor.py' and the code executes. However, the color scheme looks funky.

fornix_clusters

@dmreagan

This comment has been minimized.

Contributor

dmreagan commented Mar 30, 2018

I've just discovered the same issue with GlobalImmediateModeRenderingOn. It seems they removed it in VTK 8.1. Perhaps it isn't safe to remove if you are seeing strange results without it. You could try downgrading to an older VTK until we have it worked out.

@dmreagan dmreagan added this to Issues in Viz Module Mar 30, 2018

@dmreagan

This comment has been minimized.

Contributor

dmreagan commented Mar 31, 2018

You can see similar behavior in the viz_bundles.py example if you change the lines to streamtubes.

Here it is with VTK 7.1.1:
bundle1_tubes vtk7

and here it is with VTK 8.1:
bundle1_tubes_vtk8

@Garyfallidis

This comment has been minimized.

Member

Garyfallidis commented Mar 31, 2018

@jimcost thank you for reporting this. Please change the title to "Streamtube visualization problem with vtk 8.1"

@jimcost jimcost changed the title from 'Tractography Clustering with QuickBundles' code fails to Streamtube visualization problem with vtk 8.1 Apr 2, 2018

@jimcost

This comment has been minimized.

jimcost commented Apr 2, 2018

No problemo, I appreciate the response. Shall I leave the post open?

@dmreagan

This comment has been minimized.

Contributor

dmreagan commented Apr 2, 2018

Yes, leave it open. I'll take a deeper look at this issue when I'm able.

@jimcost

This comment has been minimized.

jimcost commented Apr 2, 2018

Man, I have had no luck reverting to an earlier VTK version! I gotta give it up, or I'll get zero work done today. I'll stick to the commented hack for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment