[vtkusers] vtkImageData and VTKImageReslice
N.E. Mackenzie Mackay
9nem at qlink.queensu.ca
Wed Jun 30 10:37:23 EDT 2004
Hey everyone,
I am having some difficulties with my results from vtkImageReslice. I
am taking a reslice through a volume along a predefined plane.
The image obtained from the reslice is fine. When I display it in 2D
using VTKImageActor I can see that the origin is in the correct place
and the spacing of the image is correct. What I am trying to do is
place the image in a 3d location which vtkImageActor cannot do unless
the image is orthogonal to x,y or z. I decided to use VTKPlaneSource
and here is where the problem begins. To correctly define the
VTKPlaneSource I need 2 points and a origin. To do this I used this
code:
reslice->Update();
vtkImageData *volumeResliceImage = vtkImageData::New();
volumeResliceImage->DeepCopy(reslice->GetOutput());
float spacing[3];
float origin[3];
float dimensions[3];
volumeResliceImage->GetSpacing(spacing);
volumeResliceImage->GetOrigin(origin);
volumeResliceImage->GetDimensions(dimensions);
When I print off the values from this I get a bunch of garbage outputs.
I was wondering if anyone can see something I have done wrong here. I
kept the above code simple. What I actaully do is pass the image from
the reslice to a vtkImageMapToColors and then get the vtkImageData from
that. Updates are still in the code.
Does anyone have any suggestions?
Neilson
More information about the vtkusers
mailing list