X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmRLEFramesInfo.cxx;h=189596db1740804240f9f442c0305f4640a07416;hb=0bcc188c6d5185375f809253e8b9b97c856d2eac;hp=6c6d3c3e2357b1e1385259bf202a05bebe5cea23;hpb=6d79b5e185867ef00629f1ccb279c32daa6357d2;p=gdcm.git diff --git a/src/gdcmRLEFramesInfo.cxx b/src/gdcmRLEFramesInfo.cxx index 6c6d3c3e..189596db 100644 --- a/src/gdcmRLEFramesInfo.cxx +++ b/src/gdcmRLEFramesInfo.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmRLEFramesInfo.cxx,v $ Language: C++ - Date: $Date: 2005/11/28 16:50:33 $ - Version: $Revision: 1.19 $ + Date: $Date: 2007/05/23 14:18:11 $ + Version: $Revision: 1.22 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -20,7 +20,11 @@ #include "gdcmDebug.h" #include "gdcmUtil.h" -namespace gdcm +#if defined(__BORLANDC__) + #include // for memset +#endif + +namespace GDCM_NAME_SPACE { //------------------------------------------------------------------------- // Constructor / Destructor @@ -67,15 +71,16 @@ RLEFrame *RLEFramesInfo::GetNextFrame() * @param xSize x Size * @param ySize y Size * @param zSize z Size + * @param tSize t Size * @param bitsAllocated Bits allocated * @return Boolean */ bool RLEFramesInfo::DecompressRLEFile( std::ifstream *fp , uint8_t *raw, int xSize, int ySize, int zSize, - int bitsAllocated ) + int tSize, int bitsAllocated ) { uint8_t *subRaw = raw; - long rawSegmentSize = xSize * ySize; + long rawSegmentSize = xSize * ySize * tSize; // Loop on the frame[s] for(RLEFrameList::iterator it = Frames.begin(); it != Frames.end(); ++it) @@ -86,7 +91,7 @@ bool RLEFramesInfo::DecompressRLEFile( std::ifstream *fp , uint8_t *raw, if ( bitsAllocated == 16 ) { // Try to deal with RLE 16 Bits - ConvertRLE16BitsFromRLE8Bits( raw, xSize, ySize, zSize ); + ConvertRLE16BitsFromRLE8Bits( raw, xSize, ySize, zSize, tSize ); } return true; @@ -99,13 +104,15 @@ bool RLEFramesInfo::DecompressRLEFile( std::ifstream *fp , uint8_t *raw, * @param raw raw * @param xSize x Size * @param ySize y Size + * @param tSize t Size * @param numberOfFrames number of frames * @return Boolean always true */ bool RLEFramesInfo::ConvertRLE16BitsFromRLE8Bits(uint8_t *raw, int xSize, - int ySize, int numberOfFrames) + int ySize, int tSize, + int numberOfFrames) { - size_t pixelNumber = xSize * ySize; + size_t pixelNumber = xSize * ySize * tSize; size_t rawSize = pixelNumber * numberOfFrames * 2; // We assumed Raw contains the decoded RLE pixels but as @@ -171,6 +178,8 @@ void RLEFramesInfo::Print( std::ostream &os, std::string indent ) << "Total number of Frames : " << Frames.size() << std::endl; int frameNumber = 0; + /// \todo : find an example, to know haow 3rd and 4th dimension + /// works together for(RLEFrameList::iterator it = Frames.begin(); it != Frames.end(); ++it) { os << indent