From Ohm

DCMTK Xfer

To access the (potentially compressed) image data we define a transfer encoding syntax (xfer). In the following example we assume little endian (Intel style) representation:

unsigned short *getData(DcmDataSet *image, unsigned long &length)
{
   const Uint16 *data=NULL;
   length=0;

   image->loadAllDataIntoMemory();

   image->chooseRepresentation(EXS_LittleEndianExplicit, NULL);
   if (!dataset->canWriteXfer(EXS_LittleEndianExplicit)) return(NULL);

   if (dataset->findAndGetUint16Array(DCM_PixelData,data,&length).bad()) return(NULL);
   if (data==NULL || length==0) return(NULL);

   return(data);
}

Retrieved from http://schorsch.efi.fh-nuernberg.de/roettger/index.php/MedicalVisualization/DCMTKXfer

Page last modified on October 20, 2013, at 02:47 PM