[vtkusers] How to perform a transformation to each slice individually?
lucky
f_u_7 at yahoo.com
Thu May 23 05:56:48 EDT 2019
I have a series of Xray images of a cylindrical part. With that, I can create
and visualize the volume, but the data appear like a stack of slices from -Z
to Z.
What I want is to *rotate each slice image with an incremental angle along
Y-axis* to make the whole volume cylindrical. Something like the following
c++ code.
I have tried *vtkImageReslice* but it transforms the whole volume data not
each slice in an incremental way. How can I perform a transformation to each
slice individually?
Thanks,
Code:
void RotateEachSliceImage(VtkSliceImages& images)
{
int countImages = images.size();
double incrementalAngle = 360.0 / countImages; // incremental angle for
each image
double angle = incrementalAngle;
for (int i = 1; i < countImages; i++)
{
images[i].rotate(angle, 1); // along Y axis
angle = angle + incrementalAngle;
}
}
int main()
{
VtkSliceImages slices(2400);
RotateEachSliceImage(slices);
RenderToVtk(slices);
return 0;
}
--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
More information about the vtkusers
mailing list