X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmFile.cxx;h=4b22d148d7ec4823f52bdf2e5f1ae1fbc130241a;hb=ea14e11cdd726f9c7e6d6384c7e9e508bc6efc2d;hp=96eb54783ef78da3b5f25da8d379862d910c504c;hpb=0add622a61a208e9ed5f55b1b48e373b6bf38f39;p=gdcm.git diff --git a/src/gdcmFile.cxx b/src/gdcmFile.cxx index 96eb5478..4b22d148 100644 --- a/src/gdcmFile.cxx +++ b/src/gdcmFile.cxx @@ -96,6 +96,21 @@ void gdcmFile::SetPixelDataSizeFromHeader(void) { // 0028|1203 [US] [Blue Palette Color Lookup Table Data] +///////////////////////////////////////////////////////////////// +/** + * \ingroup gdcmFile + * \brief Returns the size (in bytes) of required memory to hold + * \ the pixel data represented in this file, when user DOESN'T want + * \ to get RGB pixels image when it's stored as a PALETTE COLOR image + * \ - the (vtk) user is supposed to know how deal with LUTs - + * \ warning to be used with GetImagePixelsRaw() + * @return The size of pixel data in bytes. + */ + +size_t gdcmFile::GetImageDataSizeRaw(void) { + return (lgrTotaleRaw); +} + ///////////////////////////////////////////////////////////////// /** * \ingroup gdcmFile @@ -356,12 +371,10 @@ size_t gdcmFile::GetImageDataIntoVector (void* destination, size_t MaxSize) { // from Lut R + Lut G + Lut B unsigned char * newDest = (unsigned char *)malloc(lgrTotale); - unsigned char * a = (unsigned char *)destination; - + unsigned char * a = (unsigned char *)destination; unsigned char * lutRGBA = (unsigned char *)GetLUTRGBA(); - if (lutRGBA) { - int l = lgrTotale/3; + int l = lgrTotaleRaw; memmove(newDest, destination, l);// move Gray pixels to temp area int j; for (int i=0;i