Skip to content

ENH: Add JPEG2000 support#1406

Merged
lassoan merged 1 commit into
commontk:masterfrom
lassoan:add-dcmtk-jp2k-support
May 11, 2026
Merged

ENH: Add JPEG2000 support#1406
lassoan merged 1 commit into
commontk:masterfrom
lassoan:add-dcmtk-jp2k-support

Conversation

@lassoan
Copy link
Copy Markdown
Member

@lassoan lassoan commented Apr 1, 2026

The change only has effect if CTK is used with DCMTK that is built with DCMTKcs JPG2K module.

@lassoan lassoan self-assigned this Apr 1, 2026
Copy link
Copy Markdown
Contributor

@jamesobutler jamesobutler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will you be updating the DCMTK build configuration in https://github.com/commontk/CTK/blob/master/CMakeExternals/DCMTK.cmake with the defined option for DCMTK_WITH_DCMJP2KCS? This being for folks or CI building CTK on its own with its defined external projects.

@lassoan
Copy link
Copy Markdown
Member Author

lassoan commented Apr 1, 2026

Will you be updating the DCMTK build configuration in https://github.com/commontk/CTK/blob/master/CMakeExternals/DCMTK.cmake with the defined option for DCMTK_WITH_DCMJP2KCS? This being for folks or CI building CTK on its own with its defined external projects.

Yes, we could do that. It would serve as a simple example and test for DCMTKcs. I would just wait for the DCMTK/DCMTKcs implementation to be finalized - see if we need to fork DCMTK, or DCMTK upstream accepts our patch, etc.

Copy link
Copy Markdown
Contributor

@hjmjohnson hjmjohnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks correct as the first step.

@hjmjohnson
Copy link
Copy Markdown
Contributor

Quick upstream-status check for reviewers — the DCMTK side of this story is settled.

DCMTK upstream — what landed, what didn't
What Where State
DCMTK_EXTERNAL_MODULES CMake mechanism (the prerequisite for building dcmjp2kcs alongside DCMTK without copying it into the source tree) DCMTK/dcmtk#144Make it easier to add external DCMTK modules Merged upstream as commit d974b87ca. The GitHub PR shows closed (not merged) because the canonical DCMTK repo is internal at Kitware/OFFIS and GitHub is a mirror — see @michaelonken's last comment on #144: "Merged in commit d974b87ca, visible upstream in a few days after running through our internal build dashboard." Reviewed by @michaelonken / @jriesmeier / @eichelberg.
The actual dcmjp2kcs codec module lassoan/DCMTKcs (community-supported, last pushed 2026-04-14) Not in upstream DCMTK proper. Built externally via the new DCMTK_EXTERNAL_MODULES mechanism.
Competing / follow-up DCMTK PRs (JP2K, JPEG2000, dcmjp2k) gh search prs --repo DCMTK/dcmtk None. Only #144 matches. No open upstream blocker, no superseding work.
Implications for this PR
  • The mechanism this PR depends on is in DCMTK upstream as of d974b87ca (2026-04-14).
  • CTK's change is purely the consumer-side opt-in, gated on #ifdef DCMTK_WITH_DCMJP2KCS, so it's a no-op for any DCMTK build that does not opt into the codec — fully backwards-compatible.
  • Worth confirming that commontk/DCMTK's pinned tag in CMakeExternals/DCMTK.cmake either already contains d974b87ca or gets bumped before any project tries to actually exercise the JP2K path. The #ifdef makes that pre-condition a runtime non-issue, just a build-system one.
  • No reason to wait on additional upstream work; this is mergeable from the DCMTK-side as soon as CTK reviewers are happy with the C++ change.

@lassoan
Copy link
Copy Markdown
Member Author

lassoan commented Apr 28, 2026

DCMTK has merged the OpenJPEG library patch today (that was needed to avoid CMake changes in projects that link DCMTK libraries) into their internal repository (see DCMTK/dcmtk#145 (comment)). Their github repository should be updated tomorrow and then I can finalize the changes (move DCMTKcs to the Slicer organization and then finalize merge all the pull requests) in the next few days.

Requires DCMTK built with DCMTKcs JPG2K module.
@lassoan lassoan force-pushed the add-dcmtk-jp2k-support branch from 5e3969c to 4b8ec0e Compare May 11, 2026 14:50
@lassoan lassoan merged commit a54983b into commontk:master May 11, 2026
4 checks passed
@lassoan lassoan deleted the add-dcmtk-jp2k-support branch May 11, 2026 23:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants