I need to obtain arbitrary slices of 3D data. I need these slices to be rectilinear and uniform. I figured out that probing it with an appropriate input geometry would do the trick.
Is there any simple way to create the input geometry from a plane. (Specifying the origin and normal of the plane?)
I allready tried vtkImageReslice but it does not work. It only works with ImageDataInput. I need an approach that also works with unstructured grids. Additionally I am working with a vector field and vtkImageReslice only works with scalar input.
I think that vtkProbeFilter will work. But my main problem is that I can’t find an elegant way to obtain a regular grid as input.
The vtkResampleToImage filter will take an unstructured grid as input and produce a vtkImageData as output. You can choose the dimensions and spacing of the output sample points, but not the orientation (but you could rotate the unstructured grid before passing it to vtkResampleToImage).
In PyVista, we have a convienance method to generate a uniform, rectilinear mesh from a Plane source: pyvista.Plane. This can be oriented at any normal and with any origin
We basically implement this with the vtkPlaneSource algorithm and have some internal code that allows us to translate it easily using the defined normal.
Then you could probe/sample your other dataset for data values to create your “slice”: