Skip to content

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

Closed
Ouwen wants to merge 1 commit into
OHIF:masterfrom
gradienthealth:gradienthealth/viewport_promise_lifecycle
Closed

Ouwen wants to merge 1 commit into
OHIF:masterfrom
gradienthealth:gradienthealth/viewport_promise_lifecycle

Conversation

@Ouwen

@Ouwen Ouwen commented May 3, 2023

Copy link
Copy Markdown
Contributor

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

netlify Bot commented May 3, 2023 •

Copy link
Copy Markdown

✅ 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

netlify Bot commented May 3, 2023 •

Copy link
Copy Markdown

✅ 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

sedghi commented Jun 19, 2023

Copy link
Copy Markdown
Member

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

@sedghi

sedghi commented Oct 4, 2023

Copy link
Copy Markdown
Member

This is useful we should add it

@sedghi

sedghi commented Nov 7, 2023

Copy link
Copy Markdown
Member

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