-
Notifications
You must be signed in to change notification settings - Fork 285
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(iOS): Implement texture handling for iOS issues in late 16 and 17 #1212
Conversation
… BidirectionalTool.ts
…RectangleROITool.ts
…e in PlanarFreehandROITool.ts
✅ Deploy Preview for cornerstone-3d-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
…eateImage, stackPrefetch, stackContextPrefetch, and loadImageToCanvas
…eateImage, stackPrefetch, stackContextPrefetch, loadImageToCanvas, generateVolumePropsFromImageIds, hasFloatScalingParameters, and hasFloatRescale
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great fix, much needed
Excuse me. I run my project in IPadOS 17.4.1 with cornerstone3D 1.70.10 and encounter with the same situation. The volumeViewport show nothing but a gray rectangle. so what i want to ask is [Bug] Volume viewports not working on ios #1184 fixed and released before v1.70.10? |
Context
There were couple of bugs reported issues for cornerstone on iOS specifically late 16 and 17.
As discussed in
Kitware/vtk-js#3027
#1133
The issue is iOS does not have support for
OES_texture_float_linear
(https://developer.mozilla.org/en-US/docs/Web/API/OES_texture_float_linear) but this feature was wrongly reported as true in the older iOS (https://bugs.webkit.org/show_bug.cgi?id=264404#c2) and from 16.5 ish iOS is throwing errors.We have two other tools for not rendering floats
preferSizeOverAccuracy
: which originally was added for memory management, but under the hood is uses half float textures, and mostly works across the devices, though as the name suggest it has some inaccuracies in high bitsSo This PR will detect if the host device is mobile and set the 16 bit texture (if available) if not it will try to do preferSizeOverAccuracy
Limitations
Although this PR addresses the rendering of the Stack and Volume Viewports, for scenarios like PT SUV scale, we require
Float32Array
as we can't render via 16-bit norms. Therefore, we detect this and simply render the PT in a non-scaled fashion. It would be ideal to find a proper solution to address this final issue.Testing
Checklist
PR
semantic-release format and guidelines.
Code
[] My code has been well-documented (function documentation, inline comments,
etc.)
[] I have run the
yarn build:update-api
to update the API documentation, and havecommitted the changes to this PR. (Read more here https://www.cornerstonejs.org/docs/contribute/update-api)
Public Documentation Updates
additions or removals.
Tested Environment