go home Home | Main Page | Topics | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkDistancePreservingRigidityPenaltyTerm.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright UMC Utrecht and contributors
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 itkDistancePreservingRigidityPenaltyTerm_h
19#define itkDistancePreservingRigidityPenaltyTerm_h
20
22
26
28#include "itkNeighborhood.h"
29#include "itkImageRegionIterator.h"
30#include "itkNeighborhoodOperatorImageFilter.h"
31#include "itkNeighborhoodIterator.h"
32
33#include "itkImageRegionIterator.h"
34#include "itkMultiResolutionPyramidImageFilter.h"
35
36namespace itk
37{
74
75template <typename TFixedImage, typename TScalarType>
76class ITK_TEMPLATE_EXPORT DistancePreservingRigidityPenaltyTerm : public TransformPenaltyTerm<TFixedImage, TScalarType>
77{
78public:
80
84 using Pointer = SmartPointer<Self>;
85 using ConstPointer = SmartPointer<const Self>;
86
88 itkNewMacro(Self);
89
92
94 using typename Superclass::CoordinateRepresentationType;
95 using typename Superclass::MovingImageType;
96 using typename Superclass::MovingImagePixelType;
97 using typename Superclass::MovingImagePointer;
98 using typename Superclass::MovingImageConstPointer;
99 using typename Superclass::FixedImageType;
100 using typename Superclass::FixedImagePointer;
101 using typename Superclass::FixedImageConstPointer;
102 using typename Superclass::FixedImageRegionType;
103 using typename Superclass::TransformType;
104 using typename Superclass::TransformPointer;
105 using typename Superclass::InputPointType;
106 using typename Superclass::OutputPointType;
107 using typename Superclass::TransformJacobianType;
108 using typename Superclass::InterpolatorType;
109 using typename Superclass::InterpolatorPointer;
110 using typename Superclass::RealType;
111 using typename Superclass::GradientPixelType;
112 using typename Superclass::GradientImageType;
113 using typename Superclass::GradientImagePointer;
114 using typename Superclass::FixedImageMaskType;
116 using typename Superclass::MovingImageMaskType;
118 using typename Superclass::MeasureType;
119 using typename Superclass::DerivativeType;
120 using typename Superclass::DerivativeValueType;
121 using typename Superclass::ParametersType;
122 using typename Superclass::FixedImagePixelType;
125 using typename Superclass::ScalarType;
126
128 using typename Superclass::SpatialJacobianType;
130 using typename Superclass::SpatialHessianType;
132 using typename Superclass::InternalMatrixType;
133
135 itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension);
136 itkStaticConstMacro(MovingImageDimension, unsigned int, FixedImageType::ImageDimension);
137 itkStaticConstMacro(ImageDimension, unsigned int, FixedImageType::ImageDimension);
138
140 void
141 Initialize() override;
142
148 using CoefficientImagePointer = typename CoefficientImageType::Pointer;
149 using CoefficientImageSpacingType = typename CoefficientImageType::SpacingType;
151
153 MeasureType
154 GetValue(const ParametersType & parameters) const override;
155
157 void
158 GetDerivative(const ParametersType & parameters, DerivativeType & derivative) const override;
159
161 void
162 GetValueAndDerivative(const ParametersType & parameters,
163 MeasureType & value,
164 DerivativeType & derivative) const override;
165
170
172 using BSplineKnotImageType = Image<signed short, Self::MovingImageDimension>;
173 using BSplineKnotImagePointer = typename BSplineKnotImageType::Pointer;
174 using BSplineKnotImageRegionType = typename BSplineKnotImageType::RegionType;
175
177 using PenaltyGridImageType = Image<signed short, Self::MovingImageDimension>;
178 using PenaltyGridImagePointer = typename PenaltyGridImageType::Pointer;
179 using PenaltyGridImageRegionType = typename PenaltyGridImageType::RegionType;
180
182 using SegmentedImageType = Image<signed short, Self::MovingImageDimension>;
183 using SegmentedImagePointer = typename SegmentedImageType::Pointer;
184 using SegmentedImageRegionType = typename SegmentedImageType::RegionType;
185
187 itkSetObjectMacro(SegmentedImage, SegmentedImageType);
188
191
193 itkSetObjectMacro(SampledSegmentedImage, SegmentedImageType);
194
197
198 itkGetConstMacro(NumberOfRigidGrids, unsigned int);
199
200protected:
203
206
208 void
209 PrintSelf(std::ostream & os, Indent indent) const override;
210
211private:
214
215 mutable MeasureType m_RigidityPenaltyTermValue{};
216
221
222 unsigned int m_NumberOfRigidGrids{};
223};
224
225// end class DistancePreservingRigidityPenaltyTerm
226
227} // end namespace itk
228
229#ifndef ITK_MANUAL_INSTANTIATION
230# include "itkDistancePreservingRigidityPenaltyTerm.hxx"
231#endif
232
233#endif // #ifndef itkDistancePreservingRigidityPenaltyTerm_h
Deformable transform using a B-spline representation.
This class combines two transforms: an 'initial transform' with a 'current transform'.
typename ImageSamplerType::OutputVectorContainerPointer ImageSampleContainerPointer
typename ImageSamplerType::OutputVectorContainerType ImageSampleContainerType
ImageMaskSpatialObject< Self::FixedImageDimension > FixedImageMaskType
ImageMaskSpatialObject< Self::MovingImageDimension > MovingImageMaskType
ITK_DISALLOW_COPY_AND_MOVE(DistancePreservingRigidityPenaltyTerm)
~DistancePreservingRigidityPenaltyTerm() override=default
itkStaticConstMacro(ImageDimension, unsigned int, FixedImageType::ImageDimension)
itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension)
itkGetModifiableObjectMacro(SegmentedImage, SegmentedImageType)
void GetDerivative(const ParametersType &parameters, DerivativeType &derivative) const override
itkGetModifiableObjectMacro(SampledSegmentedImage, SegmentedImageType)
itkStaticConstMacro(MovingImageDimension, unsigned int, FixedImageType::ImageDimension)
void PrintSelf(std::ostream &os, Indent indent) const override
void GetValueAndDerivative(const ParametersType &parameters, MeasureType &value, DerivativeType &derivative) const override
itkOverrideGetNameOfClassMacro(DistancePreservingRigidityPenaltyTerm)
MeasureType GetValue(const ParametersType &parameters) const override
typename TransformType::JacobianOfSpatialJacobianType JacobianOfSpatialJacobianType
typename Superclass::AdvancedTransformType TransformType
typename TransformType::SpatialHessianType SpatialHessianType
typename TransformType::SpatialJacobianType SpatialJacobianType
typename TransformType::InternalMatrixType InternalMatrixType
typename TransformType::JacobianOfSpatialHessianType JacobianOfSpatialHessianType


Generated on 26-02-2026 for elastix by doxygen 1.16.1 (669aeeefca743c148e2d935b3d3c69535c7491e6) elastix logo