#include <gdcmRLEFramesInfo.h>
Private Types | |
typedef std::list< RLEFrame * > | RLEFrameList |
Private Member Functions | |
~RLEFramesInfo () | |
void | Print (std::ostream &os=std::cout, std::string indent="") |
Print self. | |
bool | DecompressRLEFile (std::ifstream *fp, uint8_t *subRaw, int xSize, int ySize, int zSize, int bitsAllocated) |
Reads from disk the Pixel Data of 'Run Length Encoded' Dicom encapsulated file and decompress it. | |
bool | ConvertRLE16BitsFromRLE8Bits (uint8_t *subRaw, int xSize, int ySize, int numberOfFrames) |
We assume Raw contains the decoded RLE pixels but as 8 bits per pixel. We convert those pixels to 16 bits per pixel. | |
void | AddFrame (RLEFrame *frame) |
RLEFrame * | GetFirstFrame () |
RLEFrame * | GetNextFrame () |
Private Attributes | |
RLEFrameList | Frames |
RLEFrameList::iterator | ItFrames |
Friends | |
class | PixelReadConvert |
class | File |
This class is simply a stl list<> of RLEFrame.
Definition at line 43 of file gdcmRLEFramesInfo.h.
|
Definition at line 62 of file gdcmRLEFramesInfo.h. |
|
Definition at line 27 of file gdcmRLEFramesInfo.cxx. References Frames. 00028 { 00029 for(RLEFrameList::iterator it = Frames.begin(); it != Frames.end(); ++it) 00030 { 00031 delete (*it); 00032 } 00033 Frames.clear(); 00034 }
|
|
Definition at line 38 of file gdcmRLEFramesInfo.cxx. References Frames. Referenced by gdcm::File::ComputeRLEInfo(). 00039 { 00040 Frames.push_back(frame); 00041 }
|
|
We assume Raw contains the decoded RLE pixels but as 8 bits per pixel. We convert those pixels to 16 bits per pixel.
Definition at line 105 of file gdcmRLEFramesInfo.cxx. References gdcm::Util::IsCurrentProcessorBigEndian(). Referenced by DecompressRLEFile(). 00107 { 00108 size_t pixelNumber = xSize * ySize; 00109 size_t rawSize = pixelNumber * numberOfFrames * 2; 00110 00111 // We assumed Raw contains the decoded RLE pixels but as 00112 // 8 bits per pixel. In order to convert those pixels to 16 bits 00113 // per pixel we cannot work in place within Raw and hence 00114 // we copy it in a safe place, say copyRaw. 00115 00116 uint8_t *copyRaw = new uint8_t[rawSize]; 00117 memmove( copyRaw, raw, rawSize ); 00118 00119 uint8_t *x = raw; 00120 uint8_t *a; 00121 uint8_t *b; 00122 00123 // Warning : unckecked patch to see the behaviour on Big Endian Processors 00124 00125 if ( !Util::IsCurrentProcessorBigEndian() ) 00126 { 00127 a = copyRaw; // beginning of 'low bytes' 00128 b = a + pixelNumber; // beginning of 'hight bytes' 00129 } 00130 else 00131 { 00132 b = copyRaw; // beginning of 'low bytes' 00133 a = b + pixelNumber; // beginning of 'hight bytes' 00134 } 00135 00136 // Re order bytes 00137 for ( int i = 0; i < numberOfFrames; i++ ) 00138 { 00139 for ( unsigned int j = 0; j < pixelNumber; j++ ) 00140 { 00141 *(x++) = *(b++); 00142 *(x++) = *(a++); 00143 } 00144 } 00145 00146 delete[] copyRaw; 00147 00148 return true; 00149 }
|
|
Reads from disk the Pixel Data of 'Run Length Encoded' Dicom encapsulated file and decompress it.
Definition at line 73 of file gdcmRLEFramesInfo.cxx. References ConvertRLE16BitsFromRLE8Bits(), and Frames. Referenced by gdcm::PixelReadConvert::ReadAndDecompressPixelData(). 00076 { 00077 uint8_t *subRaw = raw; 00078 long rawSegmentSize = xSize * ySize; 00079 00080 // Loop on the frame[s] 00081 for(RLEFrameList::iterator it = Frames.begin(); it != Frames.end(); ++it) 00082 { 00083 subRaw = (*it)->ReadAndDecompressRLEFrame( subRaw, rawSegmentSize, fp); 00084 } 00085 00086 if ( bitsAllocated == 16 ) 00087 { 00088 // Try to deal with RLE 16 Bits 00089 ConvertRLE16BitsFromRLE8Bits( raw, xSize, ySize, zSize ); 00090 } 00091 00092 return true; 00093 }
|
|
Definition at line 43 of file gdcmRLEFramesInfo.cxx. References Frames, and ItFrames. 00044 { 00045 ItFrames = Frames.begin(); 00046 if (ItFrames != Frames.end()) 00047 return *ItFrames; 00048 return NULL; 00049 }
|
|
Definition at line 51 of file gdcmRLEFramesInfo.cxx. References Frames, gdcmAssertMacro, and ItFrames. 00052 { 00053 gdcmAssertMacro (ItFrames != Frames.end()); 00054 00055 ++ItFrames; 00056 if (ItFrames != Frames.end()) 00057 return *ItFrames; 00058 return NULL; 00059 }
|
|
Print self.
Definition at line 164 of file gdcmRLEFramesInfo.cxx. References Frames. 00165 { 00166 os << std::endl; 00167 os << indent 00168 << "----------------- RLE frames --------------------------------" 00169 << std::endl; 00170 os << indent 00171 << "Total number of Frames : " << Frames.size() 00172 << std::endl; 00173 int frameNumber = 0; 00174 for(RLEFrameList::iterator it = Frames.begin(); it != Frames.end(); ++it) 00175 { 00176 os << indent 00177 << " frame number :" << frameNumber++ 00178 << std::endl; 00179 (*it)->Print( os, indent + " " ); 00180 } 00181 }
|
|
Definition at line 46 of file gdcmRLEFramesInfo.h. |
|
Definition at line 45 of file gdcmRLEFramesInfo.h. |
|
Definition at line 64 of file gdcmRLEFramesInfo.h. Referenced by AddFrame(), DecompressRLEFile(), GetFirstFrame(), GetNextFrame(), Print(), and ~RLEFramesInfo(). |
|
Definition at line 65 of file gdcmRLEFramesInfo.h. Referenced by GetFirstFrame(), and GetNextFrame(). |