Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Auto flipping of disoriented Mammography images on stack viewport#4353

Open
Adithyan-Dinesh-Trenser wants to merge1 commit intoOHIF:master
base:master
Choose a base branch
Loading
fromgradienthealth:feat/auto-flipping-of-mammogram-images-on-stack-viewport

Conversation

Adithyan-Dinesh-Trenser

Context

The feature is designed to flip the images in the stack viewport, which are initially stored in a flipped orientation. The images are flipped upon loading and when the viewport is reset. It relies on ImageOrientationPatient or PatientOrientation, and ImageLaterality or FrameLaterality to identify the necessary flipping. Primarily, this feature is aimed at MG images that are stored in an incorrect orientation. It is capable of correcting images through vertical and/or horizontal flips, but it does not handle images requiring rotation for correction.

Changes & Results

The activation of the feature is handled through CustomizationService. A function that accepts the metadata instance and returns whether auto-flipping is needed or not is provided in the CustomizationService.

A sample customization

function getCustomizationModule() {return [{name: 'default',value: [{ id: 'orientationCorrectionCriterion', criteria: isOrientationCorrectionNeeded }]}]}

A demo recording of the feature

Auto-flipping-OHIF-upstream-demo.mp4

Testing

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: Windows 11 Pro
  • Node version: 18.17.0
  • Browser: Chrome 127.0.6533.120 (Official Build) (64-bit)

sen-trenser reacted with rocket emoji
@netlifyNetlify
Copy link

netlifybot commentedAug 30, 2024
edited
Loading

Deploy Preview forohif-platform-docs ready!

NameLink
🔨 Latest commit7763d5b
🔍 Latest deploy loghttps://app.netlify.com/sites/ohif-platform-docs/deploys/66fe9447c982330008cfda32
😎 Deploy Previewhttps://deploy-preview-4353--ohif-platform-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 yourNetlify site configuration.

@netlifyNetlify
Copy link

netlifybot commentedAug 30, 2024
edited
Loading

Deploy Preview forohif-dev ready!

NameLink
🔨 Latest commit7763d5b
🔍 Latest deploy loghttps://app.netlify.com/sites/ohif-dev/deploys/66fe9447994f6a00090a8afe
😎 Deploy Previewhttps://deploy-preview-4353--ohif-dev.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 yourNetlify site configuration.

@Adithyan-Dinesh-Trenser
Copy link
Author

Cc :@Ouwen

Ouwen reacted with thumbs up emoji

@Ouwen
Copy link
Contributor

@sedghi let us know if there are changes needed to this PR.@Adithyan-Dinesh-Trenser i would rebase to master in the meantime

@sedghi
Copy link
Member

CC'ing@wayfarer3130 since he has worked on a lot of MG hanging protocols recently

@@ -643,6 +644,18 @@ class CornerstoneViewportService extends PubSubService implements IViewportServi

return viewport.setStack(imageIds, initialImageIndexToUse).then(() => {
viewport.setProperties({ ...properties });

const { customizationService } = this.servicesManager.services;
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't really belong here - this is adding specific behaviour for certain types of images in certain cases. I would suggest adding it to the split/sort rules as part of generating the splitting criteria, and add it into the series level splitting for MG type series that have this issue. Then, the hanging protocol rules can choose to pickup those values for the orientation/position. That is a much more generic approach, and doesn't cause the viewport service to have deep knowledge about how to handle orientation changes.
You could also create a custom orientation/position metadata module as an alternative, and use that module in CS3D as the initial flip setup if it isn't currently set, but if so you need to change the viewport handling so that a viewport with flipHorizontal/flipVertical/initial rotation works correctly when you flip the viewport - that is, flipping the viewport should flip the images FROM the original location.

Copy link
Contributor

Choose a reason for hiding this comment

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

In fact I think this should also be calculated in the hanging protocol service because the same orientation isn't always shown for hanging protocols, and those should still work correctly - that is, left on right or right on left should both be supported by the hanging protocol, and NOT the viewport. Even if you create a default rule and add it into the default hanging protocol, I think doing it there is a better choice, although getting default values in the split/sort rules to apply at hte series level makes that easy to apply in the hanging protocol.

Copy link
Contributor

Choose a reason for hiding this comment

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

What you should do is compute the desired default initial flip state in the display set object, and export it as a metadata instance and apply it here when it is set for the image id/display set uid. It should be applied as the base data, and then rotation/flip etc on TOP of that applies relative to the base rotation etc. That change could actually go into the CS3D library in the stack/volume viewports, or it can be done here as an integrated value. That way, the image "flip" isn't shown by default unless the flip is changed relative to the base flip/rotate state. That is a robust way to specify the values correctly.

@Adithyan-Dinesh-TrenserAdithyan-Dinesh-Trenserforce-pushed thefeat/auto-flipping-of-mammogram-images-on-stack-viewport branch from16453c2 toc6ac613CompareSeptember 27, 2024 11:27
@Adithyan-Dinesh-TrenserAdithyan-Dinesh-Trenserforce-pushed thefeat/auto-flipping-of-mammogram-images-on-stack-viewport branch fromc6ac613 to7763d5bCompareOctober 3, 2024 12:55
@sedghi
Copy link
Member

@wayfarer3130
So what is the decision on this? Do we need it in OHIF upstream?

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@wayfarer3130wayfarer3130wayfarer3130 left review comments

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@Adithyan-Dinesh-Trenser@Ouwen@sedghi@wayfarer3130

[8]ページ先頭

©2009-2025 Movatter.jp