new here. I’m processing CT scan data and I need to extract a resampled, arbitrarily oriented, cross section of my volume. I need a slice that doesn’t show artifacts/stripes, and I need it with the same resolution as the volume (i.e. not a screen shot). For those familiar with Fiji, I need the exact same thing as “Reslice”, but with a plane that can be oriented in any direction.
It requires the preliminary creation of a markup plane, which is used for creating a new volume with unitary thickness. This volume can then be exported as a 2D image with correct dimensions.
What I do is rotate a plane (Slice intersection/Interaction), focusing on the yellow view, until I find the orientation I need. Then I create a markup plane directly on the yellow view and run my script. That works very well.
The only problem is that the markup plane is always way too large when I create it:
I know I can manually reduce its width and height, but I’m looking for an automatic way to do that. More precisely, I’m looking for a way to adjust the markup plane to the valid data displayed in the yellow view:
The validity of the displayed data can be accessed with the data probe (it displays “out of frame” for the surrounding pixels), so maybe I’m looking for a way to get all the valid pixels in the selected view and then their bounding box.
You can use the Transforms to move the volume instead of just using the view. Then you can resample the volume through the transform so that the pixels are in the plane of interest and you can then access the data as a slice, e.g. as a numpy array.
Thank you for your answer. This is probably what I’m going to do if don’t find any other solution.
I started by rotating the planes because I find it more convenient than rotating the whole volume, especially when there are multiple views to extract.
You may want to look into the “Reorient Volume” option in the CropVolume. Tutorial here to show an example of how to bring a randomly oriented volume to canonical orientation and then resample in that orientation, but the idea still applies:
Thank you for hinting me at this module. In my case I don’t have any prefered orientation for the whole scan (several specimens may have been scanned together), and I will have to select multiple planes in each volume. Reorienting the whole volume is not the most convenient approach, that’s why I started with cross section planes.