Crop volume wrong result

Hello, I am using the Crop Volume programmatically to crop with a ROI around a segmentation node (the segmentation node is used for a Mask). In some cases it works, and in others it results in a misalignment like this one bellow:

error

The segmentation on the original volume is fine (it all encompasses some data) but this resulting cropped volume has lost a piece at the bottom (Out of Frame). What could be causing this misalignment on the final crop result?

Thanks!

Hi -

For questions like this is always helps to create a small set of steps so others can reproduce the result that seems wrong (e.g. a small snippet of python code they can paste into slicer like the ones in the script repository). Sometimes the process of creating such a reproducible example can actually lead you to the solution on your own - it’s worked for me more that once!

1 Like

We have been testing rasterization for rounding errors quite thoroughly, so I would be surprised if there were issues. Cross-sectional images may be misleading, especially if spacing is anisotropic, interpolated display is disabled, or you are viewing oblique slices.

As @pieper wrote above, we need to reproduce this case on our own computer to tell if the behavior is correct. An easy way to reproduce is to share the scene (.mrb) file.

1 Like

Changing the Crop Volume Technique to “Voxel Based” solved the problem. I will try to make a working example soon.

1 Like