I have segmentations/contours which correspond to a CT analogous to this example
They exist only in approximately 20 slices buried within 200 slices of 3d image set. The remaining slices are completely empty space.
For quality assurance purposes I would like to determine where the contours starts and ends so I can save out representative images
e.g. goes from slice 120-140. I would then take sample images from 125, 130 and 135.
The contour files and images are initially DICOM but are converted to nrrd down the line. I suspect you could iterate through the image array to find the slices. I just wonder if there’s an easier way. Any help would be great.