ITK  6.0.0
Insight Toolkit
itkCorrelationImageToImageMetricv4.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 itkCorrelationImageToImageMetricv4_h
19#define itkCorrelationImageToImageMetricv4_h
20
22
25
26namespace itk
27{
28
72template <typename TFixedImage,
73 typename TMovingImage,
74 typename TVirtualImage = TFixedImage,
75 typename TInternalComputationValueType = double,
76 typename TMetricTraits =
77 DefaultImageToImageMetricTraitsv4<TFixedImage, TMovingImage, TVirtualImage, TInternalComputationValueType>>
78class ITK_TEMPLATE_EXPORT CorrelationImageToImageMetricv4
79 : public ImageToImageMetricv4<TFixedImage, TMovingImage, TVirtualImage, TInternalComputationValueType, TMetricTraits>
80{
81public:
82 ITK_DISALLOW_COPY_AND_MOVE(CorrelationImageToImageMetricv4);
83
86 using Superclass =
90
92 itkNewMacro(Self);
93
95 itkOverrideGetNameOfClassMacro(CorrelationImageToImageMetricv4);
96
98 using typename Superclass::MeasureType;
99 using typename Superclass::DerivativeType;
100
101 using typename Superclass::FixedImagePointType;
102 using typename Superclass::FixedImagePixelType;
103 using typename Superclass::FixedImageGradientType;
104
105 using typename Superclass::MovingImagePointType;
106 using typename Superclass::MovingImagePixelType;
107 using typename Superclass::MovingImageGradientType;
108
109 using typename Superclass::MovingTransformType;
110 using typename Superclass::JacobianType;
111 using VirtualImageType = typename Superclass::VirtualImageType;
112 using typename Superclass::VirtualIndexType;
113 using typename Superclass::VirtualPointType;
114 using typename Superclass::VirtualPointSetType;
115
116 /* Image dimension accessors */
117 static constexpr typename TVirtualImage::ImageDimensionType VirtualImageDimension = TVirtualImage::ImageDimension;
118 static constexpr typename TFixedImage::ImageDimensionType FixedImageDimension = TFixedImage::ImageDimension;
119 static constexpr typename TMovingImage::ImageDimensionType MovingImageDimension = TMovingImage::ImageDimension;
120
121protected:
124
129 void
130 InitializeForIteration() const override;
131
133 ThreadedImageRegionPartitioner<Superclass::VirtualImageDimension>,
134 Self>;
135 friend class ImageToImageMetricv4GetValueAndDerivativeThreaderBase<ThreadedIndexedContainerPartitioner, Self>;
137 ThreadedImageRegionPartitioner<Superclass::VirtualImageDimension>,
138 Self>;
139 friend class ImageToImageMetricv4GetValueAndDerivativeThreader<ThreadedIndexedContainerPartitioner, Self>;
140
142 ThreadedImageRegionPartitioner<Superclass::VirtualImageDimension>,
143 Superclass,
144 Self>;
145 friend class CorrelationImageToImageMetricv4GetValueAndDerivativeThreader<ThreadedIndexedContainerPartitioner,
146 Superclass,
147 Self>;
150 ThreadedImageRegionPartitioner<Superclass::VirtualImageDimension>,
151 Superclass,
152 Self>;
154 CorrelationImageToImageMetricv4GetValueAndDerivativeThreader<ThreadedIndexedContainerPartitioner, Superclass, Self>;
155
157 ThreadedImageRegionPartitioner<Superclass::VirtualImageDimension>,
158 Superclass,
159 Self>;
160 friend class CorrelationImageToImageMetricv4HelperThreader<ThreadedIndexedContainerPartitioner, Superclass, Self>;
161
163 CorrelationImageToImageMetricv4HelperThreader<ThreadedImageRegionPartitioner<Superclass::VirtualImageDimension>,
164 Superclass,
165 Self>;
167 CorrelationImageToImageMetricv4HelperThreader<ThreadedIndexedContainerPartitioner, Superclass, Self>;
168
169 typename CorrelationHelperDenseThreaderType::Pointer m_HelperDenseThreader{};
170 typename CorrelationHelperSparseThreaderType::Pointer m_HelperSparseThreader{};
171
172 /* These values are computed during InitializeForIteration(),
173 * using the helper class
174 * */
175 mutable MeasureType m_AverageFix{};
176 mutable MeasureType m_AverageMov{};
177
178 void
179 PrintSelf(std::ostream & os, Indent indent) const override;
180};
181
182} // end namespace itk
183
184#ifndef ITK_MANUAL_INSTANTIATION
185# include "itkCorrelationImageToImageMetricv4.hxx"
186#endif
187
188#endif
Class implementing normalized cross correlation image metric.
~CorrelationImageToImageMetricv4() override=default
typename Superclass::VirtualImageType VirtualImageType
void PrintSelf(std::ostream &os, Indent indent) const override
Provides threading for ImageToImageMetricv4::GetValueAndDerivative.
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Light weight base class for most itk classes.
Class for partitioning of an ImageRegion.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....