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

Web Worker unable to load image with JP2 Header file. #238

Open
Neuroforge opened this issue Jan 29, 2019 · 4 comments
Open

Web Worker unable to load image with JP2 Header file. #238

Neuroforge opened this issue Jan 29, 2019 · 4 comments
Labels

Comments

@Neuroforge
Copy link

When loading the Web Worker the following image throws an error.

https://sourceforge.net/p/gdcm/gdcmdata/ci/master/tree/ELSCINT1_JP2vsJ2K.dcm?format=raw

There are a number of images of this type which throws the error.

wado-image-loader-codecs.min.js:108163 Uncaught Error: JPX Error: Unsupported COD options (selectiveArithmeticCodingBypass)

The loaded image does not have a getCanvas() method attached to it.

@malaterre
Copy link
Contributor

malaterre commented Jan 30, 2019

Just for reference, the file ELSCINT1_JP2vsJ2K.dcm is a well known case where the private vendor sent the full JP2 header instead of a raw JPEG 2000 codestream.

This is clearly unacceptable from a strict point of view:

Note in particular that the JP2 file header is not sent in the JPEG 2000 bit stream that is encapsulated in DICOM.

The question left open is of course: what is the course of action for cornerstone: should support or not ?

@Neuroforge
Copy link
Author

Is it possible to strip this header and 'normalise' the image in javascript before trying to load it in cornerstone?

@malaterre
Copy link
Contributor

malaterre commented Feb 14, 2019

AFAIK the codec used by cornerstone for JPEG2000 is OpenJPEG. Since the above JP2 is well handled by OpenJPEG, I would suggest to update the support for JPEG2000 to handle both J2K and JP2 and be done with this (this is what GDCM does BTW).

OpenJPEG has always had a poor support for parsing operation (non-decoding ones). For instance:

so I believe this is a no-go solution (unless someone wants to implement a simple JP2 parser). For reference:

@dannyrb dannyrb added 🐛 Bug: Verified Bug reported, reproducible, and verified. 🙋‍♀️ Up For Grabs Decode: JPX labels Mar 27, 2019
@malaterre
Copy link
Contributor

@chafey You mentionned in some other bug report that focus should be on legal image only. This one has a JP2 header which has been prohibited since day 1 in the DICOM standard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants