go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkAdvancedNormalizedCorrelationImageToImageMetric.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 itkAdvancedNormalizedCorrelationImageToImageMetric_h
19#define itkAdvancedNormalizedCorrelationImageToImageMetric_h
20
22#include <vector>
23
24namespace itk
25{
90template <class TFixedImage, class TMovingImage>
92 : public AdvancedImageToImageMetric<TFixedImage, TMovingImage>
93{
94public:
96
100 using Pointer = SmartPointer<Self>;
101 using ConstPointer = SmartPointer<const Self>;
102
104 itkNewMacro(Self);
105
108
110 using typename Superclass::CoordinateRepresentationType;
111 using typename Superclass::MovingImageType;
112 using typename Superclass::MovingImagePixelType;
113 using typename Superclass::MovingImageConstPointer;
114 using typename Superclass::FixedImageType;
115 using typename Superclass::FixedImageConstPointer;
116 using typename Superclass::FixedImageRegionType;
117 using typename Superclass::TransformType;
118 using typename Superclass::TransformPointer;
119 using typename Superclass::InputPointType;
120 using typename Superclass::OutputPointType;
121 using typename Superclass::TransformParametersType;
122 using typename Superclass::TransformJacobianType;
124 using typename Superclass::InterpolatorType;
125 using typename Superclass::InterpolatorPointer;
126 using typename Superclass::RealType;
127 using typename Superclass::GradientPixelType;
128 using typename Superclass::GradientImageType;
129 using typename Superclass::GradientImagePointer;
130 using typename Superclass::FixedImageMaskType;
132 using typename Superclass::MovingImageMaskType;
134 using typename Superclass::MeasureType;
135 using typename Superclass::DerivativeType;
136 using typename Superclass::DerivativeValueType;
137 using typename Superclass::ParametersType;
138 using typename Superclass::FixedImagePixelType;
140 using typename Superclass::ImageSamplerType;
141 using typename Superclass::ImageSamplerPointer;
149 using typename Superclass::ThreadInfoType;
150
152 itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension);
153
155 itkStaticConstMacro(MovingImageDimension, unsigned int, MovingImageType::ImageDimension);
156
158 MeasureType
159 GetValue(const TransformParametersType & parameters) const override;
160
162 void
163 GetDerivative(const TransformParametersType & parameters, DerivativeType & derivative) const override;
164
166 void
167 GetValueAndDerivativeSingleThreaded(const TransformParametersType & parameters,
168 MeasureType & value,
169 DerivativeType & derivative) const;
170
171 void
172 GetValueAndDerivative(const TransformParametersType & parameters,
173 MeasureType & value,
174 DerivativeType & derivative) const override;
175
176protected:
179
180 using Superclass::PrintSelf;
181
185 using typename Superclass::FixedImageIndexType;
188 using typename Superclass::FixedImagePointType;
194
198 void
199 UpdateDerivativeTerms(const RealType fixedImageValue,
200 const RealType movingImageValue,
201 const DerivativeType & imageJacobian,
202 const NonZeroJacobianIndicesType & nzji,
203 DerivativeType & derivativeF,
204 DerivativeType & derivativeM,
205 DerivativeType & differential) const;
206
211 void
213
215 void
216 ThreadedGetValueAndDerivative(ThreadIdType threadID) const override;
217
219 void
220 AfterThreadedGetValueAndDerivative(MeasureType & value, DerivativeType & derivative) const override;
221
223 static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION
225
226private:
227 using AccumulateType = typename NumericTraits<MeasureType>::AccumulateType;
228
242
255 itkPadStruct(ITK_CACHE_LINE_ALIGNMENT,
257 PaddedCorrelationGetValueAndDerivativePerThreadStruct);
258 itkAlignedTypedef(ITK_CACHE_LINE_ALIGNMENT,
259 PaddedCorrelationGetValueAndDerivativePerThreadStruct,
260 AlignedCorrelationGetValueAndDerivativePerThreadStruct);
261 mutable std::vector<AlignedCorrelationGetValueAndDerivativePerThreadStruct>
263};
264
265} // end namespace itk
266
267#ifndef ITK_MANUAL_INSTANTIATION
268# include "itkAdvancedNormalizedCorrelationImageToImageMetric.hxx"
269#endif
270
271#endif // end #ifndef itkAdvancedNormalizedCorrelationImageToImageMetric_h
An extension of the ITK ImageToImageMetric. It is the intended base class for all elastix metrics.
typename TransformType::OutputPointType MovingImagePointType
typename ImageSamplerType::OutputVectorContainerPointer ImageSampleContainerPointer
typename MovingImageType::RegionType MovingImageRegionType
typename AdvancedTransformType::NonZeroJacobianIndicesType NonZeroJacobianIndicesType
typename FixedImageType::PixelType FixedImagePixelType
typename DerivativeType::ValueType DerivativeValueType
typename FixedImageIndexType::IndexValueType FixedImageIndexValueType
typename MovingImageType::IndexType MovingImageIndexType
typename ImageSamplerType::OutputVectorContainerType ImageSampleContainerType
ImageMaskSpatialObject< Self::FixedImageDimension > FixedImageMaskType
typename FixedImageType::IndexType FixedImageIndexType
SmartPointer< MovingImageMaskType > MovingImageMaskPointer
MultiThreaderBase::WorkUnitInfo ThreadInfoType
typename BSplineInterpolatorType::CovariantVectorType MovingImageDerivativeType
typename MovingImageLimiterType::OutputType MovingImageLimiterOutputType
typename TransformType::InputPointType FixedImagePointType
typename FixedImageLimiterType::OutputType FixedImageLimiterOutputType
SmartPointer< FixedImageMaskType > FixedImageMaskPointer
BSplineInterpolateImageFunction< MovingImageType, CoordinateRepresentationType, double > BSplineInterpolatorType
typename ImageSamplerType::Pointer ImageSamplerPointer
typename InterpolatorType::ContinuousIndexType MovingImageContinuousIndexType
typename AdvancedTransformType::NumberOfParametersType NumberOfParametersType
ImageMaskSpatialObject< Self::MovingImageDimension > MovingImageMaskType
Computes normalized correlation between two images, based on AdvancedImageToImageMetric....
void UpdateDerivativeTerms(const RealType fixedImageValue, const RealType movingImageValue, const DerivativeType &imageJacobian, const NonZeroJacobianIndicesType &nzji, DerivativeType &derivativeF, DerivativeType &derivativeM, DerivativeType &differential) const
static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION AccumulateDerivativesThreaderCallback(void *arg)
typename AdvancedTransformType::NonZeroJacobianIndicesType NonZeroJacobianIndicesType
itkAlignedTypedef(ITK_CACHE_LINE_ALIGNMENT, PaddedCorrelationGetValueAndDerivativePerThreadStruct, AlignedCorrelationGetValueAndDerivativePerThreadStruct)
itkStaticConstMacro(MovingImageDimension, unsigned int, MovingImageType::ImageDimension)
MeasureType GetValue(const TransformParametersType &parameters) const override
void GetDerivative(const TransformParametersType &parameters, DerivativeType &derivative) const override
itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension)
itkPadStruct(ITK_CACHE_LINE_ALIGNMENT, CorrelationGetValueAndDerivativePerThreadStruct, PaddedCorrelationGetValueAndDerivativePerThreadStruct)
void ThreadedGetValueAndDerivative(ThreadIdType threadID) const override
void GetValueAndDerivativeSingleThreaded(const TransformParametersType &parameters, MeasureType &value, DerivativeType &derivative) const
void GetValueAndDerivative(const TransformParametersType &parameters, MeasureType &value, DerivativeType &derivative) const override
ITK_DISALLOW_COPY_AND_MOVE(AdvancedNormalizedCorrelationImageToImageMetric)
void AfterThreadedGetValueAndDerivative(MeasureType &value, DerivativeType &derivative) const override
std::vector< AlignedCorrelationGetValueAndDerivativePerThreadStruct > m_CorrelationGetValueAndDerivativePerThreadVariables
This class is a base class for any image sampler.
Base class for all ITK limiter function objects.


Generated on 2024-07-17 for elastix by doxygen 1.11.0 (9b424b03c9833626cd435af22a444888fbbb192d) elastix logo