[vtkusers] problem with Image Reslice

alanomarov at inbox.com alanomarov at inbox.com
Tue Sep 2 13:05:22 EDT 2008


Hello dear vtk users, i am new to VTK and i have a problem.
I have 36 images stored in vtkImageData, but they're displayed as mosaic 
(all pictures at once at the screen). I need to show only one slice at 
time. So i did the following:

            vtkImageReslice* reslice = vtkImageReslice::New();
            reslice->SetInput(data);
            reslice->SetOutputDimensionality(3);
            reslice->SetOutputSpacing(data->GetSpacing());
            reslice->SetOutputExtent(0, 63, 0, 63, 0, 35);     // each 
image is 64x64, 36 slices
            reslice->SetOutputOrigin(0, 0, 0);

Then i try to display resulting data with vtkImageViewer2. But i can 
view only first slice from all slices. When i change slice with 
SetSlice(int) method i see black screen :-(

After a day i spent to this problem i don't know what's the problem. I 
will be glad if anyone know how to reslice/show this correctly. Or may 
be i am wrong at all and there is another method to make 3D image (36 
slices along z axis) from 2D image (36 slices together).
Thanks a lot, Alan.



More information about the vtkusers mailing list