ITK  5.2.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  * 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 itkTxtTransformIO_h
19 #define itkTxtTransformIO_h
20 
21 #include "ITKIOTransformInsightLegacyExport.h"
22 
23 #include "itkTransformIOBase.h"
24 
25 namespace itk
26 {
31 template <typename TParametersValueType>
32 class ITK_TEMPLATE_EXPORT TxtTransformIOTemplate : public TransformIOBaseTemplate<TParametersValueType>
33 {
34 public:
38  using TransformType = typename Superclass::TransformType;
39  using TransformPointer = typename Superclass::TransformPointer;
40  using TransformListType = typename Superclass::TransformListType;
42 
47 
49  itkTypeMacro(TxtTransformIOTemplate, Superclass);
50  itkNewMacro(Self);
52 
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 
77 protected:
79  ~TxtTransformIOTemplate() override;
80 
81 private:
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
113 namespace itk
114 {
115 
116 ITK_GCC_PRAGMA_DIAG_PUSH()
117 ITK_GCC_PRAGMA_DIAG(ignored "-Wattributes")
118 
121 
122 ITK_GCC_PRAGMA_DIAG_POP()
123 
124 } // end namespace itk
125 #undef ITKIOTransformInsightLegacy_EXPORT_EXPLICIT
126 #endif
itk::OptimizerParameters
Class to hold and manage different parameter types used during optimization.
Definition: itkOptimizerParameters.h:36
ITKIOTransformInsightLegacy_EXPORT_EXPLICIT
#define ITKIOTransformInsightLegacy_EXPORT_EXPLICIT
Definition: itkTxtTransformIO.h:111
itk::TxtTransformIOTemplate::ParametersType
typename TransformType::ParametersType ParametersType
Definition: itkTxtTransformIO.h:43
itk::TransformIOBaseTemplate::ParametersValueType
TParametersValueType ParametersValueType
Definition: itkTransformIOBase.h:71
itk::TransformIOBaseTemplate::TransformListType
std::list< TransformPointer > TransformListType
Definition: itkTransformIOBase.h:80
itkTransformIOBase.h
itk::TransformIOBaseTemplate::ConstTransformListType
std::list< ConstTransformPointer > ConstTransformListType
Definition: itkTransformIOBase.h:82
itk::TransformIOBaseTemplate::TransformPointer
typename TransformType::Pointer TransformPointer
Definition: itkTransformIOBase.h:79
itk::TxtTransformIOTemplate
Create instances of TxtTransformIOTemplate objects.
Definition: itkTxtTransformIO.h:32
itk::SmartPointer< Self >
itk::TxtTransformIOTemplate< double >
template class ITKIOTransformInsightLegacy_EXPORT_EXPLICIT TxtTransformIOTemplate< double >
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::TransformIOBaseTemplate
Abstract superclass defining the Transform IO interface.
Definition: itkTransformIOBase.h:58
itk::TransformBaseTemplate::FixedParametersValueType
double FixedParametersValueType
Definition: itkTransformBase.h:83
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::TxtTransformIOTemplate::FixedParametersType
typename TransformType::FixedParametersType FixedParametersType
Definition: itkTxtTransformIO.h:45
itk::Object
Base class for most ITK classes.
Definition: itkObject.h:62
itk::TransformBaseTemplate::ParametersValueType
TParametersValueType ParametersValueType
Definition: itkTransformBase.h:81
itk::TxtTransformIOTemplate< float >
template class ITKIOTransformInsightLegacy_EXPORT_EXPLICIT TxtTransformIOTemplate< float >
itk::TransformBaseTemplate
Definition: itkTransformBase.h:68
itk::TransformIOBaseTemplate::FixedParametersValueType
double FixedParametersValueType
Definition: itkTransformIOBase.h:72