I have the vtkResliceCursorWidget functions are not doing the same thing as before

In an inferior vtk.js version I used a function from widgetState (vtkResliceCursorWidget), to hide the sphere in the center I did that:

const widget = vtkResliceCursorWidget.newInstance();
const widgetState = widget.getWidgetState();

widgetState.setOpacity(1);
widgetState.setSphereRadius(10);
widgetState.setLineThickness(1);
widgetState.setShowCenter(false); // I do that to hide the sphere in the center

I was satisfied with the result, as I see the cursor change whenever I hover the mouse over the center even if the we set the showCenter to false, Like below (I have changed the icon of the cursor when we hover):
[video-to-gif output image]

Now I have upgraded vtk.js, I changed the functions above to do the same thing, now the equivelent is:

      widget = vtkResliceCursorWidget.newInstance();
      const widgetState = widget.getWidgetState();
      const t = 1;
      widgetState.getStatesWithLabel('line').forEach((handle) => handle.setScale3(t,t,t));
      widgetState.getStatesWithLabel('handles').forEach((handle) => handle.setOpacity(150));
      widgetState.getStatesWithLabel('rotation').forEach((handle) => handle.setScale1(10));
      widgetState.getCenterHandle().setVisible(false); // to hide the sphere in the center
      widgetState.getCenterHandle().setScale1(20);

Now we don’t see the cursor change when we hover over the center (the showCenter is false) like below:

[video-to-gif output image]

NB: When I set the ShowCenter to true I see the cursor hover change, I don’t want to see the center sphere

The color3 mixin supports opacity. You can make the center handle visible but transparent:
widgetState.getCenterHandle().setColor3(1,1,1,0); or barely translucent widgetState.getCenterHandle().setColor3(1,1,1,0.01); (to allow picking).

Please let us know if that fixes your problem/need.

Thank you for your answer,

It seems that widgetState.getCenterHandle().setColor3() doesn’t accept more than 3 arguments, so it doesn’t work with 4 arguments (I tested it)

That would be widgetState.getCenterHandle().setOpacity(0.01)