[vtkusers] Rescaling 3d ImageData
Robert Golebiowski
rgolebiowski at future-processing.com
Sun Jun 14 07:46:22 EDT 2009
Hi All,
I'm looking for a way to rescale a 3d image data to a smaller size. I was
trying to use vtkImageReslice, but I can't make it work the way I want to. I
have two 3d images, I want to rescale the bigger one to the size of the
smaller one, in the way that x and y dimensions of the bigger one are equal
to x and y dimensions of the smaller one. Z-dimension of the bigger one has
to remain the same. I was trying to use:
imageReslice->SetOutputExtent( 0, dimSmallerVol[0]-1, 0, dimSmallerVol[1]-1,
0, dimBiggerVol[2]-1);
but it only clips my image data, but do not rescale it.
I was trying to use vtkTransform with vtkImageReslice
double scaleX = (double)dimSmallerVol[0] / (double)dimBiggerVol[0];
double scaleY = (double)dimSmallerVol[1] / (double)dimBiggerVol[1];
double scaleZ = 1;
vtkTransform *scaleTransf = vtkTransform::New();
scaleTransf->Scale(scaleX,scaleY,scaleZ);
imageReslice->SetResliceTransform(scaleTransf);
but it doesn't seem to work as well. The image isn't clipped, but it isn't
rescaled as well.
I would really appreciate any help,
Kind regards,
Robert Golebiowski
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090614/9ba6a43d/attachment.htm>
More information about the vtkusers
mailing list