go home Home | Main Page | Modules | 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{
75template <class TFixedImage, class 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::TransformParametersType;
108 using typename Superclass::TransformJacobianType;
109 using typename Superclass::InterpolatorType;
110 using typename Superclass::InterpolatorPointer;
111 using typename Superclass::RealType;
112 using typename Superclass::GradientPixelType;
113 using typename Superclass::GradientImageType;
114 using typename Superclass::GradientImagePointer;
115 using typename Superclass::FixedImageMaskType;
117 using typename Superclass::MovingImageMaskType;
119 using typename Superclass::MeasureType;
120 using typename Superclass::DerivativeType;
121 using typename Superclass::DerivativeValueType;
122 using typename Superclass::ParametersType;
123 using typename Superclass::FixedImagePixelType;
126 using typename Superclass::ScalarType;
127
129 using typename Superclass::SpatialJacobianType;
131 using typename Superclass::SpatialHessianType;
133 using typename Superclass::InternalMatrixType;
134
136 itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension);
137 itkStaticConstMacro(MovingImageDimension, unsigned int, FixedImageType::ImageDimension);
138 itkStaticConstMacro(ImageDimension, unsigned int, FixedImageType::ImageDimension);
139
141 void
142 Initialize() override;
143
149 using CoefficientImagePointer = typename CoefficientImageType::Pointer;
150 using CoefficientImageSpacingType = typename CoefficientImageType::SpacingType;
152
154 MeasureType
155 GetValue(const ParametersType & parameters) const override;
156
158 void
159 GetDerivative(const ParametersType & parameters, DerivativeType & derivative) const override;
160
162 void
163 GetValueAndDerivative(const ParametersType & parameters,
164 MeasureType & value,
165 DerivativeType & derivative) const override;
166
171
174 using BSplineKnotImagePointer = typename BSplineKnotImageType::Pointer;
175 using BSplineKnotImageRegionType = typename BSplineKnotImageType::RegionType;
176
179 using PenaltyGridImagePointer = typename PenaltyGridImageType::Pointer;
180 using PenaltyGridImageRegionType = typename PenaltyGridImageType::RegionType;
181
184 using SegmentedImagePointer = typename SegmentedImageType::Pointer;
185 using SegmentedImageRegionType = typename SegmentedImageType::RegionType;
186
188 itkSetObjectMacro(SegmentedImage, SegmentedImageType);
189
192
194 itkSetObjectMacro(SampledSegmentedImage, SegmentedImageType);
195
198
199 itkGetConstMacro(NumberOfRigidGrids, unsigned int);
200
201protected:
204
207
209 void
210 PrintSelf(std::ostream & os, Indent indent) const override;
211
212private:
214 BSplineTransformPointer m_BSplineTransform{};
215
216 mutable MeasureType m_RigidityPenaltyTermValue{};
217
218 BSplineKnotImagePointer m_BSplineKnotImage{};
219 PenaltyGridImagePointer m_PenaltyGridImage{};
220 SegmentedImagePointer m_SegmentedImage{};
221 SegmentedImagePointer m_SampledSegmentedImage{};
222
223 unsigned int m_NumberOfRigidGrids{};
224};
225
226// end class DistancePreservingRigidityPenaltyTerm
227
228} // end namespace itk
229
230#ifndef ITK_MANUAL_INSTANTIATION
231# include "itkDistancePreservingRigidityPenaltyTerm.hxx"
232#endif
233
234#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
typename BSplineKnotImageType::RegionType BSplineKnotImageRegionType
typename PenaltyGridImageType::RegionType PenaltyGridImageRegionType
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
typename CoefficientImageType::SpacingType CoefficientImageSpacingType
MeasureType GetValue(const ParametersType &parameters) const override
A cost function that calculates a penalty term on a transformation.
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 2024-07-17 for elastix by doxygen 1.11.0 (9b424b03c9833626cd435af22a444888fbbb192d) elastix logo