ITK  6.0.0
Insight Toolkit
itkLandmarkBasedTransformInitializer.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 itkLandmarkBasedTransformInitializer_h
19#define itkLandmarkBasedTransformInitializer_h
20
21#include "itkObject.h"
22#include "itkObjectFactory.h"
25#include "itkRigid2DTransform.h"
26#include "itkAffineTransform.h"
27#include "itkBSplineTransform.h"
28#include "itkPoint.h"
29#include "itkPointSet.h"
32#include <vector>
33
34namespace itk
35{
87template <typename TTransform,
90class ITK_TEMPLATE_EXPORT LandmarkBasedTransformInitializer : public Object
91{
92public:
93 ITK_DISALLOW_COPY_AND_MOVE(LandmarkBasedTransformInitializer);
94
100
102 itkNewMacro(Self);
103
105 itkOverrideGetNameOfClassMacro(LandmarkBasedTransformInitializer);
106
108 using TransformType = TTransform;
110
112 static constexpr unsigned int InputSpaceDimension = TransformType::InputSpaceDimension;
113 static constexpr unsigned int OutputSpaceDimension = TransformType::OutputSpaceDimension;
114
116 itkSetObjectMacro(Transform, TransformType);
117
119 using FixedImageType = TFixedImage;
120 using MovingImageType = TMovingImage;
121
123 itkSetConstObjectMacro(ReferenceImage, FixedImageType);
124
126 itkSetMacro(BSplineNumberOfControlPoints, unsigned int);
127
130
132 static constexpr unsigned int ImageDimension = FixedImageType::ImageDimension;
133
135 using InputPointType = typename TransformType::InputPointType;
136 using OutputVectorType = typename TransformType::OutputVectorType;
137
140 using LandmarkPointContainer = std::vector<LandmarkPointType>;
141 using PointsContainerConstIterator = typename LandmarkPointContainer::const_iterator;
142
143 using ParametersType = typename TransformType::ParametersType;
144 using ParametersValueType = typename ParametersType::ValueType;
145 using LandmarkWeightType = std::vector<double>;
146 using LandmarkWeightConstIterator = LandmarkWeightType::const_iterator;
147
149 void
151 {
152 this->m_FixedLandmarks = fixedLandmarks;
153 }
154
156 void
158 {
159 this->m_MovingLandmarks = movingLandmarks;
160 }
161
165 void
167 {
168 this->m_LandmarkWeight = landmarkWeight;
169 }
170
176
177 static constexpr unsigned int SplineOrder = 3;
179
181 virtual void
183
184protected:
187
188 void
189 PrintSelf(std::ostream & os, Indent indent) const override;
190
191private:
193 template <typename TTransform2>
194 void
196
198 void
200
202 void
204
206 void
208
210 void
212
214 void
216
219
222
223 FixedImagePointer m_ReferenceImage{};
224 TransformPointer m_Transform{};
225 LandmarkPointContainer m_FixedLandmarks{};
226 LandmarkPointContainer m_MovingLandmarks{};
227
229 LandmarkWeightType m_LandmarkWeight{};
230 unsigned int m_BSplineNumberOfControlPoints{ 4 };
231
232}; // class LandmarkBasedTransformInitializer
233} // namespace itk
234
235#ifndef ITK_MANUAL_INSTANTIATION
236# include "itkLandmarkBasedTransformInitializer.hxx"
237#endif
238
239#endif /* itkLandmarkBasedTransformInitializer_h */
Deformable transform using a BSpline representation.
Base class for templated image classes.
Definition: itkImageBase.h:115
Control indentation during Print() invocation.
Definition: itkIndent.h:50
void InternalInitializeTransform(Similarity3DTransformType *)
void SetLandmarkWeight(LandmarkWeightType &landmarkWeight)
LandmarkWeightType::const_iterator LandmarkWeightConstIterator
~LandmarkBasedTransformInitializer() override=default
void InternalInitializeTransform(BSplineTransformType *)
void InternalInitializeTransform(TTransform2 *)
void InternalInitializeTransform(VersorRigid3DTransformType *)
void InternalInitializeTransform(AffineTransformType *)
typename TransformType::InputPointType InputPointType
typename TransformType::OutputVectorType OutputVectorType
typename MovingImageType::ConstPointer MovingImagePointer
void CreateMatrix(itk::Matrix< ParametersValueType, 4, 4 > &, const itk::Matrix< ParametersValueType, ImageDimension, ImageDimension >)
typename TransformType::ParametersType ParametersType
void SetFixedLandmarks(const LandmarkPointContainer &fixedLandmarks)
void PrintSelf(std::ostream &os, Indent indent) const override
PointType3D ComputeCentroid(const LandmarkPointContainer)
typename FixedImageType::ConstPointer FixedImagePointer
void SetMovingLandmarks(const LandmarkPointContainer &movingLandmarks)
void InternalInitializeTransform(Rigid2DTransformType *)
typename LandmarkPointContainer::const_iterator PointsContainerConstIterator
Light weight base class for most itk classes.
A templated class holding a M x N size Matrix.
Definition: itkMatrix.h:53
Base class for most ITK classes.
Definition: itkObject.h:62
Rigid2DTransform of a vector space (e.g. space coordinates)
Similarity3DTransform of a vector space (e.g. space coordinates)
Transform points and vectors from an input space to an output space.
Definition: itkTransform.h:84
VersorRigid3DTransform of a vector space (e.g. space coordinates)
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....