create-dicom & DICOM Encoding

Hi Orthanc Team,

When using tools/create-dicom endpoint, and uploading a JPEG, I suspect Orthanc is decoding the JPEG and saving an uncompressed raw 8 bit image as the DICOM image.

Other than transcoding this newly created dicom file into JPEG encoded DICOM, is it possible if a JPEG is uploaded, to store the raw jpeg in the DICOM as a JPEG transfer syntax.

ie:
JPEG → Raw Image → DICOM(Raw Image)
JPEG → DICOM (JPEG Image).

My thought here is this would reduce the file size and keep the source image un changed.

I guess this isn’t possible for PNGs as I don’t believe there is an appropriate transfer syntax.

Cheers,

James

Hi James,

There’s already an item in our TODO to add “TransferSyntax” to the /create-dicom route but I’ve not gone through the analysis yet so let’s go.

I would assume various situations:

    1. if IngestTranscoding is configured in Orthanc: Whatever the TransferSyntax in /create-dicom, at the end, the image is converted to the IngestTranscoding Transfer Syntax anyway.
  • else:
    1. if no TransferSyntax is specified in /create-dicom → create a “raw image”
    1. else if a TransferSyntax is specified in /create-dicom, since the pixels might be provided as raw, png or jpeg, for genericity, we would likely uncompress the pixels to raw before targeting the requested TransferSyntax.

I have the feeling that you’re requesting a 4th case in which you’d like to “Force” the Transfer Syntax because you know that you are already providing the pixels in the right format. Is my understanding correct ?

Please feel free to comment on the first 3 cases as well :slight_smile:

Best regards,

Alain.

Hi Alain,

Yes you are right. My thoughts were along option 4.

There are undoubtedly some nuances that I’m missing in regards to JPEG formats, 8bit/16bit Monochhrome/RGB etc…

I wonder how img2dcm works?

Cheers,

James

I just looked up the img2dcm docs
https://support.dcmtk.org/docs/img2dcm.html

James