ITK  6.0.0
Insight Toolkit
itkTransformFileReader.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 itkTransformFileReader_h
19 #define itkTransformFileReader_h
20 
21 #include "ITKIOTransformBaseExport.h"
22 
23 #include "itkTransformIOBase.h"
24 
25 namespace itk
26 {
36 template <typename TParametersValueType>
37 class ITK_TEMPLATE_EXPORT TransformFileReaderTemplate : public LightProcessObject
38 {
39 public:
40  ITK_DISALLOW_COPY_AND_MOVE(TransformFileReaderTemplate);
41 
47 
48  using ParametersType = typename TransformType::ParametersType;
49  using ParametersValueType = typename TransformType::ParametersValueType;
50  using FixedParametersType = typename TransformType::FixedParametersType;
51  using FixedParametersValueType = typename TransformType::FixedParametersValueType;
52 
55  using TransformListType = typename TransformIOType::TransformListType;
56 
58  itkNewMacro(Self);
59 
61  itkOverrideGetNameOfClassMacro(TransformFileReaderTemplate);
62 
64  itkSetStringMacro(FileName);
65 
67  itkGetStringMacro(FileName);
68 
70  virtual void
71  Update();
72 
73 #if !defined(ITK_LEGACY_REMOVE)
74 
78  GetTransformList()
79  {
80  return &m_TransformList;
81  }
82 #else
83  const TransformListType *
85  {
86  return &m_TransformList;
87  }
88 #endif
89  TransformListType *
91  {
92  return &m_TransformList;
93  }
97  itkSetObjectMacro(TransformIO, TransformIOType);
98  itkGetConstObjectMacro(TransformIO, TransformIOType);
101 protected:
102  void
103  PrintSelf(std::ostream & os, Indent indent) const override;
104 
106  ~TransformFileReaderTemplate() override;
107 
108  TransformListType m_TransformList{};
109  typename TransformIOType::Pointer m_TransformIO{};
110  std::string m_FileName{};
111 };
112 
115 
116 } // namespace itk
117 
118 #if defined ITK_TRANSFORMIO_FACTORY_REGISTER_MANAGER || defined ITK_IO_FACTORY_REGISTER_MANAGER
119 # include "itkTransformIOFactoryRegisterManager.h"
120 #endif
121 
122 // Note: Explicit instantiation is done in itkTransformFileReader.cxx
123 
124 #endif // itkTransformFileReader_h
125 
127 #ifndef ITK_TEMPLATE_EXPLICIT_TransformFileReader
128 // Explicit instantiation is required to ensure correct dynamic_cast
129 // behavior across shared libraries.
130 //
131 // IMPORTANT: Since within the same compilation unit,
132 // ITK_TEMPLATE_EXPLICIT_<classname> defined and undefined states
133 // need to be considered. This code *MUST* be *OUTSIDE* the header
134 // guards.
135 //
136 #if defined(ITKIOTransformBase_EXPORTS)
137 // We are building this library
138 # define ITKIOTransformBase_EXPORT_EXPLICIT ITK_FORWARD_EXPORT
139 #else
140 // We are using this library
141 # define ITKIOTransformBase_EXPORT_EXPLICIT ITKIOTransformBase_EXPORT
142 #endif
143 namespace itk
144 {
145 
146 ITK_GCC_PRAGMA_DIAG_PUSH()
147 ITK_GCC_PRAGMA_DIAG(ignored "-Wattributes")
148 
151 
152 ITK_GCC_PRAGMA_DIAG_POP()
153 
154 } // end namespace itk
155 #undef ITKIOTransformBase_EXPORT_EXPLICIT
156 #endif
TransformBaseTemplate
Definition: itkTransformBase.h:85
itk::TransformFileReaderTemplate::ParametersType
typename TransformType::ParametersType ParametersType
Definition: itkTransformFileReader.h:48
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
itk::LightProcessObject
LightProcessObject is the base class for all process objects (source, filters, mappers) in the Insigh...
Definition: itkLightProcessObject.h:72
itk::TransformFileReaderTemplate::FixedParametersType
typename TransformType::FixedParametersType FixedParametersType
Definition: itkTransformFileReader.h:50
itkTransformIOBase.h
itk::TransformIOBaseTemplate< ParametersValueType >::TransformPointer
typename TransformType::Pointer TransformPointer
Definition: itkTransformIOBase.h:79
itk::TransformFileReaderTemplate::GetTransformList
const TransformListType * GetTransformList()
Definition: itkTransformFileReader.h:84
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::TransformFileReaderTemplate::ParametersValueType
typename TransformType::ParametersValueType ParametersValueType
Definition: itkTransformFileReader.h:49
itk::TransformFileReaderTemplate< float >
template class ITKIOTransformBase_EXPORT_EXPLICIT TransformFileReaderTemplate< float >
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itk::TransformFileReaderTemplate::FixedParametersValueType
typename TransformType::FixedParametersValueType FixedParametersValueType
Definition: itkTransformFileReader.h:51
itk::TransformIOBaseTemplate< ParametersValueType >
itk::TransformFileReaderTemplate::GetModifiableTransformList
TransformListType * GetModifiableTransformList()
Definition: itkTransformFileReader.h:90
itk::TransformFileReaderTemplate
TODO.
Definition: itkTransformFileReader.h:37
itk::TransformFileReaderTemplate< double >
template class ITKIOTransformBase_EXPORT_EXPLICIT TransformFileReaderTemplate< double >
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
ITKIOTransformBase_EXPORT_EXPLICIT
#define ITKIOTransformBase_EXPORT_EXPLICIT
Definition: itkTransformFileReader.h:141
itk::Object
Base class for most ITK classes.
Definition: itkObject.h:61
itk::TransformFileReaderTemplate::TransformPointer
typename TransformIOType::TransformPointer TransformPointer
Definition: itkTransformFileReader.h:54
itk::TransformFileReaderTemplate::TransformListType
typename TransformIOType::TransformListType TransformListType
Definition: itkTransformFileReader.h:55