#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 tSize, 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 tSize, 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 61 of file gdcmRLEFramesInfo.h. |
|
Definition at line 31 of file gdcmRLEFramesInfo.cxx. References Frames. 00032 { 00033 for(RLEFrameList::iterator it = Frames.begin(); it != Frames.end(); ++it) 00034 { 00035 delete (*it); 00036 } 00037 Frames.clear(); 00038 }
|
|
Definition at line 42 of file gdcmRLEFramesInfo.cxx. References Frames. 00043 { 00044 Frames.push_back(frame); 00045 }
|
|
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 111 of file gdcmRLEFramesInfo.cxx. References GDCM_NAME_SPACE::Util::IsCurrentProcessorBigEndian(). 00114 { 00115 size_t pixelNumber = xSize * ySize * tSize; 00116 size_t rawSize = pixelNumber * numberOfFrames * 2; 00117 00118 // We assumed Raw contains the decoded RLE pixels but as 00119 // 8 bits per pixel. In order to convert those pixels to 16 bits 00120 // per pixel we cannot work in place within Raw and hence 00121 // we copy it in a safe place, say copyRaw. 00122 00123 uint8_t *copyRaw = new uint8_t[rawSize]; 00124 memmove( copyRaw, raw, rawSize ); 00125 00126 uint8_t *x = raw; 00127 uint8_t *a; 00128 uint8_t *b; 00129 00130 // Warning : unckecked patch to see the behaviour on Big Endian Processors 00131 00132 if ( !Util::IsCurrentProcessorBigEndian() ) 00133 { 00134 a = copyRaw; // beginning of 'low bytes' 00135 b = a + pixelNumber; // beginning of 'hight bytes' 00136 } 00137 else 00138 { 00139 b = copyRaw; // beginning of 'low bytes' 00140 a = b + pixelNumber; // beginning of 'hight bytes' 00141 } 00142 00143 // Re order bytes 00144 for ( int i = 0; i < numberOfFrames; i++ ) 00145 { 00146 for ( unsigned int j = 0; j < pixelNumber; j++ ) 00147 { 00148 *(x++) = *(b++); 00149 *(x++) = *(a++); 00150 } 00151 } 00152 00153 delete[] copyRaw; 00154 00155 return true; 00156 }
|
|
Reads from disk the Pixel Data of 'Run Length Encoded' Dicom encapsulated file and decompress it.
Definition at line 78 of file gdcmRLEFramesInfo.cxx. References Frames. 00081 { 00082 uint8_t *subRaw = raw; 00083 long rawSegmentSize = xSize * ySize * tSize; 00084 00085 // Loop on the frame[s] 00086 for(RLEFrameList::iterator it = Frames.begin(); it != Frames.end(); ++it) 00087 { 00088 subRaw = (*it)->ReadAndDecompressRLEFrame( subRaw, rawSegmentSize, fp); 00089 } 00090 00091 if ( bitsAllocated == 16 ) 00092 { 00093 // Try to deal with RLE 16 Bits 00094 ConvertRLE16BitsFromRLE8Bits( raw, xSize, ySize, zSize, tSize ); 00095 } 00096 00097 return true; 00098 }
|
|
Definition at line 47 of file gdcmRLEFramesInfo.cxx. References Frames, and ItFrames. 00048 { 00049 ItFrames = Frames.begin(); 00050 if (ItFrames != Frames.end()) 00051 return *ItFrames; 00052 return NULL; 00053 }
|
|
Definition at line 55 of file gdcmRLEFramesInfo.cxx. References Frames, gdcmAssertMacro, and ItFrames. 00056 { 00057 gdcmAssertMacro (ItFrames != Frames.end()); 00058 00059 ++ItFrames; 00060 if (ItFrames != Frames.end()) 00061 return *ItFrames; 00062 return NULL; 00063 }
|
|
Print self.
Definition at line 171 of file gdcmRLEFramesInfo.cxx. References Frames. 00172 { 00173 os << std::endl; 00174 os << indent 00175 << "----------------- RLE frames --------------------------------" 00176 << std::endl; 00177 os << indent 00178 << "Total number of Frames : " << Frames.size() 00179 << std::endl; 00180 int frameNumber = 0; 00183 for(RLEFrameList::iterator it = Frames.begin(); it != Frames.end(); ++it) 00184 { 00185 os << indent 00186 << " frame number :" << frameNumber++ 00187 << std::endl; 00188 (*it)->Print( os, indent + " " ); 00189 } 00190 }
|
|
Definition at line 46 of file gdcmRLEFramesInfo.h. |
|
Definition at line 45 of file gdcmRLEFramesInfo.h. |
|
Definition at line 63 of file gdcmRLEFramesInfo.h. Referenced by AddFrame(), DecompressRLEFile(), GetFirstFrame(), GetNextFrame(), Print(), and ~RLEFramesInfo(). |
|
Definition at line 64 of file gdcmRLEFramesInfo.h. Referenced by GetFirstFrame(), and GetNextFrame(). |