[vtkusers] vtkImageReslice + vtkImageViewer = misscaled image

Slobodan Miskovic bosshcco at gmail.com
Sun Apr 10 06:50:26 EDT 2005


Hello fellow VTK users,
while the issue of getting slices out of 3D volume has been beaten to
death on the list, i still can't get it working properly.
I read in .vti file with XML data reader and pass it to the code
below. Data in the file has bounds (0, 167.6) (0,167.6) (0,78) and
dimensionality (512, 512, 40). When I display the axial view i get a
nice 512x512 image, but if I do either of the other two views result
is a 512x40 image (should be 512x256).
I tried playing with slicer output spacing, but while I can get
correct scale, i also loose slices. Does it matter that the same data
object is also used by vtkImagePlaneWidget?

Thanks in advance,
Slobo

vtkImageReslice * slicer = vtkImageReslice::New();
slicer->SetInput(data);
slicer->InterpolateOn();
slicer->SetResliceAxesOrigin(0, 0, 0);
slicer->SetResliceAxesDirectionCosines( 0, 0, -1, 0, 1, 0, 1, 0, 0);
vtkImageViewer * viewer = vtkImageViewer::New();
viewer->SetInput(slicer->GetOutput());
viewer->SetZSlice(sliceNumber);



More information about the vtkusers mailing list