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

fix(core): Enhance data type handling, caching, and texture processing #1615

Merged
merged 3 commits into from
Nov 25, 2024

Conversation

sedghi
Copy link
Member

@sedghi sedghi commented Nov 25, 2024

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:

Improvements to caching:

Enhancements to configuration state management:

  • common/reviews/api/core.api.md and packages/core/src/utilities/imageRetrieveMetadataProvider.ts: Added clone and restore methods to manage the configuration state, allowing for better state management. [1] [2]

Refactoring and code cleanup:

Added validation for pixel data types:

…amingOpenGLTexture

-  Introduce `convertDataType` function to convert input data arrays to specified data types for GPU texture updates.
-  Ensure data type consistency by converting scalar data to the target data type in `vtkStreamingOpenGLTexture`.
-  Add caching mechanism to determine data type from cached images in `generateVolumePropsFromImageIds`.
-  Map constructor names to `PixelDataTypedArrayString` for better type handling.
-  Implement `_getDataTypeFromCache` to attempt data type determination from cached images.
-  Refactor `decodeImageFrame` in `decodeImageFrameWorker` to improve code structure and readability.
-  Add `validatePixelDataType` to verify if a given TypedArray type is suitable for a specified pixel value range.
-  Added `clone` and `restore` methods to `imageRetrieveMetadataProvider` for better state management by allowing cloning and restoring of configuration states.
-  Fixed deep copy issue in `internalAddSegmentationRepresentation.ts` by using `JSON.parse(JSON.stringify())` to ensure `CORNERSTONE_COLOR_LUT`
Copy link

stackblitz bot commented Nov 25, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link

netlify bot commented Nov 25, 2024

Deploy Preview for cornerstone-3d-docs ready!

Name Link
🔨 Latest commit 95334a3
🔍 Latest deploy log https://app.netlify.com/sites/cornerstone-3d-docs/deploys/6744b662c4ba840008cd0e75
😎 Deploy Preview https://deploy-preview-1615--cornerstone-3d-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@sedghi sedghi changed the title fix/ttttt fix(core): Enhance data type handling, caching, and texture processing Nov 25, 2024
@sedghi sedghi merged commit 3302aa6 into main Nov 25, 2024
26 checks passed
@sedghi sedghi deleted the fix/ttttt branch November 25, 2024 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant