00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkTransformFileWriter.h,v $ 00005 Language: C++ 00006 Date: $Date: 2005/09/22 03:03:52 $ 00007 Version: $Revision: 1.3 $ 00008 00009 Copyright (c) Insight Software Consortium. All rights reserved. 00010 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details. 00011 00012 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 00015 00016 =========================================================================*/ 00017 #ifndef __itkTransformFileWriter_h 00018 #define __itkTransformFileWriter_h 00019 00020 #include "itkLightProcessObject.h" 00021 #include "metaTransform.h" 00022 #include "itkTransformBase.h" 00023 00024 namespace itk 00025 { 00026 00027 class TransformFileWriter : public LightProcessObject 00028 { 00029 public: 00030 00032 typedef TransformFileWriter Self; 00033 typedef SmartPointer<Self> Pointer; 00034 typedef TransformBase TransformType; 00035 typedef TransformType::Pointer TransformPointer; 00036 00038 itkNewMacro(Self); 00039 00041 typedef Object Superclass; 00042 itkTypeMacro(TransformFileWriter, LightProcessObject); 00043 00045 itkSetStringMacro(FileName); 00046 00048 itkGetStringMacro(FileName); 00049 00051 void SetAppendOff( ); 00052 void SetAppendOn( ); 00053 void SetAppendMode(bool mode); 00054 bool GetAppendMode( ); 00055 00057 void SetInput(const TransformType* transform); 00058 const TransformType * GetInput() {return *(m_TransformList.begin());} 00059 00061 void AddTransform(const TransformType* transform); 00062 00064 itkSetMacro(Precision,unsigned int); 00065 itkGetMacro(Precision,unsigned int); 00066 00068 void Update(); 00069 00070 protected: 00071 00072 std::string m_FileName; 00073 00074 TransformFileWriter(); 00075 virtual ~TransformFileWriter(); 00076 00077 private: 00078 00079 std::list<const TransformType*> m_TransformList; 00080 unsigned int m_Precision; 00081 bool m_AppendMode; 00082 }; 00083 00084 } // namespace itk 00085 00086 00087 #endif // __itkTransformFileWriter_h