00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef GDCMFILE_H
00020 #define GDCMFILE_H
00021
00022 #include "gdcmDocument.h"
00023
00024 namespace gdcm
00025 {
00026 class RLEFramesInfo;
00027 class JPEGFragmentsInfo;
00028
00029
00030
00031 enum ModalityType {
00032 Unknow,
00033 AU,
00034 AS,
00035 BI,
00036 CF,
00037 CP,
00038 CR,
00039 CS,
00040 CT,
00041 DD,
00042 DF,
00043 DG,
00044 DM,
00045 DS,
00046 DX,
00047 ECG,
00048 EPS,
00049 ES,
00050 FA,
00051 FS,
00052 HC,
00053 HD,
00054 LP,
00055 LS,
00056 MA,
00057 MR,
00058 NM,
00059 OT,
00060 PT,
00061 RF,
00062 RG,
00063 RTDOSE,
00064 RTIMAGE,
00065 RTPLAN,
00066 RTSTRUCT,
00067 SM,
00068 ST,
00069 TG,
00070 US,
00071 VF,
00072 XA,
00073 XC
00074 };
00075
00076
00077
00095 class GDCM_EXPORT File : public Document
00096 {
00097 public:
00098 File();
00099 File( std::string const &filename );
00100 ~File();
00101
00102
00103 bool IsReadable();
00104
00105
00106 int GetImageNumber();
00107 ModalityType GetModality();
00108
00109 int GetXSize();
00110 int GetYSize();
00111 int GetZSize();
00112
00113 float GetXSpacing();
00114 float GetYSpacing();
00115 float GetZSpacing();
00116
00117 float GetXOrigin();
00118 float GetYOrigin();
00119 float GetZOrigin();
00120
00121 void GetImageOrientationPatient( float iop[6] );
00122
00123 int GetBitsStored();
00124 int GetBitsAllocated();
00125 int GetHighBitPosition();
00126 int GetSamplesPerPixel();
00127 int GetPlanarConfiguration();
00128 int GetPixelSize();
00129 std::string GetPixelType();
00130 bool IsSignedPixelData();
00131 bool IsMonochrome();
00132 bool IsPaletteColor();
00133 bool IsYBRFull();
00134
00135 bool HasLUT();
00136 int GetLUTNbits();
00137
00138
00139 float GetRescaleIntercept();
00140 float GetRescaleSlope();
00141
00142 int GetNumberOfScalarComponents();
00143 int GetNumberOfScalarComponentsRaw();
00144
00146 uint16_t GetGrPixel() { return GrPixel; }
00148 uint16_t GetNumPixel() { return NumPixel; }
00149
00150 size_t GetPixelOffset();
00151 size_t GetPixelAreaLength();
00152
00154 RLEFramesInfo *GetRLEInfo() { return RLEInfo; }
00156 JPEGFragmentsInfo *GetJPEGInfo() { return JPEGInfo; }
00157
00158
00159 void AddAnonymizeElement (uint16_t group, uint16_t elem,
00160 std::string const &value);
00162 void ClearAnonymizeList() { AnonymizeList.clear(); }
00163 void AnonymizeNoLoad();
00165 bool AnonymizeFile();
00166
00167 bool Write(std::string fileName, FileType filetype);
00168
00169 protected:
00171 void InitializeDefaultFile();
00172
00174 RLEFramesInfo *RLEInfo;
00176 JPEGFragmentsInfo *JPEGInfo;
00177
00182 uint16_t NumPixel;
00187 uint16_t GrPixel;
00188
00189 private:
00190 void ComputeRLEInfo();
00191 void ComputeJPEGFragmentInfo();
00192 bool ReadTag(uint16_t, uint16_t);
00193 uint32_t ReadTagLength(uint16_t, uint16_t);
00194 void ReadAndSkipEncapsulatedBasicOffsetTable();
00195
00196 };
00197 }
00198
00199
00200 #endif