YHJ
November 14, 2022, 7:25am
1
Hello,
I don’t want “LineWidget” to be drawn behind “ImageSlice Actor”.
This image is the result of adjusting the “Slice Index”.
I tried to adjust the Manipulator of LineWidget’s HandleRepresentations, but the result was not good.
What direction should I approach to solve this problem?
Thanks
YHJ
November 14, 2022, 8:27am
2
I’ll ask and answer myself
I referred to the code of Paint Widget Example.
lineWidget.current = vtkLineWidget.newInstance(); //lineWidget instance
const activeActorMapper = contextActions.getActiveActorData().sliceObj.mapper;
const slicingMode = activeActorMapper.getSlicingMode() % 3;
const ijk = [0, 0, 0];
const position = [0, 0, 0];
ijk[slicingMode] = activeActorMapper.getSlice();
commonData.source.indexToWorld(ijk, position);
lineWidget.current.getManipulator().setUserOrigin(position);
1 Like
finetjul
(Julien Finet)
November 14, 2022, 8:28am
3
Make sure the handles of the line widget are positionned in front of the scene. (i.e. between the vtkImageData bounds and the camera position)
YHJ
November 14, 2022, 8:35am
4
Thank you for your answer.
I am now trying to create a function that saves a record using “Line Widget” for each “Slice Index” and shows it again when it reaches that “Slice Index”.