how to use DistanceWidget ?

Hello! Through RemoteView, the 3D image is transmitted to the front end, how to apply the widget DistanceWidget for distance measurement? What are the function calls between them?

Technically, the 2D rendered image of the 3D scene is being sent through RemoteView.
If you want to do distance measurement, that typically requires hardware picking, it won’t work on a “2D” image with VTK.js. You have 3 options:

  • you perform the picking on the remote server and display the distance widget also on the remote server
  • you perform the picking on the remote server and send the picked 3D coordinates to VTK.js and display the distance widget in VTK.js
  • you have a copy of the data (lower resolution?) in VTK.js and perform the picking on it.

Please note that the depth buffer is not being sent through the remote view. So whatever you render in VTK.js will be displayed “on top” of the remote view.