目前遇到一个需求,需要利用VTK对三维体数据进行切片提取。利用到的类是vtkImageReslice,下面是该类的一个介绍:
Reslices a volume along a new set of axes.
vtkImageReslice is the swiss-army-knife of image geometry filters: It can permute, rotate, flip, scale, resample, deform, and pad image data in any combination with reasonably high efficiency. Simple operations such as permutation, resampling and padding are done with similar efficiently to the specialized vtkImagePermute, vtkImageResample, and vtkImagePad filters. There are a number of tasks that vtkImageReslice is well suited for:
- Application of simple rotations, scales, and translations to an image. It is often a good idea to use vtkImageChangeInformation to center the image first, so that scales and rotations occur around the center rather than around the lower-left corner of the image.
- Resampling of one data set to match the voxel sampling of a second data set via the SetInformationInput() method, e.g. for the purpose of comparing two images or combining two images. A transformation, either linear or nonlinear, can be applied at the same time via the SetResliceTransform method if the two images are not in the same coordinate space.
- Extraction of slices from an image volume. The most convenient way to do this is to use SetResliceAxesDirectionCosines() to specify the orientation of the slice. The direction cosines give t