+ }
+
+ int nb;
+ string str_nb=gdcmHeader::GetPubElValByNumber(0x0028,0x0100);
+ if (str_nb == "gdcm::Unfound" ) {
+ nb = 16;
+ } else {
+ nb = atoi(str_nb.c_str() );
+ if (nb == 12) nb =16;
+ }
+ int nBytes= nb/8;
+ int * dataJpg = jpg->DataImg;
+ int taille = GetXSize() * GetYSize() * GetZSize() * GetSamplesPerPixel();
+
+ switch (nBytes) {
+ case 1:
+ {
+ unsigned short *dest = (unsigned short *)destination;
+ for (int i=0; i<taille; i++) {
+ *((unsigned char *)dest+i) = *(dataJpg +i);
+ }
+ }
+ break;
+
+ case 2:
+ {
+ unsigned short *dest = (unsigned short *)destination;
+ for (int i=0; i<taille; i++) {
+ *((unsigned short *)dest+i) = *(dataJpg +i);
+ }
+ }
+ break;
+
+ case 4:
+ {
+ unsigned int *dest=(unsigned int *)destination;
+ for (int i=0;i<taille; i++) {
+ *((unsigned int *)dest+i) = *(dataJpg +i);
+ }
+ }
+ break;
+ }
+