[vtkusers] orthogonal slices through a volume

Beau Sapach beau.sapach at ualberta.ca
Mon Aug 21 12:46:31 EDT 2006


You may want to look at the vtkImagePlaneWidget class and its
SetPlaneOrientation function.  Using this function you could set the plane's
normal to x, y or z axis (0, 1 and 2 respectively).

 

Beau 

 

From: vtkusers-bounces+beau.sapach=ualberta.ca at vtk.org
[mailto:vtkusers-bounces+beau.sapach=ualberta.ca at vtk.org] On Behalf Of Anja
Ende
Sent: Monday, August 21, 2006 10:36 AM
To: vtkusers
Subject: [vtkusers] orthogonal slices through a volume

 

Hi everyone,

I know this question has been asked before but I could not find an answer
that could have helped me, so I am asking again.

Well... I am trying to get the classic 3 orthogonal slices through a volume.
I know the vtkImageViewer2 provides this functionality but I cannot use that
component unfortunately. 

I was trying to use the vtkImageReslicer to get the XZ plane through the
volume. 

So, I tried setting up the matrix as follows:

vtkImageReslice * slicer = vtkImageReslice::New();
slicer->SetInput(imageChangeInformationP->GetOutput()); 
slicer->SetResliceAxesDirectionCosines(1, 0, 0, 0, 0, 1, 0, -1, 0);

Is this matrix correct if I want to get the XZ plane out of the volume? I
ask because some of the slices in the beginning and end seem bogus. The
vtkImageViewer2 does not show them when I set the orientation to XZ in the
vtk viewer. 

Also, I noticed that the vtkImageViewer2 displays the volume nicely with
correct aspect ratio and all that... So, I tried using:

slicer->SetOutputSpacing(1.0, 1.0, 1.0);

This was shown in the example. However, this changes my extents and the
number of Z slices reduces. 

I was wondering if someone can help me determine the correct matrix for
extracting these planes.

Thanks,

Anja 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20060821/4ae05651/attachment.htm>


More information about the vtkusers mailing list