MedicalVisualization

DCMTK Xfer

DCMTK Keys | | Qt

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);
}


DCMTK Keys | | Qt

Options: