writing files using JPEG 2000

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
retarder
Posts: 26
Joined: Fri, 2010-11-19, 16:23
Location: Germany
Contact:

writing files using JPEG 2000

#1 Post by retarder »

Hi,

we try to write DICOM datasets as DICOMDIR with JPEG2000 transfer syntax.

But the canWriteXfer method returns already false.

Code: Select all

 
DcmItem *metaInfo = fileformat.getMetaInfo();
D2DecoderRegistration::registerCodecs(); // register JPEG2000 codecs
DJ_RPLossless params; 
status = pDataset->chooseRepresentation(EXS_JPEG2000LosslessOnly, &params); 
               
if (pDataset->canWriteXfer(EXS_JPEG2000LosslessOnly))
 {
        delete metaInfo->remove(DCM_MediaStorageSOPClassUID);                    
        delete metaInfo->remove(DCM_MediaStorageSOPInstanceUID);
}
status = fileformat.saveFile(stringFilenamePointer, EXS_JPEG2000LosslessOnly);
Waht did we wrong?

J. Riesmeier
DCMTK Developer
Posts: 2501
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: writing files using JPEG 2000

#2 Post by J. Riesmeier »

First of all, it makes no sense to write a DICOMDIR with any other transfer syntax than Explicit VR Little Endian (because this is what all existing Media Storage Application Profiles require). And then, it seems that you've only registered the JPEG2000 decoders.

retarder
Posts: 26
Joined: Fri, 2010-11-19, 16:23
Location: Germany
Contact:

Re: writing files using JPEG 2000

#3 Post by retarder »

That was a misunderstanding. I don't wanted to write a DICOMDIR with JPEG2000 but only the single frame files which are referenced by the DIOCMDIR.

But you are right, I registered the decoders instead of the encoders accidentally, now it works like a charm!

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Baidu [Spider], Bing [Bot], Google [Bot] and 1 guest