In Orthanc, we are, amongst tons of other use, using DCMTK to decode images and, for this, we register decoders globally through
Code: Select all
DJDecoderRegistration::registerCodecs();
With some particular data, namely YBR_FULL images encoded in JPEG Baseline (Process 1) [1.2.840.10008.1.2.4.50] (sample file: https://www.dropbox.com/sh/qlnzegreue3z ... 45cya?dl=0), when the decoder decodes the image into Explict VR Transfer syntax, the PhotometricInterpretation is transformed to RGB.
We have noticed that we could disable this automatic conversion by registerind the decoder with:
Code: Select all
DJDecoderRegistration::registerCodecs(EDC_never);
So far, I have not been able to figure out a way to work with both modes in the same application. Is that even possible ?
I was hoping to work it out by defining a custom
DcmRepresentationParameter
class and by registering a second decoder with this particular parameter:
Code: Select all
DJDecoderBaseline* decbas = new DJDecoderBaseline();
if (decbas)
{
DcmCodecList::registerCodec(decbas, new DcmJpegNoConversionRepresentationParameter(), cp);
}
dicom.chooseRepresentation(xfer, representation)
expecting the DecoderList to select my decoder based on this representation.However, this param is not used when finally selecting the decoder in
Code: Select all
OFCondition
DcmPixelData::chooseRepresentation(
const E_TransferSyntax repType,
const DcmRepresentationParameter * repParam,
DcmStack & pixelStack)
Thanks in advance for any help you can provide.
Alain.
Reference of the discussion on Orthanc Users Group: https://discourse.orthanc-server.org/t/ ... adata/3533