[Dcmlib] FileHelper::GetImageData

Jean-Pierre ROUX jean-pierre.roux at creatis.insa-lyon.fr
Sat Apr 22 00:22:05 CEST 2006


At 10:46 -0500 21/04/06, Andres Barrera wrote:
>Hello everyone,
>
>  I'm just starting with gdcm and trying to run some tests. I would 
>like to know why "FileHelper::GetImageData()" returns a uint8_t* and 
>not a uint16_t*. Is there any way of retrieving uint16_t* without 
>getting into the source code and changing a few functions/methods?

You don't have to modify anything in gdcm code :

A image may contain uint8_t, or int8_t, or uint16_t, or int16_t, or 
uint32_t, or int32_t pixels.
A method can only return *one* data type.
If you know your images are uint16_t, just write :

  uint16_t *myImageData = (uint16_t *)myFileHelper->GetImageData();

(The pixels are *not* modified; you just tell the compiler you know 
they are 16 bits)

Jean-Pierre

>  I would like to get the raw data of the image (for 12+ bits 
>resolution) and put it in my own structure of unsigned short.
>
> Thank you
>
>               Andres
>
>
>_______________________________________________
>Dcmlib mailing list
>Dcmlib at creatis.insa-lyon.fr
>http://www.creatis.insa-lyon.fr/mailman/listinfo/dcmlib

   Jean-Pierre ROUX
   CREATIS - CNRS UMR 5515, INSERM U 630
   Laboratoire de Radiologie Experimentale
   Hopital Cardiologique
   28 Avenue du Doyen LEPINE
   B.P. Lyon-Montchat
   69394 Lyon Cedex 03
 
   Tel      : (+33) 04 72 35 74 12
   Fax      : (+33) 04 72 68 49 16
   URL      : http://www.creatis.univ-lyon1.fr
   e-mail   : jpr at creatis.univ-lyon1.fr
								   



More information about the Dcmlib mailing list