ITK  6.0.0
Insight Toolkit
itkTxtTransformIO.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 itkTxtTransformIO_h
19#define itkTxtTransformIO_h
20
21#include "ITKIOTransformInsightLegacyExport.h"
22
23#include "itkTransformIOBase.h"
24
25namespace itk
26{
31template <typename TParametersValueType>
32class ITK_TEMPLATE_EXPORT TxtTransformIOTemplate : public TransformIOBaseTemplate<TParametersValueType>
33{
34public:
38 using typename Superclass::TransformType;
39 using typename Superclass::TransformPointer;
40 using typename Superclass::TransformListType;
42
47
49 itkOverrideGetNameOfClassMacro(TxtTransformIOTemplate);
50 itkNewMacro(Self);
55 bool
56 CanReadFile(const char *) override;
57
60 bool
61 CanWriteFile(const char *) override;
62
64 void
65 Read() override;
66
70 void
71 Write() override;
72
73 /* Helper function for Read method, used for CompositeTransform reading. */
74 void
75 ReadComponentFile(std::string Value);
76
77protected:
80
81private:
83 std::string
84 trim(std::string const & source, char const * delims = " \t\r\n");
85};
86
89
90} // namespace itk
91
92// Note: Explicit instantiation is done in itkTxtTransformIO.cxx
93
94#endif // itkTxtTransformIO_h
95
97#ifndef ITK_TEMPLATE_EXPLICIT_TxtTransformIO
98// Explicit instantiation is required to ensure correct dynamic_cast
99// behavior across shared libraries.
100//
101// IMPORTANT: Since within the same compilation unit,
102// ITK_TEMPLATE_EXPLICIT_<classname> defined and undefined states
103// need to be considered. This code *MUST* be *OUTSIDE* the header
104// guards.
105//
106#if defined(ITKIOTransformInsightLegacy_EXPORTS)
107// We are building this library
108# define ITKIOTransformInsightLegacy_EXPORT_EXPLICIT ITK_FORWARD_EXPORT
109#else
110// We are using this library
111# define ITKIOTransformInsightLegacy_EXPORT_EXPLICIT ITKIOTransformInsightLegacy_EXPORT
112#endif
113namespace itk
114{
115
116ITK_GCC_PRAGMA_DIAG_PUSH()
117ITK_GCC_PRAGMA_DIAG(ignored "-Wattributes")
118
121
122ITK_GCC_PRAGMA_DIAG_POP()
123
124} // end namespace itk
125#undef ITKIOTransformInsightLegacy_EXPORT_EXPLICIT
126#endif
OptimizerParameters< FixedParametersValueType > FixedParametersType
TParametersValueType ParametersValueType
OptimizerParameters< ParametersValueType > ParametersType
Light weight base class for most itk classes.
Base class for most ITK classes.
Definition: itkObject.h:62
Abstract superclass defining the Transform IO interface.
TParametersValueType ParametersValueType
std::list< ConstTransformPointer > ConstTransformListType
Create instances of TxtTransformIOTemplate objects.
void ReadComponentFile(std::string Value)
bool CanWriteFile(const char *) override
bool CanReadFile(const char *) override
std::string trim(std::string const &source, char const *delims=" \t\r\n")
typename TransformType::FixedParametersType FixedParametersType
typename TransformType::ParametersType ParametersType
#define ITKIOTransformInsightLegacy_EXPORT_EXPLICIT
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
template class ITKIOTransformInsightLegacy_EXPORT_EXPLICIT TxtTransformIOTemplate< double >
template class ITKIOTransformInsightLegacy_EXPORT_EXPLICIT TxtTransformIOTemplate< float >