+
+ // ---
+ string str_PlanarConfiguration = GetPubElValByNumber(0x0028,0x0006);
+ int PlanarConfiguration;
+ if (str_PlanarConfiguration == "gdcm::Unfound" ) {
+ PlanarConfiguration = 0;
+ } else {
+ PlanarConfiguration = atoi(str_PlanarConfiguration.c_str() );
+ }
+ // ---
+
+ // TODO : replace by
+ // if (GetPlanarConfiguration() == 1) {
+ // after unfreeze
+
+ if (PlanarConfiguration == 1) { // need to make RGB Pixels
+ int l = lgrTotale/3 ;
+
+ char * a = (char *)destination;
+ char * b = a + l;
+ char * c = b + l;
+ char * newDest = (char*) malloc(lgrTotale);
+ // TODO :
+ // any trick not to have to allocate temporary buffer is welcome ...
+ char *x = newDest;
+ for (int j=0;j<l; j++) {
+ *(x++) = *(a++);
+ *(x++) = *(b++);
+ *(x++) = *(c++);
+ }
+ a = (char *)destination;
+ x = newDest;
+ for (int i=0;i<lgrTotale; i++) {
+ *(a++) = *(x++);
+ }
+ free(newDest);
+ }