Menu

#522 gdcmconv - JPEG2000 - PI/MCT issue

3.1
accepted
None
5
2022-03-24
2021-05-09
XXX
No

Hi Mathieu, I've been looking at J2K compression with GDCM and I have a couple of questions/issues:

If using gdcmconv -K on uncompressed RGB data should I expect it to result in J2K Lossless pixel data compressed with a Photometric Interpretation of YBR_RCT? Because with 3.0.9 it doesn't do any multi-component transformation (the parameter in SGcod is 0) and the Photometric Interpretation is still 'RGB', which is fine if that's the intention, it just seems a bit strange as a default (and leaves me wondering if I need to write my own codec to ensure MCT is applied).

I ask, because looking at the source code for gdcmImageChangeTransferSyntax.cxx it seems like TryJPEG2000Codec is performing a Photometric Interpretation change here. Only for it to be undone here (for input RGB, anyway). The comments seem to indicate it should only be changing it back to RGB when decompressing.

My testing/comparison files have been the uncompressed US1_UNCR.dcm and compressed US1_J2KR.dcm files from here and here as well as using this project to check the codestream.

Thanks!

Discussion

  • Mathieu Malaterre

    • assigned_to: Mathieu Malaterre
     
  • Mathieu Malaterre

    • status: open --> accepted
     
  • XXX

    XXX - 2021-05-18

    I've been encoding using JPEG2000Codec directly. The only other issue is #523 (Python SWIG). If you're happy with that patch I can submit another PR just for that. Otherwise I'll leave it to you.

     
  • Mathieu Malaterre

     
  • Mathieu Malaterre

    is there anything still left to do here ?

     

Log in to post a comment.