ImageSlice and cropping planes widget

I’ed like to use the ImageCroppingWidget to clip/crop ImageSlices/ImageMappers. I modified the ImageCroppingWidget example to includes ImageSlices:

If I transform the slice plane origins with imageData.worldToIndex (rather than imageData.indexToWorld as with the volume), thing look good…

But if I give a non-zero origin such as
image.setOrigin([100, 0, 0]);

and move the widget handles, the ImageSlices don’t clip right. What am I missing?

This looks like an issue with the ImageMapper’s clipping planes and a non-zeroed image origin. I did a quick test with a clipping plane (normal: [1, 0, 0], origin: [100, 0, 0]) on the ImageMapper example with an image origin of [1, 0, 0], and nothing is clipping. FYI @thewtex

1 Like

This is the fix, methinks: