[vtkusers] Help with a volume and slice viewer

Kevin Teich kteich at cortechs.net
Thu Feb 7 13:06:45 EST 2002


I would like to create a volume viewing application with four panes: one
3D view with an MIP of the volume that is freely interactive, and one pane
for each axis containing a 2D slice view for that axis. (This is very
similar to 3D Slicer.) The volume view also has three plane outlines
representing the plane that is being viewed in each plane pane. When you
change planes, the plane outlines move in the volume pane. I am using VTK
4.0 and Tcl/Tk.

I've got a rough prototype working by throwing together a bunch of sample
code. However, I have a few questions on specifics:

1) I want to be able to let the user pan and zoom on the 2D slice view. I
am using a vtkImageViewer for the slice views at the moment, but as far as
I can tell, there is no way to attach a zoom/pan interactor to this view.
I know about the vtkImageActor; should I just use this, and set up the
scene so the camera is fixed on the actor, and use a normal interactor?

2) I have a slider to change the current plane. Its callback changes the
transform of the plane in the volume pane and renders the pane. When I
don't update the plane in the volume pane, this is very fast, but when I
do, the redraw in the volume pane slows it down to an unresponsive rate.
How can I tell the volume render window to ray cast at a high sample
distance while the plane is moving and the callback is being called, and
then go back to the low distance when it can? I have SetDesiredUpdateRate
for my render window to 30, and even explicitly set the max and min sample
distances on the ray cast mapper to 1 and 5. When interacting with the
volume (with the default interactor), the volume obviously goes to the
high distance and gets 30fps. But calling my callback function doesn't
seem to activate this. Do I have to use an LOD prop and specify different
mapping functions?

3) Is there a picker for vtkImageViewer? I've seen docs on pickers for
getting a clicked object, but not something that will return an (X,Y)
coordinate. Should I try to attach a callback to the Tk widget?

Any help will be appreciated, even if it's just a nudge in the direction
of a certain class I should check out. I have the 4.0 User's Guide if
anyone wants to reference specific pages.

Thanks!

-- 
Kevin Teich




More information about the vtkusers mailing list