Skip to content

grok: add support for Grok JPEG 2000 codec#146

Open
boxerab wants to merge 1 commit intoDCMTK:masterfrom
boxerab:grok
Open

grok: add support for Grok JPEG 2000 codec#146
boxerab wants to merge 1 commit intoDCMTK:masterfrom
boxerab:grok

Conversation

@boxerab
Copy link
Copy Markdown

@boxerab boxerab commented Apr 13, 2026

Grok (https://github.com/GrokImageCompression/grok) is an open source JPEG 2000 codec with performance matching or exceeding commercial toolkits such as Kakadu.

The module supports 4 transfer syntaxes: JPEG 2000 Lossless, JPEG 2000, HTJ2K Lossless, and HTJ2K.

Enable with cmake -DDCMTK_WITH_GROK=ON (requires PKG_CONFIG_PATH pointing to Grok's pkgconfig).

Grok (https://github.com/GrokImageCompression/grok) is an open source
JPEG 2000 codec with performance matching or exceeding commercial
toolkits such as Kakadu.

The module supports 4 transfer syntaxes: JPEG 2000 Lossless, JPEG 2000,
HTJ2K Lossless, and HTJ2K.

Enable with cmake -DDCMTK_WITH_GROK=ON (requires PKG_CONFIG_PATH
pointing to Grok's pkgconfig).
@michaelonken
Copy link
Copy Markdown
Member

Hi Aaraon,

that sounds like a very interesting codec that you implemented. I wonder about the license, is it GPL only? DCMTK is distributed under a BSD-style license and thus it might not be possible to merge the codec into DCMTK.

Also, OFFIS might have other reasons not to merge the PR but I cannot speak for them.

There is also ongoing work of @lassoan (also see link above) from the 3D Slicer team who might be interested in the project.

@lassoan
Copy link
Copy Markdown

lassoan commented Apr 13, 2026

Nice work!

I've implemented (well, mostly written by Claude) a new DCMTK module for JPEG2K support using OpenJPEG. Initially, I've created a patch for DCMTK, but then after discussing with DCMTK maintainers I realized that they would probably not integrate that module into DCMTK, because then they would need to maintain it. This would be a conflict of interest for them, as they are selling a proprietary dcmjp2k module for DCMTK.

To not interfere with their business model, I decided to create a separate repository for community-supported DCMTK modules - DCMTKcs. This way, if someone needs JPEG2K support for free from the community then they can configure their DCMTK build with it. If they prefer to get commercially supported module from DCMTK then they can license it from OFFIS.

I'm open to let anyone contribute additional modules to DCMTKcs, as long as it comes with some minimal documentation and tests, and the tests are passing in the github action. If this pull request does not get integrated then you may consider pushing your changes to DCMTKcs.

@aaron-boxer
Copy link
Copy Markdown

Thank you for your comments, guys. @michaelonken yes the license is only AGPL but it shouldn't stop someone from building it, using it and distributing it. Also, sighhhh, I've encountered the OFFIS "business model" in the past - as @lassoan said it seems a bit delusional in 2026 to not promote excellent open source JPEG 2000 codecs on an open source project like DCMTK. So, I guess this is not going to be merged. @lassoan thanks for setting up this community repository for DCMTK, why don't we make this an organization rather than on your personal repo and I will add these changes. Btw, I ALSO used Claude Code to generate the boilerplate DCMTK code to wire up Grok :)

@lassoan
Copy link
Copy Markdown

lassoan commented Apr 14, 2026

Yes, of course, I'll move the repo to an organization (I planned to use https://github.com/commontk/CTK), as soon as DCMTK folks confirm that they are OK with the external modules concept by merging #144.

The AGPL license of grok could be a huge barrier Do you have a dual licensing model for commercial use, or a commercial application always needs to run a grok-based tool in a separate process?

@aaron-boxer
Copy link
Copy Markdown

The AGPL license of grok could be a huge barrier Do you have a dual licensing model for commercial use

Yes, I offer a commercial license for those who aren't able to use AGPL.

@michaelonken
Copy link
Copy Markdown
Member

Yes, of course, I'll move the repo to an organization (I planned to use https://github.com/commontk/CTK), as soon as DCMTK folks confirm that they are OK with the external modules concept by merging #144.

I just merged this one.

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

Successfully merging this pull request may close these issues.

5 participants