ITK  4.3.0
Insight Segmentation and Registration Toolkit
itkTransformFileWriter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef __itkTransformFileWriter_h
19 #define __itkTransformFileWriter_h
20 
21 #include "itkTransformIOBase.h"
22 #include <iostream>
23 #include <fstream>
24 
25 namespace itk
26 {
36 class ITK_EXPORT TransformFileWriter:public LightProcessObject
37 {
38 public:
39 
44 
48 
50  itkNewMacro(Self);
51 
54 
56  itkSetStringMacro(FileName);
57 
59  itkGetStringMacro(FileName);
60 
62  void SetAppendOff();
63 
64  void SetAppendOn();
65 
66  void SetAppendMode(bool mode);
67 
68  bool GetAppendMode();
69 
71  void SetInput(const TransformType *transform);
72 
73  const TransformType * GetInput();
74 
76  void AddTransform(const TransformType *transform);
77 
79  itkSetMacro(Precision, unsigned int);
80  itkGetConstMacro(Precision, unsigned int);
82 
84  void Update();
85 
86 protected:
87  TransformFileWriter(const Self &); //purposely not implemented
88  void operator=(const Self &); //purposely not implemented
89  void PrintSelf(std::ostream & os, Indent indent) const;
90 
92  virtual ~TransformFileWriter();
93 
94 private:
95  void OpenStream(std::ofstream & out, bool binary);
96 
97  std::string m_FileName;
99  unsigned int m_Precision;
101 };
102 } // namespace itk
103 
104 
105 #ifdef ITK_IO_FACTORY_REGISTER_MANAGER
106 #include "itkTransformIOFactoryRegisterManager.h"
107 #endif
108 
109 #endif // __itkTransformFileWriter_h
110