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: Capture error messages thrown by vtk #1038

Merged
merged 17 commits into from
Jan 31, 2024

Conversation

baokeyu123
Copy link
Contributor

@baokeyu123 baokeyu123 commented Jan 25, 2024

Context

Due to vtk.js version update.
DataArray.js add conditional judgment

  if (model.size % model.numberOfComponents !== 0) {
    throw new RangeError('model.size is not a multiple of model.numberOfComponents');
  }

i think that we should add condition to capture error message in Vtk.

image

Changes & Results

Capture error information by dispatch Events.IMAGE_LOAD_ERROR

Testing

after:
image

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.

Tested Environment

  • "OS:
  • "Node version:
  • "Browser:

Copy link

netlify bot commented Jan 25, 2024

Deploy Preview for cornerstone-3d-docs ready!

Name Link
🔨 Latest commit 4d86e16
🔍 Latest deploy log https://app.netlify.com/sites/cornerstone-3d-docs/deploys/65b7907bddb4ec0008ea226e
😎 Deploy Preview https://deploy-preview-1038--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.

@sedghi
Copy link
Member

sedghi commented Jan 26, 2024

I think this is related PR #1043
Do you actually have any data to test this? Unfortunately, I don't have any data to test for 1043.

@baokeyu123
Copy link
Contributor Author

Do you actually have any data to test this? Unfortunately, I don't have any data to test for 1043

yes. dicom tag(00280004) is RGB.
But PR1043 is only for the changes made to RGB DICOM. I have not tested all color(such as RGBA,MONOCHROME2,MONOCHROME1,YBR_FULL).
createVTKImageData error information can be captured through PR code.

@Blackman99
Copy link
Contributor

This is exactly what we're facing too.

@sedghi
Copy link
Member

sedghi commented Jan 29, 2024

If someone can provide test data, I would be happy to test and merge this. Unfortunately, I cannot blindly approve it without the necessary information.

@Blackman99
Copy link
Contributor

Blackman99 commented Jan 30, 2024

The current Promise.allSettled function would always return a array, the item of which is either a fullfilled or a rejected promise. The problem is the current code do nothing even if there are some rejected results. It would cause the user get nothing when some error happened.

This PR add the error handle part which can handle any error happened during getLoaderImageOptions and dispatch the IMAGE_LOAD_ERROR event by eventTarget. So the user can use the eventTarget.addEventListener to get error message

@baokeyu123
Copy link
Contributor Author

If someone can provide test data, I would be happy to test and merge this. Unfortunately, I cannot blindly approve it without the necessary information.

Firstly,based on dicomImageLoader's wadors to load Dicom image(cornerstoneDICOMImageLoader.wadors.metaDataManager.add(imageId,metadata)).
Secondly,accept set multipart/related;type=application/dicom in request header.
Finally,make sure dicom tag (0028004) is RGB.
Regardless of PR1038 and PR1043, the problem can be reproduced.
I don't think it can be reproduced simply by giving you the .dcm file.I have to think about how to help you reproduce the problem.

Copy link
Member

@sedghi sedghi left a comment

Choose a reason for hiding this comment

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

Makes sense thanks

@sedghi sedghi merged commit 9a9206d into cornerstonejs:main Jan 31, 2024
9 checks passed
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.

3 participants