No image return when i use cornerstone.loadAndCacheImage(imageId)
See original GitHub issueconst imageId = cornerstoneWADOImageLoader.wadouri.fileManager.add(file);
var element = document.getElementById('dicomImage');
cornerstone.enable(element);
cornerstone.loadAndCacheImage(imageId).then((image) => {
console.log(image)
//const viewport = cornerstone.getDefaultViewportForImage(element, image);
cornerstone.displayImage(element, image);
});
Nothing print out in the callback and the promise is pending Browser print out an error cornerstoneWADOImageLoaderWebWorker.js:1 Uncaught SyntaxError: Unexpected token <
Issue Analytics
- State:
- Created 6 years ago
- Comments:13 (3 by maintainers)
Top Results From Across the Web
unable to load a dicom image using cornerstone
I am trying to load a dicom image using cornerstone library. I get an error - uncaught exception: loadImage: no image loader for...
Read more >How to use the cornerstone-core.loadAndCacheImage ... - Snyk
Use Snyk Code to scan source code in minutes - no build needed - and fix issues ... loadAndCacheImage(imageId).then( function(image) { console.log(image); ...
Read more >Image Loaders - cornerstone
The ImageLoader will return an Image Load Object containing a Promise which it will resolve with the corresponding Image Object once it has...
Read more >Dynamic multiple images. - Google Groups
updates the image display. function updateTheImage(imageIndex) {. return cornerstone.loadAndCacheImage(imageIds[imageIndex]).then(function(image) {.
Read more >cornerstonejs Demo 示例_Allen-沐风的博客
loadImage(imageId).then(function(image) { cornerstone. ... stylesheet - included to make things pretty, not needed or used by cornerstone ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Alright took awhile but I finally got it working with all of my files. For the Explicit VR Little Endian it wasn’t pako I was missing, I never initialized the WebWorker.
When I didn’t provide any config to initialize with, it was using the default config. I assumed the default was using the codec provided by the NPM package since some of my images were still working just fine.
Turns out those scripts aren’t hooked up to work through the package so, I put them into my public folder in a folder called “ImageLoaderScripts” and used this:
When adding this line to the code all of my images load perfectly. If I remove it I get the error message:
Uncaught SyntaxError: Unexpected token <
Stepping through the NPM bundled code I believe the spot that throws the error is createImage.js#L77 I’m guessing when it can’t decode the image, because it’s missing a codec, the promise just rejects without explaining why. Is there an earlier spot we could throw an error that lets us know we’re missing something like codecs?
@MasonBergstrom, is this an accurate summary of what you would like to see addressed? https://github.com/cornerstonejs/cornerstoneWADOImageLoader/issues/252