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:

https://codesandbox.io/s/volume-rendering-bounds-forked-e8433n?file=/src/index.js

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:

Hello, can you package and send me a complete implementation of this feature? I’m working on it but encountered some issues Thank you

The fix has been merged into VTK.js master. Feel free to download/use the latest version.

I looked at his example. What I want is different from his. I want to display an image combined with 3 slices, and then I can drag the control points to adjust the slice of the corresponding slice. It should look like this


I am just missing this one feature now, please help me

I implemented a basic version, but there are still some issues https://codesandbox.io/p/sandbox/volume-rendering-bounds-forked-llhrpt

  1. The control point dragging has issues, not accurate enough
  2. The control points of each slice should be mutually independent, not affecting each other when dragging
  3. The control points of each slice can only move in the direction of this slice
    Can you help me?

It’s strange that the spheres should move the current slice. I would expect the control handles to be ON the slice instead.

What should I do? I also made some modifications based on your example

From a user perspective, I think I would prefer if the “planes” are draggable instead of the handles.

I would create a vtkPlaneWidget. The user can click whereever on a plane to scroll it.
The widget could be transparent but have a rectangle border with a red, green or blue color.

That’s a bit of work though. (We can help if you have funding).

Alternatively, you could rely on the soon to be merged vtkTransformControlsWidget