ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkTransformBase.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 itkTransformBase_h
19#define itkTransformBase_h
20
21#include "ITKTransformExport.h"
22
23#include "itkObject.h"
24#include "itkPoint.h"
25#include "itkCovariantVector.h"
26#include "vnl/vnl_vector_fixed.h"
27#include "itkArray2D.h"
29
30#include "itkObjectFactory.h"
31#include "itkIntTypes.h"
32
33namespace itk
34{
40{
41public:
54};
55// Define how to print enumeration
56extern ITKTransform_EXPORT std::ostream &
57 operator<<(std::ostream & out, const TransformBaseTemplateEnums::TransformCategory value);
67template <typename TParametersValueType>
69{
70public:
71 ITK_DISALLOW_COPY_AND_MOVE(TransformBaseTemplate);
72
78
80
81 using ParametersValueType = TParametersValueType;
85
87 itkOverrideGetNameOfClassMacro(TransformBaseTemplate);
88
92
93 /* For storing the name of InputSpace */
94 itkSetMacro(InputSpaceName, std::string);
95 itkGetConstReferenceMacro(InputSpaceName, std::string);
96
103 itkSetMacro(OutputSpaceName, std::string);
104 itkGetConstReferenceMacro(OutputSpaceName, std::string);
105
109
111 virtual const ParametersType &
112 GetParameters() const = 0;
113
115 virtual unsigned int
117
119 virtual unsigned int
123 virtual void
125
133 virtual void
135
137 virtual void
139
144 virtual void
145 CopyInParameters(const ParametersValueType * const begin, const ParametersValueType * const end) = 0;
146
151 virtual void
153
155 virtual const FixedParametersType &
157
159 virtual std::string
161
163#if !defined(ITK_LEGACY_REMOVE)
164 // We need to expose the enum values at the class level
165 // for backwards compatibility
166 static constexpr TransformCategoryEnum UnknownTransformCategory = TransformCategoryEnum::UnknownTransformCategory;
167 static constexpr TransformCategoryEnum Linear = TransformCategoryEnum::Linear;
168 static constexpr TransformCategoryEnum BSpline = TransformCategoryEnum::BSpline;
169 static constexpr TransformCategoryEnum Spline = TransformCategoryEnum::Spline;
170 static constexpr TransformCategoryEnum DisplacementField = TransformCategoryEnum::DisplacementField;
171 static constexpr TransformCategoryEnum VelocityField = TransformCategoryEnum::VelocityField;
172
173 // Preserve old type name for backwards compatibility
174 using TransformCategoryType = TransformCategoryEnum;
175#endif
176
180
181protected:
183 ~TransformBaseTemplate() override = default;
184
185private:
186 std::string m_InputSpaceName{};
187 std::string m_OutputSpaceName{};
188};
189
192} // end namespace itk
193
194#endif
195
197#ifndef ITK_TEMPLATE_EXPLICIT_TransformBase
198// Explicit instantiation is required to ensure correct dynamic_cast
199// behavior across shared libraries.
200//
201// IMPORTANT: Since within the same compilation unit,
202// ITK_TEMPLATE_EXPLICIT_<classname> defined and undefined states
203// need to be considered. This code *MUST* be *OUTSIDE* the header
204// guards.
205//
206#if defined(ITKTransform_EXPORTS)
207// We are building this library
208# define ITKTransform_EXPORT_EXPLICIT ITK_TEMPLATE_EXPORT
209#else
210// We are using this library
211# define ITKTransform_EXPORT_EXPLICIT ITKTransform_EXPORT
212#endif
213namespace itk
214{
215ITK_GCC_PRAGMA_DIAG_PUSH()
216ITK_GCC_PRAGMA_DIAG(ignored "-Wattributes")
219ITK_GCC_PRAGMA_DIAG_POP()
220} // end namespace itk
221#undef ITKTransform_EXPORT_EXPLICIT
222#endif
Class to hold and manage different parameter types used during optimization.
Implements transparent reference counting.
Contains all enum classes used by TransformBaseTemplate class.
OptimizerParameters< ParametersValueType > ParametersType
virtual unsigned int GetInputSpaceDimension() const =0
SmartPointer< Self > Pointer
virtual void SetFixedParameters(const FixedParametersType &)=0
IdentifierType NumberOfParametersType
virtual std::string GetTransformTypeAsString() const =0
TParametersValueType ParametersValueType
TransformBaseTemplate Self
SmartPointer< const Self > ConstPointer
OptimizerParameters< FixedParametersValueType > FixedParametersType
virtual TransformCategoryEnum GetTransformCategory() const =0
virtual void SetParametersByValue(const ParametersType &p)=0
virtual void SetParameters(const ParametersType &)=0
~TransformBaseTemplate() override=default
virtual void CopyInFixedParameters(const FixedParametersValueType *const begin, const FixedParametersValueType *const end)=0
TransformBaseTemplateEnums::TransformCategory TransformCategoryEnum
virtual NumberOfParametersType GetNumberOfParameters() const =0
virtual const ParametersType & GetParameters() const =0
virtual unsigned int GetOutputSpaceDimension() const =0
virtual const FixedParametersType & GetFixedParameters() const =0
virtual void CopyInParameters(const ParametersValueType *const begin, const ParametersValueType *const end)=0
TransformBaseTemplateEnums::TransformCategory TransformCategoryEnum
#define ITKTransform_EXPORT_EXPLICIT
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
SizeValueType IdentifierType
Definition itkIntTypes.h:90
ITKCommon_EXPORT std::ostream & operator<<(std::ostream &out, typename AnatomicalOrientation::CoordinateEnum value)
template class ITKTransform_EXPORT_EXPLICIT TransformBaseTemplate< double >
template class ITKTransform_EXPORT_EXPLICIT TransformBaseTemplate< float >
TransformBaseTemplate< double > TransformBase