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