-
I am currently working on an app using Trame and VTK. Users are able to upload a few different file types and the app will display the 3D volume. I have now been working on setting up slicing of the volumes and have run into an issue that I've been stuck on for a bit. When I first run the app, everything works correctly, and users can use the slice plane dropdown and slice index slider to view 2D slices of the 3D volume. Here is a screenshot of what this looks like: After moving the slider around for some time, some of the slices will not display. It is very inconsistent, sometimes it will take 30 seconds before slices stop showing or sometimes it will take a few minutes before it stops working. Also, no errors show up in the console when this occurs. I am not sure if this is a rendering issue or if there is a bug in my code that I am missing. One interesting thing I noticed is that when I toggle the image slice view to off and then back to on the slice that previously didn't display now shows up. Here is the function that handles the slice plane and slice index changes:
Here is the function that is triggered when the slice view is toggled:
Here is the create_slice_data function:
And here is my trame setup:
Please let me know if there is anything else I can provide that would help debug this issue! Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 24 replies
-
Can you replace Long story short, you are running into a bug in the state synchronization protocol from the VtkLocalView. Ideally that will naturally be fixed by trame-vtklocal once available (although volume rendering is not supported in WASM currently). |
Beta Was this translation helpful? Give feedback.
-
I'm having a similar issue, except I haven't gotten to the deployment stage yet. I'll make a new discussion post with my own code and maybe there is some similarity there that will help us both find a solution unless Sebastien's solution worked for Matthew. |
Beta Was this translation helpful? Give feedback.
The local view ignore the interactor setup and just force its own locally.
So like I said, if it is not working with remote view, that is because your VTK code is not correct.
Also why do you render your slice in volume rendering and why do you build the data by hand? Why don't you use VTK to generate those slice for you?