18 #ifndef itkTransformIOBase_h
19 #define itkTransformIOBase_h
21 #include "ITKIOTransformBaseExport.h"
31 #ifndef ITKIOTransformBase_TEMPLATE_EXPORT
32 # if defined(ITK_TEMPLATE_VISIBILITY_DEFAULT) || defined(__linux__) && defined(ITK_BUILD_SHARED_LIBS)
34 # define ITKIOTransformBase_TEMPLATE_EXPORT __attribute__((visibility("default")))
36 # define ITKIOTransformBase_TEMPLATE_EXPORT
57 template <
typename TParametersValueType>
85 itkSetStringMacro(FileName);
86 itkGetStringMacro(FileName);
100 CanReadFile(
const char *) = 0;
105 CanWriteFile(
const char *) = 0;
111 return m_ReadTransformList;
116 return m_ReadTransformList;
118 ConstTransformListType &
121 return m_WriteTransformList;
127 SetTransformList(ConstTransformListType & transformList);
130 itkSetMacro(AppendMode,
bool);
131 itkGetConstMacro(AppendMode,
bool);
132 itkBooleanMacro(AppendMode);
136 itkSetMacro(UseCompression,
bool);
137 itkGetConstMacro(UseCompression,
bool);
138 itkBooleanMacro(UseCompression);
152 itkGenericExceptionMacro(<<
"Unknown ScalarType" <<
typeid(
ScalarType).name());
159 PrintSelf(std::ostream & os,
Indent indent)
const override;
162 OpenStream(std::ofstream & outputStream,
bool binary);
165 CreateTransform(TransformPointer & ptr,
const std::string & ClassName);
169 static inline const std::string
172 itkGenericExceptionMacro(<<
"Unknown ScalarType" <<
typeid(
ScalarType).name());
179 bool m_AppendMode{
false };
181 bool m_UseCompression{
false };
190 if (inputTransformName.find(
"float") == std::string::npos)
192 const std::string::size_type begin = inputTransformName.find(
"double");
193 inputTransformName.replace(begin, 6,
"float");
202 if (inputTransformName.find(
"double") == std::string::npos)
204 const std::string::size_type begin = inputTransformName.find(
"float");
205 inputTransformName.replace(begin, 5,
"double");
210 inline const std::string
213 return std::string(
"float");
217 inline const std::string
220 return std::string(
"double");
228 #endif // itkTransformIOBase_h
231 #ifndef ITK_TEMPLATE_EXPLICIT_TransformIOBase
240 #if defined(ITKIOTransformBase_EXPORTS)
242 # define ITKIOTransformBase_EXPORT_EXPLICIT ITK_FORWARD_EXPORT
245 # define ITKIOTransformBase_EXPORT_EXPLICIT ITKIOTransformBase_EXPORT
250 ITK_GCC_PRAGMA_DIAG_PUSH()
251 ITK_GCC_PRAGMA_DIAG(ignored
"-Wattributes")
256 ITK_GCC_PRAGMA_DIAG_POP()
259 #undef ITKIOTransformBase_EXPORT_EXPLICIT