How to programmatically add the LineWidget?

Thank you very much! This really does improve the situation. However, for some reason, when I add a lineWidget, the handles are not immediately visible - they become visible as soon as I click on the 2D slice (apparently something needs to be updated, although I do renderWindow.render() inside the function itself).

I also now need to perform a similar operation with ellipseWidget and there is no updateHandleVisibility() method in its body. Here is a list of available methods:



image

Please let me know if it is possible to show ellipseWidget the same way as lineWidget, since the situation with ellipseWidget is a little more complicated, because the figure itself is not drawn and only the text is visible.