[vtkusers] Re: vtkusers digest, Vol 1 #886 - 13 msgs

Kevin Teich kteich at cortechs.net
Tue Mar 19 10:08:33 EST 2002


[Arsene ELLA]
> Having a 3D image, how can I do to display all slices in the Z direction
> in the same window?

Take a look at vtkImageReslice. Here's how you might set it up:

vtkImageReslice volReslice
volReslice SetInput [volumeReader GetOutput]
volReslice SetOutputOrigin 0 0 0
volReslice SetOutputSpacing 1 1 1
volReslice SetOutputExtent \
    0 [expr $gWindowSize - 1] \
    0 [expr $gWindowSize - 1] \
    0 [expr $gWindowSize - 1]
volReslice SetResliceAxesDirectionCosines \
    0 0 1 \
    0 1 0 \
    1 0 0
volReslice InterpolateOn
volReslice SetOutputDimensionality 3

SetResliceAxesDirectionConsines sets the direction in which the reslicer
reslices the volume. Then connect it to an image viewer:

imageViewer SetInput [volReslice GetOutput]
imageViewer SetZSlice 128
imageViewer SetColorWindow 200
imageViewer SetColorLevel 100

You can have a slider call:

imageViewer SetZSlice $newSlice

to change the slice interactively.

-- 
Kevin Teich





More information about the vtkusers mailing list