[vtkusers] Calculate PixelSpacing for Output of vtkImageReslice

Philip Spitzlinger p.spitzlinger at synedra.com
Fri Feb 20 10:52:34 EST 2009


Hi Everybody,

I am using vtkImageReslice to create sliced images out of a volume.
I am setting the ResliceAxesOrigin and the ResliceAxesDirectionCosines 
to create a rotated slice.

What I would like to know is the pixel spacing that the output 
image/volume will have before the reslicing operation.

One way would be to create a temporary vtkImageData and read the needed 
information out of it.

vtkImageData* temp = reslicer->GetOutput();
temp->Update();
temp->GetSpacing( x, y, z )

As this is higly inefficient, there must be a way to calculate the 
resulting spacing ahead, as vtkImageReslice must calculate it in some way.
In the documentation is written, that the output spacing is the input 
spacing permuted by the ResliceAxes.
What does permuted in this context mean?
How can I use this information to calculate the output spacing.

Thanks in advance for any suggestions or hints,
       Philip



More information about the vtkusers mailing list