Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to access compressed dicom frames using the OFFIS dcmtk?

477 views
Skip to first unread message

Cliff Edwards

unread,
May 25, 2002, 9:53:14 PM5/25/02
to
I'm looking for a little advice on the OFFIS dcmtk for a project I'm working on.

I've successfully loaded DICOM JPEG compressed multi-frame files and accessed
the decompressed frame buffers using a DicomImage instance. What I want to do
now is to be able to access the frame buffers without them being decompressed,
i.e. I want access to the buffers in their JPEG compressed state. Does anyone
have any ideas on how I can use DCMTK to do that?

Joerg Riesmeier

unread,
May 28, 2002, 4:15:16 AM5/28/02
to
Cliff,

> I've successfully loaded DICOM JPEG compressed multi-frame files and accessed
> the decompressed frame buffers using a DicomImage instance. What I want to do
> now is to be able to access the frame buffers without them being decompressed,
> i.e. I want access to the buffers in their JPEG compressed state. Does anyone
> have any ideas on how I can use DCMTK to do that?

in order to access the original JPEG compressed pixel data you cannot use the
DicomImage class. Instead, you should use the lower level dcmdata routines as
follows (assuming that the "dataset" variable already contains the DICOM data):

DcmStack stack;
/* search for PixelData element on top-level */
if (dataset->search(DCM_PixelData, stack, ESM_fromHere, OFFalse /*searchIntoSub*/).good())
{
DcmPixelData *pixelData = (DcmPixelData *)stack.top();
if (pixelData != NULL)
{
/* get pixel data sequence (if available) */
E_TransferSyntax xfer = EXS_Unknown;
const DcmRepresentationParameter *repParam = NULL;
pixelData->getOriginalRepresentationKey(xfer, rep);
if ((xfer != EXS_Unknown) && DcmXfer(xfer).isEncapsulated())
{
DcmPixelSequence *pixelSeq = NULL;
if (pixelData->getEncapsulatedRepresentation(xfer, repParam, pixelSeq).good() && (pixelSeq != NULL))
{
/* now "pixelSeq" points to the sequence of pixel items */
/* pixelSeq->card() returns the number of pixel items and */
/* pixelSeq->getItem() allows to access a particular pixel item */
}
}
}
}

In case you should have any further questions please do not hesitate to contact us directly (di...@offis.de).

Regards,
Joerg Riesmeier
OFFIS


0 new messages