feat(dicomImageLoader): option to enable decoding of JPEG8BitColor images with webworkers #2380
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
JPEG 8bit color images are currently decoded using a browser built-in algorithm. To this end, the pixel data is stored in a Blob and copied into an HTML image object (in file decodeJPEGBaseline8BitColor.ts). However, when loading a large number of color images (e.g., a long series of US captures), the processing becomes slow and leads to blocking of the UI. One reason is that the decoding is done by the browser's UI thread instead of a webworker (which is necessary because DOM elements and functions are not available from webworkers).
This PR introduces an option to the dicomImageLoader's decodeConfig that enables using the (existing) webworker-based JPEG decoder also for 8bit color images, resulting in much faster processing times. The change allows specifying during application initialization that the browser-based decoding should not be used.
Changes & Results
Testing
Checklist
PR
semantic-release format and guidelines.
Code
etc.)
Public Documentation Updates
additions or removals.
Tested Environment