ITK  5.4.0
Insight Toolkit
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:
45 enum class TransformCategory : uint8_t
46 {
47 UnknownTransformCategory = 0,
48 Linear = 1,
49 BSpline = 2,
50 Spline = 3,
51 DisplacementField = 4,
52 VelocityField = 5
53 };
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
81 using ParametersValueType = TParametersValueType;
85
87 itkOverrideGetNameOfClassMacro(TransformBaseTemplate);
88
92
96
98 virtual const ParametersType &
99 GetParameters() const = 0;
100
102 virtual unsigned int
104
106 virtual unsigned int
108
110 virtual void
112
120 virtual void
122
124 virtual void
126
131 virtual void
132 CopyInParameters(const ParametersValueType * const begin, const ParametersValueType * const end) = 0;
133
138 virtual void
140
142 virtual const FixedParametersType &
144
146 virtual std::string
148
150#if !defined(ITK_LEGACY_REMOVE)
151 // We need to expose the enum values at the class level
152 // for backwards compatibility
153 static constexpr TransformCategoryEnum UnknownTransformCategory = TransformCategoryEnum::UnknownTransformCategory;
155 static constexpr TransformCategoryEnum BSpline = TransformCategoryEnum::BSpline;
157 static constexpr TransformCategoryEnum DisplacementField = TransformCategoryEnum::DisplacementField;
158 static constexpr TransformCategoryEnum VelocityField = TransformCategoryEnum::VelocityField;
159
160 // Preserve old type name for backwards compatibility
161 using TransformCategoryType = TransformCategoryEnum;
162#endif
163
167
168protected:
169#if defined(__GNUC__)
170 // A bug in some versions of the GCC and Clang compilers
171 // result in an ICE or linker error when "= default" is requested.
172 // This was observed in at least gcc 4.8 and 5.4.0, and
173 // AppleClang 7.0.2 and 8.0.0. Probably others too.
174 // "= default" doesn't gain us much, so just don't use it here.
176 ~TransformBaseTemplate() override{};
177#else
179 ~TransformBaseTemplate() override = default;
180#endif
181};
182
185} // end namespace itk
186
187#endif
188
Light weight base class for most itk classes.
Base class for most ITK classes.
Definition: itkObject.h:62
Class to hold and manage different parameter types used during optimization.
Contains all enum classes used by TransformBaseTemplate class.
virtual unsigned int GetInputSpaceDimension() const =0
virtual void SetFixedParameters(const FixedParametersType &)=0
IdentifierType NumberOfParametersType
virtual std::string GetTransformTypeAsString() const =0
TParametersValueType ParametersValueType
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
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
SizeValueType IdentifierType
Definition: itkIntTypes.h:87
std::ostream & operator<<(std::ostream &os, const Array< TValue > &arr)
Definition: itkArray.h:216