+ if (userDefinedSerie)
+ strSerieUID = serieUID;
+ else
+ strSerieUID = GDCM_NAME_SPACE::Util::CreateUniqueUID();
+
+ // Read the pixels
+
+ int singlePlaneDataSize = nX*nY*samplesPerPixel*pixelSizeOut;
+ int dataSizeIn = nX*nY*samplesPerPixel*pixelSize*nZ;
+
+ uint8_t *pixels = new uint8_t[dataSizeIn];
+ uint8_t *planePixelsOut = new uint8_t[singlePlaneDataSize];
+
+ Fp->read((char*)pixels, (size_t)dataSizeIn);
+
+ if ( pixelSize !=1 && ( (l && bigEndian) || (b && ! bigEndian) ) )
+ {
+ ConvertSwapZone(pixelSize, pixels, dataSizeIn);
+ }
+
+// Copy (and convert) pixels of a single plane
+
+ switch ( pixelTypeCode )
+ {
+ case 8 : CFR(PU8); break;
+ case -8 : CFR(PS8); break;
+ case -16 : CFR(PU16); break;
+ case 16 : CFR(PS16); break;
+ case -32 : CFR(PS32); break;
+ case 32 : CFR(PU32); break;
+ case 33 : CFR(PF32); break;
+ case 64 : CFR(PD64); break;
+ }