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

'loadAndCacheImage' thhrow an error #594

Open
ali161997 opened this issue Jun 12, 2022 · 1 comment
Open

'loadAndCacheImage' thhrow an error #594

ali161997 opened this issue Jun 12, 2022 · 1 comment

Comments

@ali161997
Copy link

ali161997 commented Jun 12, 2022

version I use
"cornerstone-core": "^2.3.0",
"cornerstone-math": "^0.1.8",
"cornerstone-wado-image-loader": "^3.1.2",

Issue

when using loadAndCacheImage it throw an error as "Not a JPEG file" and task "task decodeTask failed - Not a JPEG file"

what i should do

`

cornerstone
     .loadAndCacheImage(this.viewer.stacks[this.stackIndex].imageIds[0])
     .then(function(image) {
       // Display the image
       const element = document.getElementById(me.elementId);
       const stack = me.viewer.stacks[me.stackIndex];
       cornerstone.displayImage(element, image);
     })
     .catch((err) => {
       console.error("error is here :", err);
     });`
@nankie
Copy link

nankie commented Apr 1, 2023

use cornerstoneWADOImageLoader in stead of cornerstone-wado-image-loader:

import cornerstoneWADOImageLoader from 'cornerstone-wado-image-loader';

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

No branches or pull requests

2 participants