vtkimagedata direction martix

Hello, I am using vtkCutter to cut a 3D vtkImageData with an arbitrarily-oriented vtkPlane, and then I wish to use vtkProbeFilter to resample the vtkPolyData obtained from vtkCutter as a regular-spacing 2D vtkImage.

As input to vtkProbeFilter I need to define a “2D” vtkImage (a vtkImage with a single layer of cells) that is oriented as the vtkPlane and the vtkPolyData (input and output of vtkCutter respectively). The final output 2D vtkImage will have the same origin, direction, spacing, etc. of the vtkImage I feed to vtkProbeFilter

I am trying to do this by defining the origin and direction matrix of the 2D vtkImage in such a way that it has the same normal as the original vtkPlane, but I always get a vtkImage with the wrong direction. I guess I do not understand the format of this matrix.

Could you please point me to some good working example?

Thanks very much!

In addition, by playing with the direction matrix in a way that I do not completely understand (is it possible that the three axes of the image are stored as column vectors in the matrix?), I was able to obtain a vtkImage oriented in the right way, but it appears that with this image as input I am not able to probe the original 3D image. Is it possible that vtkProbeFilter is one of those filters that do not support image rotation?

Thanks!

Yes, this is exactly how image axes are defined.

Since direction is not mentioned in any of the probe filter’s files, it is most likely that it currently ignores image axis directions. It would be nice if you could implement direction support for this filter in VTK.

Hello, and thanks for explanations.

From other examples it looks like I can use vtkImageReslice, that supports every kind of rotation (and also other transformations). Correct?

This seems more straightforward, but I have problems keeping the output georeferenced…

Thanks again!