fix(core): Enhance data type handling, caching, and texture processing #1615
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.
Fixes #1614
Fixes OHIF/Viewers#4352
This pull request includes various changes to improve data type handling, caching, and texture processing in the codebase. The most important changes include adding new methods for cloning and restoring configuration states, introducing a function to convert data types, and optimizing the handling of pixel data types.
Enhancements to data type handling:
packages/core/src/RenderingEngine/vtkClasses/vtkStreamingOpenGLTexture.js
: Added aconvertDataType
function to convert input data arrays to specified data types and updated texture handling to use this function when necessary. [1] [2] [3]Improvements to caching:
packages/core/src/utilities/generateVolumePropsFromImageIds.ts
: Introduced caching mechanisms to determine data types from cached images and added aconstructorToTypedArray
map for better type management. [1] [2] [3]Enhancements to configuration state management:
common/reviews/api/core.api.md
andpackages/core/src/utilities/imageRetrieveMetadataProvider.ts
: Addedclone
andrestore
methods to manage the configuration state, allowing for better state management. [1] [2]Refactoring and code cleanup:
packages/dicomImageLoader/src/decodeImageFrameWorker.js
: Refactored thedecodeImageFrame
function, reintroducing it with improvements, and moved thetypedArrayConstructors
object for better organization. [1] [2] [3] [4] [5]Added validation for pixel data types:
packages/dicomImageLoader/src/shared/getPixelDataTypeFromMinMax.ts
: Added avalidatePixelDataType
function to ensure the correct TypedArray type is used based on the min and max pixel values. [1] [2]