00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __itkWriter_h
00021 #define __itkWriter_h
00022
00023 #include "itkProcessObject.h"
00024
00025 namespace itk
00026 {
00027
00036 class ITK_EXPORT Writer : public ProcessObject
00037 {
00038 public:
00040 typedef Writer Self;
00041 typedef ProcessObject Superclass;
00042 typedef SmartPointer<Self> Pointer;
00043 typedef SmartPointer<const Self> ConstPointer;
00044
00046 itkTypeMacro(Writer,ProcessObject);
00047
00049 itkSetStringMacro(FileName);
00050
00052 itkGetStringMacro(FileName);
00053
00055 typedef enum {ASCII,Binary} FileType;
00056
00058 itkSetMacro(FileType,FileType);
00059
00061 itkGetMacro(FileType,FileType);
00062
00064 void SetFileTypeToASCII()
00065 {this->SetFileType(Writer::ASCII);}
00066
00068 void SetFileTypeToBinary()
00069 {this->SetFileType(Writer::Binary);}
00070
00073 virtual void Write();
00074
00076 virtual void Update()
00077 {this->Write();}
00078
00079 protected:
00080 Writer();
00081 ~Writer();
00082 void PrintSelf(std::ostream& os, Indent indent) const;
00083
00088 virtual void WriteData() = 0;
00089
00090 void GenerateData()
00091 {this->WriteData();}
00092
00093 private:
00094 std::string m_FileName;
00095 FileType m_FileType;
00096
00097 Writer(const Self&);
00098 void operator=(const Self&);
00099 };
00100
00101
00102 }
00103
00104 #endif
00105