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
00026 namespace itk
00027 {
00028
00050 class ITK_EXPORT GDCMImageIO : public ImageIOBase
00051 {
00052 public:
00054 typedef GDCMImageIO Self;
00055 typedef ImageIOBase Superclass;
00056 typedef SmartPointer<Self> Pointer;
00057
00059 itkNewMacro(Self);
00060
00062 itkTypeMacro(GDCMImageIO, Superclass);
00063
00064
00065
00068 virtual bool CanReadFile(const char*);
00069
00071 virtual void ReadImageInformation();
00072
00074 virtual void Read(void* buffer);
00075
00076
00077
00080 virtual bool CanWriteFile(const char*);
00081
00084 virtual void WriteImageInformation();
00085
00088 virtual void Write(const void* buffer);
00089
00093 itkGetMacro(RescaleSlope, double);
00094 itkGetMacro(RescaleIntercept, double);
00095
00100 itkGetStringMacro(UIDPrefix);
00101 itkSetStringMacro(UIDPrefix);
00102
00105 itkSetMacro(KeepOriginalUID,bool);
00106 itkGetMacro(KeepOriginalUID,bool);
00107 itkBooleanMacro(KeepOriginalUID);
00108
00109 protected:
00110 GDCMImageIO();
00111 ~GDCMImageIO();
00112 void PrintSelf(std::ostream& os, Indent indent) const;
00113
00114 bool OpenGDCMFileForReading(std::ifstream& os, const char* filename);
00115 bool OpenGDCMFileForWriting(std::ofstream& os, const char* filename);
00116 void InternalReadImageInformation(std::ifstream& file);
00117
00118 double m_RescaleSlope;
00119 double m_RescaleIntercept;
00120
00121 std::string m_UIDPrefix;
00122 std::string m_StudyInstanceUID;
00123 std::string m_SeriesInstanceUID;
00124 std::string m_FrameOfReferenceInstanceUID;
00125 bool m_KeepOriginalUID;
00126
00127 private:
00128 GDCMImageIO(const Self&);
00129 void operator=(const Self&);
00130 };
00131
00132 }
00133
00134 #endif // __itkGDCMImageIO_h