Skip to content
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

Image range and histogram computation: cache, defer and/or optimize #567

Open
PaulHax opened this issue Mar 25, 2024 · 2 comments · May be fixed by #606
Open

Image range and histogram computation: cache, defer and/or optimize #567

PaulHax opened this issue Mar 25, 2024 · 2 comments · May be fixed by #606

Comments

@PaulHax
Copy link
Collaborator

PaulHax commented Mar 25, 2024

To speed time to first image render, we can improve the range and histrogram computation in useAutoRangeValues:
https://github.com/Kitware/VolView/blob/main/src/composables/useWindowingConfigInitializer.ts#L31-L38

The image is not rendered until the autoRangeValues are computed. Can we defer the computation and do it in a web worker?

The above chunk of code takes ~570ms for the CT volume here:
https://volview-dev.kitware.app/?urls=[https://data.kitware.com/api/v1/file/63f39e907b0dfcc98f669cc6/download/joe-slim-pet-ct.zip]
Can we optimize/parallelize?

autoRangeValues is computed 3 times for the same image on the initial load. Probably not needed.

@floryst
Copy link
Collaborator

floryst commented Mar 25, 2024

This is semi-related to streaming (i.e. computation on chunks and merging results) and making sure various pieces of the app (e.g. the transfer function widget) don't re-compute the range & histogram.

@PaulHax PaulHax linked a pull request Jun 26, 2024 that will close this issue
7 tasks
@floryst
Copy link
Collaborator

floryst commented Jun 27, 2024

An implementation note: the linked PR merely shunts the computation to a webworker. It still computes the histogram once per view, which is still inefficient. This can probably be resolved via some store state that tracks requests for window/level histograms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants