I'm interested in embedding (encapsulating) a precompressed JPEG (that has been compressed outside dcmtk) as it is without any modification inside a freshly creatly DICOM image. What kind of transfer syntax would I need to use? Also, how would the code be?
If this is not possible, how do I embed a raw RGB into DCM_PixelData and convert that to JPEG? I have managed to create a valid DICOM image with uncompressed RGB in DCM_PixelData. I'd like to replace this raw data with precompressed data (compressed outside dcmtk). When I try to change the transfer syntax using the following:
Code: Select all
DJEncoderRegistration::registerCodecs();
OFCondition cond;
.
.
// embed all the necessary info like DCM_PixelRepresentation,
// DCM_PixelData, etc (basically everything so that sending it
// uncompressed works correctly).
.
.
DJ_RPLossy params(90);
cond = dataset->chooseRepresentation(EXS_JPEGProcess1TransferSyntax, ¶ms);
I'd prefer a solution for embedding a precompressed JPEG into the DICOM image.
Thanks a lot for any help in advance.
Cheers!!