ITK  5.4.0
Insight Toolkit
itkTransformFileWriter.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright NumFOCUS
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 * https://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 "ITKIOTransformBaseExport.h"
22
23#include "itkTransformIOBase.h"
24#include <iostream>
25#include <fstream>
26
27namespace itk
28{
38template <typename TParametersValueType>
40{
41public:
42 ITK_DISALLOW_COPY_AND_MOVE(TransformFileWriterTemplate);
43
49
50 using ParametersValueType = TParametersValueType;
57
59 itkNewMacro(Self);
60
62 itkOverrideGetNameOfClassMacro(TransformFileWriterTemplate);
63
65 itkSetStringMacro(FileName);
66
68 itkGetStringMacro(FileName);
69
70#if !defined(ITK_FUTURE_LEGACY_REMOVE)
73 void
74 SetAppendOff();
75
76 void
77 SetAppendOn();
78
79 bool
80 GetAppendMode();
81#endif
82
84 itkSetMacro(AppendMode, bool);
85 itkGetConstMacro(AppendMode, bool);
86 itkBooleanMacro(AppendMode);
90 itkSetMacro(UseCompression, bool);
91 itkGetConstMacro(UseCompression, bool);
92 itkBooleanMacro(UseCompression);
96 void
97 SetInput(const Object * transform);
98
99 const TransformType *
101
103 void
104 AddTransform(const Object * transform);
105
107 void
109
111 itkSetObjectMacro(TransformIO, TransformIOType);
112 itkGetConstObjectMacro(TransformIO, TransformIOType);
115protected:
118
119 void
120 PrintSelf(std::ostream & os, Indent indent) const override;
121
122private:
123 void
124 PushBackTransformList(const Object * transObj);
125
126 std::string m_FileName{};
127 ConstTransformListType m_TransformList{};
128 bool m_AppendMode{ false };
130 bool m_UseCompression{ false };
131 typename TransformIOType::Pointer m_TransformIO{};
132};
133
136
137ITK_GCC_PRAGMA_DIAG_PUSH()
138ITK_GCC_PRAGMA_DIAG(ignored "-Wattributes")
139
141template <>
143 TransformFileWriterTemplate<double>::PushBackTransformList(const Object * transObj);
144template <>
146 TransformFileWriterTemplate<float>::PushBackTransformList(const Object * transObj);
149ITK_GCC_PRAGMA_DIAG_POP()
150
151} // namespace itk
152
153#if defined ITK_TRANSFORMIO_FACTORY_REGISTER_MANAGER || defined ITK_IO_FACTORY_REGISTER_MANAGER
154# include "itkTransformIOFactoryRegisterManager.h"
155#endif
156
157// Note: Explicit instantiation is done in itkTransformFileWriterSpecializations.cxx
158
159#endif // itkTransformFileWriter_h
160
162#ifndef ITK_TEMPLATE_EXPLICIT_TransformFileWriter
163// Explicit instantiation is required to ensure correct dynamic_cast
164// behavior across shared libraries.
165//
166// IMPORTANT: Since within the same compilation unit,
167// ITK_TEMPLATE_EXPLICIT_<classname> defined and undefined states
168// need to be considered. This code *MUST* be *OUTSIDE* the header
169// guards.
170//
171#if defined(ITKIOTransformBase_EXPORTS)
172// We are building this library
173# define ITKIOTransformBase_EXPORT_EXPLICIT ITKIOTransformBase_TEMPLATE_EXPORT
174#else
175// We are using this library
176# define ITKIOTransformBase_EXPORT_EXPLICIT ITKIOTransformBase_EXPORT
177#endif
178namespace itk
179{
180
181ITK_GCC_PRAGMA_DIAG_PUSH()
182ITK_GCC_PRAGMA_DIAG(ignored "-Wattributes")
183
186
187ITK_GCC_PRAGMA_DIAG_POP()
188
189} // end namespace itk
190#undef ITKIOTransformBase_EXPORT_EXPLICIT
191#endif
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Light weight base class for most itk classes.
LightProcessObject is the base class for all process objects (source, filters, mappers) in the Insigh...
Base class for most ITK classes.
Definition: itkObject.h:62
void PushBackTransformList(const Object *transObj)
typename TransformIOType::TransformPointer TransformPointer
const TransformType * GetInput()
void PrintSelf(std::ostream &os, Indent indent) const override
void SetInput(const Object *transform)
typename TransformIOType::ConstTransformPointer ConstTransformPointer
typename TransformIOType::ConstTransformListType ConstTransformListType
void AddTransform(const Object *transform)
std::list< ConstTransformPointer > ConstTransformListType
typename TransformType::ConstPointer ConstTransformPointer
#define ITKIOTransformBase_EXPORT_EXPLICIT
#define ITKIOTransformBase_TEMPLATE_EXPORT
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
template class ITKIOTransformBase_EXPORT_EXPLICIT TransformFileWriterTemplate< double >
template class ITKIOTransformBase_EXPORT_EXPLICIT TransformFileWriterTemplate< float >