I am interested in having a way of visualizing any given oblique slice through a volumetric image data set.
I have a working implementation that utilizes vtkImageSlice, with vtkImageResliceMapper’s SetSlicePlane method and a moveable vtkPlane. This gives me any oblique slice that I want to see.
Now i’m interested in recreating the exact output that I can visually see, but output it to a new 2D vtkImageData object. I would display this new 2D image data using a separate object, sort of as a reference view (since the user will generally be working with a vtkVolume object).
It seems like vtkImageReslice is the way to go. Based on the parameters of the vtkPlane object that I use above, I have been able to calculate the correct ResliceAxes to set to the vtkImageReslice object (as far as I can tell). However, I have been having issues in trying to match the output 2D image exactly - it seems like my SetOutputExtent, SetOutputSpacing, and SetOutputOrigin may be incorrect, but I’m not sure in what way. If I just use the values from the original 3D vtkImageData for extent, spacing, and origin, and I then slice through the 3D image data at a different angle, the output will often be cut off rather than showing the full extent of the image slice. I have also tried SetAutoCropOutput(true); without any success.
Any advice or workarounds would be greatly appreciated. Thanks in advance!