#include <gdcmRLEFramesInfo.h>
Public 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 Types | |
typedef std::list< RLEFrame * > | RLEFrameList |
Private Attributes | |
RLEFrameList | Frames |
RLEFrameList::iterator | ItFrames |
This class is simply a stl list<> of RLEFrame.
Definition at line 43 of file gdcmRLEFramesInfo.h.
|
Definition at line 59 of file gdcmRLEFramesInfo.h. |
|
Definition at line 26 of file gdcmRLEFramesInfo.cxx. References Frames.
|
|
Definition at line 37 of file gdcmRLEFramesInfo.cxx. References Frames. Referenced by gdcm::File::ComputeRLEInfo().
00038 { 00039 Frames.push_back(frame); 00040 } |
|
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 104 of file gdcmRLEFramesInfo.cxx. Referenced by DecompressRLEFile().
00106 { 00107 size_t pixelNumber = xSize * ySize; 00108 size_t rawSize = xSize * ySize * numberOfFrames; 00109 00110 // We assumed Raw contains the decoded RLE pixels but as 00111 // 8 bits per pixel. In order to convert those pixels to 16 bits 00112 // per pixel we cannot work in place within Raw and hence 00113 // we copy it in a safe place, say copyRaw. 00114 00115 uint8_t *copyRaw = new uint8_t[rawSize * 2]; 00116 memmove( copyRaw, raw, rawSize * 2 ); 00117 00118 uint8_t *x = raw; 00119 uint8_t *a = copyRaw; 00120 uint8_t *b = a + pixelNumber; 00121 00122 for ( int i = 0; i < numberOfFrames; i++ ) 00123 { 00124 for ( unsigned int j = 0; j < pixelNumber; j++ ) 00125 { 00126 *(x++) = *(b++); 00127 *(x++) = *(a++); 00128 } 00129 } 00130 delete[] copyRaw; 00131 00133 00134 return true; 00135 } |
|
Reads from disk the Pixel Data of 'Run Length Encoded' Dicom encapsulated file and decompress it.
Definition at line 72 of file gdcmRLEFramesInfo.cxx. References ConvertRLE16BitsFromRLE8Bits(), and Frames. Referenced by gdcm::PixelReadConvert::ReadAndDecompressPixelData().
00075 { 00076 uint8_t *subRaw = raw; 00077 long rawSegmentSize = xSize * ySize; 00078 00079 // Loop on the frame[s] 00080 for(RLEFrameList::iterator it = Frames.begin(); it != Frames.end(); ++it) 00081 { 00082 subRaw = (*it)->ReadAndDecompressRLEFrame( subRaw, rawSegmentSize, fp); 00083 } 00084 00085 if ( bitsAllocated == 16 ) 00086 { 00087 // Try to deal with RLE 16 Bits 00088 ConvertRLE16BitsFromRLE8Bits( raw, xSize, ySize, zSize ); 00089 } 00090 00091 return true; 00092 } |
|
Definition at line 42 of file gdcmRLEFramesInfo.cxx. References Frames, and ItFrames.
|
|
Definition at line 50 of file gdcmRLEFramesInfo.cxx. References Frames, gdcmAssertMacro, and ItFrames.
|
|
Print self.
Definition at line 150 of file gdcmRLEFramesInfo.cxx. References Frames. Referenced by gdcm::PixelReadConvert::Print().
00151 { 00152 os << std::endl; 00153 os << indent 00154 << "----------------- RLE frames --------------------------------" 00155 << std::endl; 00156 os << indent 00157 << "Total number of Frames : " << Frames.size() 00158 << std::endl; 00159 int frameNumber = 0; 00160 for(RLEFrameList::iterator it = Frames.begin(); it != Frames.end(); ++it) 00161 { 00162 os << indent 00163 << " frame number :" << frameNumber++ 00164 << std::endl; 00165 (*it)->Print( os, indent + " " ); 00166 } 00167 } |
|
Definition at line 61 of file gdcmRLEFramesInfo.h. Referenced by AddFrame(), DecompressRLEFile(), GetFirstFrame(), GetNextFrame(), Print(), and ~RLEFramesInfo(). |
|
Definition at line 62 of file gdcmRLEFramesInfo.h. Referenced by GetFirstFrame(), and GetNextFrame(). |