How to show the position of slices?

I want to achieve this effect that can display the position of i,j,k slices in real time. But the example found is written in python, my main language is JavaScript, and by looking at the source code of this python example, I found that it uses the api of SliceRepresentationProxy. But the official documentation does not have an example of using this api. May I ask how to achieve this effect?

If you can do volume rendering and slice rendering independently, you are mostly there. Just add all the actors into the same renderer/renderWindow.

Hello, I tried to use vtkCutter to achieve the effect of displaying the slice position in the volume, but when I use the vtkOutlineFilter of the image, the code will report an error. In the official example, vtkCubeSource is used.


Another problem

I try to get the plane instance of the slice through the vtkResliceCursorWidget instance, by using the getPlaneSourceFromViewType method. But after I add the actor, only one line is shown, why is that?

The current version of vtkCutter is probably only trying to cut Polygons and fails when they are missing. Cutting the outline should result in 4 points or less. I don’t think that’s what you are trying to do…

I don’t know anything on vtkResliceCursorWidget so I’ll skip the second problem.