Segmentation bounds cropped even when "cropped to minimum extent" is unchecked

Sequence of events:

  1. Create segmentation using slicer
  2. modify segmentation in external python script using pynrrd
  3. re-import segmentation into slicer
  4. modify segmentation in slicer
  5. save segmentation
  6. This saved segmentation has been cropped to its minimum extent even though checkbox in save dialog is not checked.

I ran this through Claude Opus 4.7 and it had a couple of suggestions, which I did try but did not appear to fix the problem; I haven’t had a chance to investigate further. Just wondering if anyone has run into this before.

The segmentation in question is fed into biomedisa (https://biomedisa.info/), which requires the segmentation and the volume data to have the same dimensions.

Anyway, this is an odd corner case and likely hasn’t been a huge issue. I can post Claude Opus’ suggestions if anyone is interested.

I would suggest checking the segmentation dimensions at each of your steps above. That may help you narrow down when the issue occurs. For example, when you modify the segmentation with pynrrd, is it already cropped, or does that occur at the re-import step, etc. Also, are the middle steps important? For example, if you just create a segmentation, edit it, and save (without checking the box), is the output correct? If that works, a workaround might be to set the segment geometry to match the source volume after step 4.

Hi Mike,

Thanks for the reply. The segmentation bounds determined from looking at the NRRD header are the same until step 5 where I save it from slicer.

Just re-setting the segment geometry isn’t sufficient, I had to write a script to pad out the segmentation bounds to restore it to its original extent. (I can post this if anybody’s interested.)