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

await setVolumesForViewports while converting viewport from stack to vol #1454

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ZuevArseniy
Copy link

@ZuevArseniy ZuevArseniy commented Sep 3, 2024

Context

I suspect, that setVolumesForViewports is missing await in convertStackToVolumeViewport.ts
Similar step in convertVolumeToStack (i.e. setting stack images) has await,
Moreover, while using this function in my project, I observed, that when promise returned by convertStackToVolumeViewport.ts is resolved - it doesn't always contain volume (and actor) for an asset. (Unfortunatelly I can't share these assets, as this is a private medical information). However, upon waiting for couple of seconds, volume is added to viewport and actor becomes available.

Changes & Results

  • added await to setVolumesForViewports

below is the console.log of viewport.getActors() after calling convertStackToVolumeViewport

Screenshot 2024-09-03 at 12 23 14 Screenshot 2024-09-03 at 12 22 38

Testing

I couldn't reproduce it with assets shiped with cornerstone examples, and can't share mine unfortunatelly.
However, I find this change straightforward and unless there was a seriour reason to do so, I suspect this await was just forgotten.
However, to verify that nothing got broken at least, this example could be used https://www.cornerstonejs.org/live-examples/stacktovolumewithannotations

Checklist

PR

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

Code

Public Documentation Updates

  • The documentation page has been updated as necessary for any public API
    additions or removals. (no changes in any public api)

Tested Environment

  • "OS: macOS 13.6.3
  • "Node version: 20.16.0
  • "Browser: Chrome 128.0.6613.86

Copy link

netlify bot commented Sep 3, 2024

Deploy Preview for cornerstone-3d-docs ready!

Name Link
🔨 Latest commit cb1225e
🔍 Latest deploy log https://app.netlify.com/sites/cornerstone-3d-docs/deploys/66d6e4d0ed54fb00082c2646
😎 Deploy Preview https://deploy-preview-1454--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.

Copy link
Contributor

@kom482 kom482 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice bugfix, looks legit for me!

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