Using interpolation when cropping volume


I am currently using the cropping feature (converters → crop volume) to select a specific ROI on lung CTs. Using the cropping bounding box, I also crop binary tumor segmentations (read as volumes). The “interpolated cropping”, “Linear” is set by default in Slicer during cropping. But when I crop with this option (interpolation selected), the cropped segmentations are different from the original segmentation (see attached img1, and MRIcron images). The tumor boundary is very different and smaller and the imaging is also slightly less sharp. But when I switch off the interpolation, the cropped tumor segmentation is much closer to the original tumor segmentation (see attached img2). I would like to know why this may be happening and if this is commonly seen behavior? Also, would it be ok if I do all my cropping without the interpolation option for both segmentations as well as imaging volumes? Could that cause any issues in any cases? Thank you very much for your advice!

Image 1:

MRIcron view:

Non-interpolated segmentations (image 2) (cropped is green, original yellow):

Resampling of binary images can be very lossy as you see here when the feature size is close to the resolution of the images, so what you see is not unexpected. If you can increase the resolution you could get better results. Or if you know they are binary data (only zero and non-zero, not multiple non-zero values) you can convert to scalar volumes and perhaps blur before cropping and then re-threshold.

1 Like

Thanks for your reply, Steve. Yes, we are interested in cropping binary segmentations; we see this discrepancy more clearly in binary segmentations than image volumes.

A couple of follow-up questions:

  1. As seen in the pictures, by disabling the interpolation option while cropping, we are not seeing the discrepancy in binary segmentations anymore for some reason. Could that be a reasonable workaround for this issue?”
  2. By increasing the resolution as you suggest, do you mean resampling the entire binary segmentation into a higher resolution spacing and cropping that? How can we do that in Slicer?

Thanks again for your help!

If you are just cropping without transforming (no scaling or rotation) then no interpolation should be used.

If you are applying a transform, then you need to use nearest neighbor in CropVolume for a labelmap to avoid mixing up the segments. If the resolution isn’t good you may want to increase it first, e.g. by setting the geometry in the SegmentEditor (go back and forth between labelmap volume and segmentation as needed).

If you only have one segment, you can make a continuous tone volume (e.g. a float using CastScalarVolume) after converting a labelmap to a scalar volume in the Volumes module. Then you can transform the scalar volume with interpolation and then re-threshold to get a more faithful transformed binary segmentation.

1 Like