How to perform a transformation to each slice individually?

lucky via vtkusers <[email protected]> Thu, 23 May 2019 02:56:48 -0700 (MST)
Newsgroups gmane.comp.lib.vtk.user
Message-ID <[email protected]>
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
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtkusers