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

fix js exception when setting invertRgbTransferFunction. safe program… #595

Merged
merged 2 commits into from
May 4, 2023

Conversation

ladeirarodolfo
Copy link
Collaborator

@ladeirarodolfo ladeirarodolfo commented May 3, 2023

…ming only

Safe programming only. This does add any new feature just prevent exceptions

The scenario to occur this is:

  • Loaded ds with different frame series
  • Change WindowLevel
  • Scroll
    Expected:
  • It should not throw an exception

Actual

  • It throws an exception on invertRgbTransferFunction because given function is null
  • Scrolling does not change the displayed frame

Tech inputs.
This occurs because loading another frame will cause a new vtk Object to be generated so transfer function is not yet set when we try to reapply it on https://github.com/cornerstonejs/cornerstone3D-beta/blob/main/packages/core/src/RenderingEngine/StackViewport.ts#L1149

@ladeirarodolfo ladeirarodolfo requested a review from sedghi May 3, 2023 22:25
@netlify
Copy link

netlify bot commented May 3, 2023

Deploy Preview for cornerstone-3d-docs ready!

Name Link
🔨 Latest commit 8b2da3f
🔍 Latest deploy log https://app.netlify.com/sites/cornerstone-3d-docs/deploys/6453a6a5f344b30008c95ef7
😎 Deploy Preview https://deploy-preview-595--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 settings.

@@ -20,6 +20,11 @@
export default function invertRgbTransferFunction(
rgbTransferFunction: any
): void {
// cut in case there is no function at all
if (rgbTransferFunction) {
Copy link
Member

Choose a reason for hiding this comment

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

did you mean if (!rgbTransferFunction) ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes eagle eyes, thank you

@sedghi sedghi merged commit 4ab5d1e into main May 4, 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