TwelveMonkeys icon indicating copy to clipboard operation
TwelveMonkeys copied to clipboard

JPEG 2000 format support

Open Lychengit opened this issue 1 year ago • 4 comments

Can it support images in jpeg2000 format?

Lychengit avatar Jul 02 '24 04:07 Lychengit

I had a plan to include a JPEG 2000 plugin, based on the original jj2000 code (used in JAI). I even had working code. However, I don't understand the license of the jj2000 code. And my efforts trying to reach out to the original authors or Sun/Oracle who released the JAI code didn't lead to anything. So I left it there.

Nowadays, the format isn't as widely used or important as we first thought. There's currently no plans to include a JPEG 2000 plugin. But let me know if you are interested in helping developing or funding a plugin, and we'll see.

haraldk avatar Jul 02 '24 08:07 haraldk

Hi @haraldk

I've been trying to read a JPEG2000 encoded DICOM Image and it seems there's nothing out there (in pure Java anyway). And am very interested in the idea that you had it working. So far as I understand, the license situation around jpeg2000 is still not very clear, but growing consensus seems to be that, it can be safely used. There is even a well used c++ library out there which supports it (OpenJPEG) used by many projects.

Not sure if you would be willing to share the working code you had, if you are still not willing to release it. I'm unfortunately not in a position to 'fund a plugin', nor do I have much experience in Image processing (I'm just using image processing libraries) so I don't have much to offer at this stage (though I'd like to find time to learn about it). I can only offer my sincere thanks and appreciation if you are able to help in that regard.

svaens avatar Aug 05 '25 08:08 svaens

Hi, thanks for your interest!

There are already a few projects that provide ImageIO plugins for JPEG 2000 based on the jj2000 reference implementation:

  • https://github.com/jai-imageio/jai-imageio-jpeg2000
  • https://github.com/faceless2/jpeg2000

The original jj2000 source code is available in archive.org:

  • https://web.archive.org/web/20070701182005/http://jpeg2000.epfl.ch/download/jj2000_4.1-src.zip

The license issue is not about the JPEG 2000 format (that would be up to the application), but the licensing on the jj2000 source code itself which has to be modified for the library.

Anyway, if you are fine with these issues, I suggest you try one of the two projects above. If there are bugs or issues stopping you from using them, maybe those can be worked out or fixed there?

haraldk avatar Aug 05 '25 10:08 haraldk

Hi @haraldk Thanks for your prompt response!

I had TBH tried the faceleess2 library (and a few others) - and couldn't get them to read my sample DICOM images out of the box (transfer syntax 1.2.840.10008.1.2.4.91 JPEG 2000 Image Compression ).

Twelvemonkeys was very useful in enabling the use of several different image formats i've seen used in DICOM ( A big "thanks" for that! ). Given my current time constraints, I had been hoping for similar success with JPEG2000.

I will probably continue with other aspects of my DICOM related work, attacking the more low-hanging-fruit so to speak, and come back to the JPEG2000 topic a little later.

If at some point I get something working (and cleaned up) in the future, not having inconvenient licensing baggage, I would be happy to report back.

svaens avatar Aug 05 '25 11:08 svaens