-
-
Notifications
You must be signed in to change notification settings - Fork 382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Perf] Re-rendering multiple dicom images at once #3147
Comments
What exactly does the screenshot represent ? It's odd that you have to create a new texture each time you re-render. Do you confirm that Did you check that |
You mean you have 40 textures and 40 render window? I'm not surprised if that does not achieved 60 fps |
Thank you for your quick responses. I’d like to provide some additional context regarding our current rendering challenges. Summary of Current Situation: Questions and Clarifications:
I would greatly appreciate your feedback and any suggestions on alternative approaches we might explore. If |
If you have that many views in your single page application, it seems that you will get the best performances with having a unique render window with a unique renderer. You would then have many ImageResliceMappers... (or potentially a unique one with a tiled image you created on the cpu) |
Could you please elaborate more on this?
I did not find any examples on how to use vtkImageResliceMapper, could you please direct me to resources/docs on how to use it? |
https://kitware.github.io/vtk-js/examples/ImageResliceMapper.html |
@finetjul Sorry for the late response, I've been away from this project and just getting back. For the one renderer solution I believe the point is to reduce the number of canvas to only one, and use multiple mapper to render the images into the unique canvas to gain performance, right? This is clear and definitly would work somehow, the downside would be we need to re-implement a lot of basic dom stuff like layout/event handling/intersections, etc, we need to discuss the possibiltis internally of course. For now, the rendering performance is acceptable after batching + intersection observers, which means the maximum windows rendered at one screen are less than 500, which is managable. But at the same time, we hit another wall which is the rendering is blocking the main thread a little bit, especially when initializing all these images into the canvases. I know that it is possible to use OffscreenCanvas or even better Web Worker to transfer the canvas manuplations to the another thread. Is it possible for us to do so? Does the library provide any APIs for this kind of process, or how can we 'hack' into the process to do it? |
The ManyRenderWindows shows offscreen rendering: https://kitware.github.io/vtk-js/examples/ManyRenderWindows.html |
I did not find any OffscreenCanvas in the said example. I did find out that cornerstone3D is using OffscreenCanvas to render multiple viewports at one time with a custom render window implementation though: vtkOffscreenMultiRenderWindow |
The offscreen rendering is done under the hood when you have a parent render window ( |
Sorry but I can not find any evidence in the source codes for the usage of OffscreenCanvas. If I'm mistaken here please bare with me. |
Indeed, it does not rely on OffscreenCanvas. That could be a nice addition though... |
High-level description
I'm building a filmer app that the customer would be able to interact with multiple dicom images at once for adjusting say ww/wc, pan, scale etc, and I was aiming for 60fps for smooth real-time interactions.
I'm using vtkOpenGLRenderWindow under the hood and creating multiple renderWindows and each window holds a dicom image (pixel data) for interactions, which is quite similar to the MultipleRenderWindow example, but with some modifications:
.traverseAllPasses()
api instead ofrootWindow.render()
I'm stuck into a sutuation where in my developing machine I can only achive 60fps when re-rendering mostly 40 images at once with strategies implemented as above, when adjusting ww/wl with:
the hardware may be better in production machine but still the number is far less than what I would want to achive, which I would like to keep 60fps when re-rendering about 100 images at once, because the whole app would load over 2000 images at once (the loading performance and the first rendering performance is not a problem here)
With above senerios, what could I do to improve the performance? Or is there anything I do wrong? Is there ways to batch the re-rendering under the hood in vtkjs to squeeze the performance?
Steps to reproduce
It's somehow a little bit complicate to extract the logic out of my app so for now there's none re-produciable steps.
Detailed Current Behavior
Environment
The text was updated successfully, but these errors were encountered: