00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __itkGDCMImageIO_h
00021 #define __itkGDCMImageIO_h
00022
00023 #include "itkImageIOBase.h"
00024 #include <fstream>
00025 #include <string>
00026
00027 namespace itk
00028 {
00029
00051 class ITK_EXPORT GDCMImageIO : public ImageIOBase
00052 {
00053 public:
00055 typedef GDCMImageIO Self;
00056 typedef ImageIOBase Superclass;
00057 typedef SmartPointer<Self> Pointer;
00058
00060 itkNewMacro(Self);
00061
00063 itkTypeMacro(GDCMImageIO, Superclass);
00064
00065
00066
00069 virtual bool CanReadFile(const char*);
00070
00072 virtual void ReadImageInformation();
00073
00075 virtual void Read(void* buffer);
00076
00077
00078
00081 virtual bool CanWriteFile(const char*);
00082
00085 virtual void WriteImageInformation();
00086
00089 virtual void Write(const void* buffer);
00090
00094 itkGetMacro(RescaleSlope, double);
00095 itkGetMacro(RescaleIntercept, double);
00096
00101 itkGetStringMacro(UIDPrefix);
00102 itkSetStringMacro(UIDPrefix);
00103
00105 itkGetStringMacro(StudyInstanceUID);
00106 itkGetStringMacro(SeriesInstanceUID);
00107 itkGetStringMacro(FrameOfReferenceInstanceUID);
00108
00111 itkSetMacro(KeepOriginalUID,bool);
00112 itkGetMacro(KeepOriginalUID,bool);
00113 itkBooleanMacro(KeepOriginalUID);
00114
00118 void GetPatientName(char* name);
00119 void GetPatientID(char* id);
00120 void GetPatientSex(char* sex);
00121 void GetPatientAge(char* age);
00122 void GetStudyID(char* id);
00123 void GetPatientDOB(char* dob);
00124 void GetStudyDescription(char* desc);
00125 void GetBodyPart(char* part);
00126 void GetNumberOfSeriesInStudy(char* series);
00127 void GetNumberOfStudyRelatedSeries(char* series);
00128 void GetStudyDate(char* date);
00129 void GetModality(char* modality);
00130 void GetManufacturer(char* manu);
00131 void GetInstitution(char* ins);
00132 void GetModel(char* model);
00133 void GetScanOptions(char *options);
00134
00141 static bool GetLabelFromTag( const std::string & tag,
00142 std::string & labelId );
00143
00144 protected:
00145 GDCMImageIO();
00146 ~GDCMImageIO();
00147 void PrintSelf(std::ostream& os, Indent indent) const;
00148
00149 bool OpenGDCMFileForReading(std::ifstream& os, const char* filename);
00150 bool OpenGDCMFileForWriting(std::ofstream& os, const char* filename);
00151 void InternalReadImageInformation(std::ifstream& file);
00152
00153 double m_RescaleSlope;
00154 double m_RescaleIntercept;
00155
00156 std::string m_UIDPrefix;
00157 std::string m_StudyInstanceUID;
00158 std::string m_SeriesInstanceUID;
00159 std::string m_FrameOfReferenceInstanceUID;
00160 bool m_KeepOriginalUID;
00161
00162 private:
00163 GDCMImageIO(const Self&);
00164 void operator=(const Self&);
00165
00166 std::string m_PatientName;
00167 std::string m_PatientID;
00168 std::string m_PatientDOB;
00169 std::string m_StudyID;
00170 std::string m_StudyDescription;
00171 std::string m_BodyPart;
00172 std::string m_NumberOfSeriesInStudy;
00173 std::string m_NumberOfStudyRelatedSeries;
00174 std::string m_PatientSex;
00175 std::string m_PatientAge;
00176 std::string m_StudyDate;
00177 std::string m_Modality;
00178 std::string m_Manufacturer;
00179 std::string m_Institution;
00180 std::string m_Model;
00181 std::string m_ScanOptions;
00182 };
00183
00184 }
00185
00186 #endif // __itkGDCMImageIO_h