Uncaught JPEG2000 decoder returned width of undefined, when 240 is expected

118 views
Skip to first unread message

Ivan Kuschevatzky

unread,
Apr 14, 2015, 2:20:31 AM4/14/15
to cornerston...@googlegroups.com
Hi Chris,

First of all, thank you for all the scripts you've made. They are great!

I'm developing an app that connects to an Orthanc Server where I store DICOM of some of our patients (that server has currently a self-signed SSL certificate). Once we finish the development we'll get another certificate (one provided by a valid CA).

I'm loading one of your scripts from a second server (http://www.teleradium.com/medicos/test) which connects to the Orthanc server and queries for an image (if you go to the link I provided you'll see that the default url to dicom.teleradium.com is set by default).

When I use that url from my browser I download the dcm file. When I test it from one of the examples (https://rawgit.com/chafey/cornerstoneWADOImageLoader/master/examples/index.html) it also work, but when I test it from my second server (http://www.teleradium.com/medicos/test) I'm getting the following error: Uncaught JPEG2000 decoder returned width of undefined, when 240 is expected

CORS is enabled and as far as I could debug the file is being downloaded by cornerstoneWADOImageLoader.

Why am I getting this error? Could you provide me some info so I can solve it?

Thank you very much!

Greetings from Argentina.

Chris Hafey

unread,
Apr 14, 2015, 7:09:52 AM4/14/15
to cornerston...@googlegroups.com
I was unable to load the image using your test page or mine, in both cases I got the following error in chrome (open the developer tools and check the network tab):

net::ERR_INSECURE_RESPONSE

A quick google search pointed me to this:

Ivan Kuschevatzky

unread,
Apr 14, 2015, 10:47:07 AM4/14/15
to cornerston...@googlegroups.com
Chris, 

That message you got was because my SSL certificate is self signed, therefore the CA is unrecognized.

To simplify things I disabled SSL, so you can use all the URLs with http instead of https.

If you check now, http://www.teleradium.com/medicos/test will show you the error while if you access that URL manually you'll download the file.

Thank you for your help

Chris Hafey

unread,
Apr 14, 2015, 10:57:42 AM4/14/15
to cornerston...@googlegroups.com
chrome is showing 500 server errors on the call to me:

Failed to load resource: the server responded with a status of 500 (Server Error)

Ivan Kuschevatzky

unread,
Apr 14, 2015, 11:39:54 AM4/14/15
to cornerston...@googlegroups.com
It seems that Keep-Alive was making Orthanc send me a 500 Client closed connection message.
Now I disabled it and I tested the following links: 

- http://rawgit.com/chafey/cornerstoneWADOImageLoader/master/examples/index.html (WORKS WHEN I SUPPLY THE NEXT URL)
http://www.teleradium.com/medicos/test (DOESN'T WORK, ERROR: uncaught exception: JPEG2000 decoder returned width of undefined, when 384 is expected).

I don't get why I'm getting that error. Must I install something in my server in order to provide JPEG2000 support?

Thank you

Chris Hafey

unread,
Apr 14, 2015, 11:52:31 AM4/14/15
to cornerston...@googlegroups.com
You are using a newer versions of the dicomParser and JPEG2000 libraries than I am in the demo - perhaps something broke in these newer versions?  

Chris

Jean-Francois Pambrun

unread,
Apr 14, 2015, 11:59:42 AM4/14/15
to cornerston...@googlegroups.com
Chris,

In function extractJPEG2000Pixels(dataSet, width, height, frame), dicomParser.readEncapsulatedPixelData(dataSet, dataSet.elements.x7fe00010, frame) returns an empty Uint8Array[0] even though x7fe00010 is present. 

The problem seems to be in readFragmentsUntil(byteStream, endOfFrame) because byteStream.length is undefined.

JF

Ivan Kuschevatzky

unread,
Apr 14, 2015, 2:33:45 PM4/14/15
to cornerston...@googlegroups.com
I replaced those new javascript files with the ones you're using and now it's working.

Chris Hafey

unread,
Apr 15, 2015, 8:20:21 AM4/15/15
to cornerston...@googlegroups.com
Cornerstone consists of several modules and I use bower to manage version dependencies between them.  If you can use bower, please do so as it should prevent issues like this (I put a lot of effort into testing and version dependency management through bower)

Chris Hafey

unread,
May 30, 2015, 9:49:24 AM5/30/15
to cornerston...@googlegroups.com, cha...@gmail.com
Just pushed an update to dicomParser that should fix this - can you please try it out?  Thanks for being patient, been crazy busy recently :)
Reply all
Reply to author
Forward
0 new messages