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

feat: added promise lifecycle to Viewport and hook for HangingProtocol #3352

Conversation

Ouwen
Copy link
Contributor

@Ouwen Ouwen commented May 3, 2023

Context

It is useful to know when the data containers related to a hanging protocol change are loaded. This PR triggers a new HangingProtocolHook: onLayoutViewportDataContainersLoaded. This only fires once all viewportDataContainers related to running a hanging protocol are complete. The reason it is only a "DataContainer" load is because data is loaded progressively in OHIF. So while the metadata container exists (i.e. empty volume or empty stack)--the actual pixel data may not have been progressively loaded in yet. Future work may consider adding a onLayoutViewportDataLoaded when all data related to a hanging protocol is fully downloaded.

Changes & Results

CornerstoneViewportService previously had many async functions which returned void. Instead, they now return the actual promise these async functions intend to fire. This allows downstream functions to optionally call the .then() or ignore which should keep behaviour exactly the same.

Testing

This feature can be tested by simply using the onLayoutViewportDataContainersLoaded hook on hangingProtocol.

Checklist

PR

  • [] My Pull Request title is descriptive, accurate and follows the
    semantic-release format and guidelines.

Code

  • [] My code has been well-documented (function documentation, inline comments,
    etc.)

Public Documentation Updates

  • [] The documentation page has been updated as necessary for any public API
    additions or removals.

Tested Environment

  • [] "OS:
  • [] "Node version:
  • [] "Browser:

@netlify
Copy link

netlify bot commented May 3, 2023

Deploy Preview for ohif-platform-viewer ready!

Name Link
🔨 Latest commit 6f0fe62
🔍 Latest deploy log https://app.netlify.com/sites/ohif-platform-viewer/deploys/6452001ef3cdd40008b0f9b1
😎 Deploy Preview https://deploy-preview-3352--ohif-platform-viewer.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 settings.

@netlify
Copy link

netlify bot commented May 3, 2023

Deploy Preview for ohif-platform-docs canceled.

Name Link
🔨 Latest commit 6f0fe62
🔍 Latest deploy log https://app.netlify.com/sites/ohif-platform-docs/deploys/6452001e599ad600081649b5

@sedghi sedghi changed the base branch from v3-stable to master June 19, 2023 13:29
@sedghi
Copy link
Member

sedghi commented Jun 19, 2023

@Ouwen Also for this one, any one free you have to work on this?

@sedghi
Copy link
Member

sedghi commented Oct 4, 2023

This is useful we should add it

@sedghi
Copy link
Member

sedghi commented Nov 7, 2023

Closing in favor of #3772

@sedghi sedghi closed this Nov 7, 2023
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 this pull request may close these issues.

2 participants