Hello, I have been trying to create a custom workflow GUI on a Slicelet used for segmentation. part of this workflow is a Crop Volume to select only a precise part of the DICOM I try to segment.
I managed pretty well (considering my base skills) to implement the crop function, but I have 2 small problems that I don’t manage to solve :
Is there a way that when I create my ROI, I set it to be located at the Slice Intersection of the currently selected volume?
For the first, you can set the ROI location to the offsets which you can get from the slice nodes (in psuedocode you get the app’s layoutManager and then iterate through the slice views to get their slide nodes from which you can get the planes which can be used to figure out the intersection.
For the second probably it’s a window/level auto on the cropped volume. So you can copy the source window and level from the display node to the new cropped node’s display node.
Okay so if I understand well, there is no way I can get the intersection coordinates, or the crossbar coordinates (since that option exists also) through a builtin function? I have to figure out a process to get it, right?
Hmmm okay I think I get it, I’ve got to copy the level parameters from the original window right? Gotta figure out the code for that
I manage to set the ROI location on the crosshairs location. I have to manually set the crosshair beforehand but that’s already a lot better. I used the following code :
I managed to solve the filtering level by copying the InputVolume in the OutputVolume before doing the crop (previously, OutputVolume was a blank scalar volume node). Simply used the .Copy(inputVolume) method for this one.
Edit : I modified the way I initialize my outputVolume : instead of using .Copy, I use CloneVolume (from Volumes Logic) to be able to have a different name (.Copy creates a volume with the same name which is not optimal to navigate afterwards). Here’s the code :