00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkTransformFileWriter.h,v $ 00005 Language: C++ 00006 Date: $Date: 2009-04-25 12:25:45 $ 00007 Version: $Revision: 1.10 $ 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 // First make sure that the configuration is available. 00021 // This line can be removed once the factory based version 00022 // gets integrated into the main directories. 00023 #include "itkConfigure.h" 00024 00025 #ifdef ITK_USE_TRANSFORM_IO_FACTORIES 00026 #include "itkTransformFileWriterWithFactory.h" 00027 #else 00028 00029 00030 #include "itkLightProcessObject.h" 00031 #include "metaTransform.h" 00032 #include "itkTransformBase.h" 00033 00034 namespace itk 00035 { 00036 00041 class TransformFileWriter : public LightProcessObject 00042 { 00043 public: 00044 00046 typedef TransformFileWriter Self; 00047 typedef SmartPointer<Self> Pointer; 00048 typedef TransformBase TransformType; 00049 typedef TransformType::Pointer TransformPointer; 00050 00052 itkNewMacro(Self); 00053 00055 typedef Object Superclass; 00056 itkTypeMacro(TransformFileWriter, LightProcessObject); 00058 00060 itkSetStringMacro(FileName); 00061 00063 itkGetStringMacro(FileName); 00064 00066 void SetAppendOff( ); 00067 void SetAppendOn( ); 00068 void SetAppendMode(bool mode); 00069 bool GetAppendMode( ); 00071 00073 void SetInput(const TransformType* transform); 00074 const TransformType * GetInput() {return *(m_TransformList.begin());} 00076 00078 void AddTransform(const TransformType* transform); 00079 00081 itkSetMacro(Precision,unsigned int); 00082 itkGetConstMacro(Precision,unsigned int); 00084 00086 void Update(); 00087 00088 protected: 00089 TransformFileWriter(const Self&); //purposely not implemented 00090 void operator=(const Self&); //purposely not implemented 00091 00092 std::string m_FileName; 00093 00094 TransformFileWriter(); 00095 virtual ~TransformFileWriter(); 00096 00097 private: 00098 00099 std::list<const TransformType*> m_TransformList; 00100 unsigned int m_Precision; 00101 bool m_AppendMode; 00102 }; 00103 00104 } // namespace itk 00105 00106 #endif 00107 00108 #endif // __itkTransformFileWriter_h 00109