-
Notifications
You must be signed in to change notification settings - Fork 324
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
[Bug] Cannot destructure property 'imagePositionPatient' of 'getMetaData(...)' as it is undefined #1730
Comments
The previous version of Cornerstone was 2.8.0, and I thought the latest version would solve the problem. However, updating to the latest version still has this issue |
Please post the full stacktrace |
Have you solved it? I have the same problem |
I am having the same problem, essentially. When loading a volume using wadouri, the metaData.get() method returns undefined sometimes, which obviously prevents the viewport from rendering. The actual error reported depends on some other factors, whether it's just an undefined error or an "unable to destructure" error (like above). I have prepared the simplest possible example of the issue that I was able to reproduce. See here, a forked copy of the Cornerstone nextjs example app, that has been modified to load images using wadouri (from TCIA): https://github.com/quasarj/nextjs-cornerstone3d Interestingly, it works... but only when set to SAGITTAL. See here, just changing to AXIAL (or anything, in my testing) causes it to fail with the above error: https://github.com/quasarj/nextjs-cornerstone3d/tree/broken The stack trace in this example: |
I suspect that there are some layers of the image that are not loaded, and then call the metaData data. Now I am opening a timer to get the metaData information of each layer, and each layer needs to obtain success. Only after success can we execute setVolumesForViewports. And then the rendering is done |
I've tried adding some various timers/wrappers to make sure all the slices are downloaded before I attempt to execute setVolumesForViewports, but that wasn't working either. I'll see if I can put together an example... |
await volume.load(); |
You can upgrade all cornerstonejs to version 2.14.2 , have a try. |
Any update on this? |
I updated to the latest version (2.15.4), but I still have this problem. I still follow the method I used above. I suspect that the layer was not downloaded, and then I went to metaData to get the data |
can you give us a working example that shows this issue (from start (import) to finish) |
Describe the Bug
Why does the setVolumesForViewports method report an error message 'Cannot destruction property' imagePositionPatient 'of' getMetaData (...) 'as it is undefined? I used pydicom to check if the file contains' imagePositionPatient'
Steps to Reproduce
The current behavior
pydicom
The expected behavior
No error reported
OS
Windows10
Node version
v18.19.0
Browser
chrome 131.0.6778.205
The text was updated successfully, but these errors were encountered: