Slowly rendering widget from 3D Slicer in wasm

Hello, I have built a widget display from 3D Slicer in WebAssembly (you can check out the instructions at this link Instruction by 3dSlicer - Google Docs), but when rendering, it all happens quite slowly. Can you please suggest what could be the reason? Just to provide a direction for investigations, because for example, vtk.js works correctly on vtk.js. 3D Slicer uses vtkTubeFilter under the hood.

You should be able to use the developer tools in the browser to pause the code periodically and look at the stack. This should give you an idea where the time is being taken. If the stack isn’t readable for the wasm code you could instead instrument the C++ code with some kinds of counters to track how often different methods are being called in response to events.

Thank you for sharing the code and your document. As you go forward with this project it would be helpful if you created a git repository to track the changes you make and so that others can more easily reproduce your configuration and help debug and/or contribute improvements.

1 Like