ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkTxtTransformIO.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 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  TParametersValueType>::ConstTransformListType;
43 
48 
50  itkTypeMacro(TxtTransformIOTemplate, Superclass);
51  itkNewMacro(Self);
53 
56  bool CanReadFile(const char *) override;
57 
60  bool CanWriteFile(const char *) override;
61 
63  void Read() override;
64 
68  void Write() override;
69 
70  /* Helper function for Read method, used for CompositeTransform reading. */
71  void ReadComponentFile( std::string Value );
72 
73 protected:
75  ~TxtTransformIOTemplate() override;
76 
77 private:
79  std::string trim(std::string const & source, char const *delims = " \t\r\n");
80 };
81 
84 
85 }
86 
87 // Note: Explicit instantiation is done in itkTxtTransformIO.cxx
88 
89 #endif // itkTxtTransformIO_h
90 
92 #ifndef ITK_TEMPLATE_EXPLICIT_TxtTransformIO
93 // Explicit instantiation is required to ensure correct dynamic_cast
94 // behavior across shared libraries.
95 //
96 // IMPORTANT: Since within the same compilation unit,
97 // ITK_TEMPLATE_EXPLICIT_<classname> defined and undefined states
98 // need to be considered. This code *MUST* be *OUTSIDE* the header
99 // guards.
100 //
101 # if defined( ITKIOTransformInsightLegacy_EXPORTS )
102 // We are building this library
103 # define ITKIOTransformInsightLegacy_EXPORT_EXPLICIT ITK_FORWARD_EXPORT
104 # else
105 // We are using this library
106 # define ITKIOTransformInsightLegacy_EXPORT_EXPLICIT ITKIOTransformInsightLegacy_EXPORT
107 # endif
108 namespace itk
109 {
110 
111 #ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP
112  ITK_GCC_PRAGMA_DIAG_PUSH()
113 #endif
114 ITK_GCC_PRAGMA_DIAG(ignored "-Wattributes")
115 
118 
119 #ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP
120  ITK_GCC_PRAGMA_DIAG_POP()
121 #else
122  ITK_GCC_PRAGMA_DIAG(warning "-Wattributes")
123 #endif
124 
125 } // end namespace itk
126 # undef ITKIOTransformInsightLegacy_EXPORT_EXPLICIT
127 #endif
Light weight base class for most itk classes.
template class ITKIOTransformInsightLegacy_EXPORT_EXPLICIT TxtTransformIOTemplate< float >
Abstract superclass defining the Transform IO interface.
std::list< ConstTransformPointer > ConstTransformListType
#define ITKIOTransformInsightLegacy_EXPORT_EXPLICIT
Class to hold and manage different parameter types used during optimization.
std::list< TransformPointer > TransformListType
typename TransformType::Pointer TransformPointer
typename TransformType::FixedParametersType FixedParametersType
Base class for most ITK classes.
Definition: itkObject.h:60
typename TransformType::ParametersType ParametersType
template class ITKIOTransformInsightLegacy_EXPORT_EXPLICIT TxtTransformIOTemplate< double >
TParametersValueType ParametersValueType
Create instances of TxtTransformIOTemplate objects.
TParametersValueType ParametersValueType