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

fvtk volume doesn't handle affine (crashes notebook) #1161

Closed
kesshijordan opened this Issue Dec 10, 2016 · 7 comments

Comments

Projects
3 participants
@kesshijordan
Contributor

kesshijordan commented Dec 10, 2016

When I try to use the fvtk volume function without an affine, it works... with an affine, however, I get the error that it needs scalar data to volume render, and the notebook crashes. See toy example, below.

ERROR: In ../Rendering/Core/vtkVolume.cxx, line 720
vtkVolume (0x3ce14e0): Need scalar data to volume render

"The kernel appears to have died. It will restart automatically"

from dipy.viz import fvtk

import numpy as np
a = np.zeros([20,21,22]).astype('uint8')
a[10:15,10:15,10:15] = 255
ren = fvtk.ren()

roi_actor = fvtk.volume(a, affine=np.eye(4), voxsz = np.array([1,1,1], float), info=1)
fvtk.add(ren,roi_actor)
fvtk.show(ren)

@kesshijordan kesshijordan changed the title from vtk volume doesn't handle affine (crashes notebook) to fvtk volume doesn't handle affine (crashes notebook) Dec 10, 2016

@Garyfallidis

This comment has been minimized.

Member

Garyfallidis commented Dec 10, 2016

Yes, it makes sense. This is an old function that needs to be refactored. Thanks for reporting!

@kesshijordan

This comment has been minimized.

Contributor

kesshijordan commented Dec 10, 2016

Is there anything else that displays roi's? The contour function doesn't use the affine.. but i was going to try to modify that to get something working.

Thanks!
Kesshi

@kesshijordan

This comment has been minimized.

Contributor

kesshijordan commented Dec 11, 2016

I combined the contour function in fvtk.py and the slicer code from actor.py, and it now works to display an roi using the affine. I haven't written tests for it yet but I can put it up as a work-in-progress.

@Garyfallidis

This comment has been minimized.

Member

Garyfallidis commented Dec 11, 2016

That is excellent news @kesshijordan ! 👍

@kesshijordan

This comment has been minimized.

Contributor

kesshijordan commented Dec 11, 2016

Thanks, @Garyfallidis. I created a pull request for this #1163... I modified the contour function instead of the volume, though.

@dmreagan dmreagan added this to Issues in Viz Module Dec 1, 2017

@skoudoro

This comment has been minimized.

Member

skoudoro commented Jan 15, 2018

The PR #1165 resolve this issue and is merged.

Can we close this issue @kesshijordan ?

@kesshijordan

This comment has been minimized.

Contributor

kesshijordan commented Jan 16, 2018

Yes. Thanks, @skoudoro.

@skoudoro skoudoro moved this from Issues to Done in Viz Module Feb 9, 2018

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