ITK  5.2.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  * 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 itkCorrelationImageToImageMetricv4_h
19 #define itkCorrelationImageToImageMetricv4_h
20 
22 
25 
26 namespace itk
27 {
28 
72 template <typename TFixedImage,
73  typename TMovingImage,
74  typename TVirtualImage = TFixedImage,
75  typename TInternalComputationValueType = double,
76  typename TMetricTraits =
77  DefaultImageToImageMetricTraitsv4<TFixedImage, TMovingImage, TVirtualImage, TInternalComputationValueType>>
78 class ITK_TEMPLATE_EXPORT CorrelationImageToImageMetricv4
79  : public ImageToImageMetricv4<TFixedImage, TMovingImage, TVirtualImage, TInternalComputationValueType, TMetricTraits>
80 {
81 public:
82  ITK_DISALLOW_COPY_AND_ASSIGN(CorrelationImageToImageMetricv4);
83 
86  using Superclass =
90 
92  itkNewMacro(Self);
93 
96 
99  using DerivativeType = typename Superclass::DerivativeType;
100 
101  using FixedImagePointType = typename Superclass::FixedImagePointType;
102  using FixedImagePixelType = typename Superclass::FixedImagePixelType;
103  using FixedImageGradientType = typename Superclass::FixedImageGradientType;
104 
105  using MovingImagePointType = typename Superclass::MovingImagePointType;
106  using MovingImagePixelType = typename Superclass::MovingImagePixelType;
107  using MovingImageGradientType = typename Superclass::MovingImageGradientType;
108 
109  using MovingTransformType = typename Superclass::MovingTransformType;
110  using JacobianType = typename Superclass::JacobianType;
111  using VirtualImageType = typename Superclass::VirtualImageType;
112  using VirtualIndexType = typename Superclass::VirtualIndexType;
113  using VirtualPointType = typename Superclass::VirtualPointType;
114  using VirtualPointSetType = 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 
121 protected:
123  ~CorrelationImageToImageMetricv4() override = default;
124 
129  void
130  InitializeForIteration() const override;
131 
133  ThreadedImageRegionPartitioner<Superclass::VirtualImageDimension>,
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
itk::ImageToImageMetricv4::MeasureType
typename Superclass::MeasureType MeasureType
Definition: itkImageToImageMetricv4.h:352
itkCorrelationImageToImageMetricv4HelperThreader.h
itk::ImageToImageMetricv4GetValueAndDerivativeThreaderBase
Provides threading for ImageToImageMetricv4::GetValueAndDerivative.
Definition: itkImageToImageMetricv4GetValueAndDerivativeThreaderBase.h:44
itk::ImageToImageMetricv4GetValueAndDerivativeThreader
Provides threading for ImageToImageMetricv4::GetValueAndDerivative.
Definition: itkImageToImageMetricv4GetValueAndDerivativeThreader.h:44
itk::CorrelationImageToImageMetricv4::MovingImageGradientType
typename Superclass::MovingImageGradientType MovingImageGradientType
Definition: itkCorrelationImageToImageMetricv4.h:107
itk::CorrelationImageToImageMetricv4HelperThreader
Definition: itkCorrelationImageToImageMetricv4HelperThreader.h:36
itk::ThreadedImageRegionPartitioner
Class for partitioning of an ImageRegion.
Definition: itkThreadedImageRegionPartitioner.h:45
itk::CorrelationImageToImageMetricv4::VirtualPointSetType
typename Superclass::VirtualPointSetType VirtualPointSetType
Definition: itkCorrelationImageToImageMetricv4.h:114
itk::CorrelationImageToImageMetricv4GetValueAndDerivativeThreader
Processes points for CorrelationImageToImageMetricv4 GetValueAndDerivative.
Definition: itkCorrelationImageToImageMetricv4GetValueAndDerivativeThreader.h:33
itk::CorrelationImageToImageMetricv4
Class implementing normalized cross correlation image metric.
Definition: itkCorrelationImageToImageMetricv4.h:78
itk::SmartPointer< Self >
itkCorrelationImageToImageMetricv4GetValueAndDerivativeThreader.h
itk::CorrelationImageToImageMetricv4::VirtualImageType
typename Superclass::VirtualImageType VirtualImageType
Definition: itkCorrelationImageToImageMetricv4.h:111
itk::CorrelationImageToImageMetricv4::FixedImagePointType
typename Superclass::FixedImagePointType FixedImagePointType
Definition: itkCorrelationImageToImageMetricv4.h:101
itk::CorrelationImageToImageMetricv4::MovingImagePixelType
typename Superclass::MovingImagePixelType MovingImagePixelType
Definition: itkCorrelationImageToImageMetricv4.h:106
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::CorrelationImageToImageMetricv4::JacobianType
typename Superclass::JacobianType JacobianType
Definition: itkCorrelationImageToImageMetricv4.h:110
itkImageToImageMetricv4.h
itk::CorrelationImageToImageMetricv4::VirtualIndexType
typename Superclass::VirtualIndexType VirtualIndexType
Definition: itkCorrelationImageToImageMetricv4.h:112
itk::CorrelationImageToImageMetricv4::FixedImageGradientType
typename Superclass::FixedImageGradientType FixedImageGradientType
Definition: itkCorrelationImageToImageMetricv4.h:103
itk::CorrelationImageToImageMetricv4::VirtualPointType
typename Superclass::VirtualPointType VirtualPointType
Definition: itkCorrelationImageToImageMetricv4.h:113
itk::CorrelationImageToImageMetricv4::MovingTransformType
typename Superclass::MovingTransformType MovingTransformType
Definition: itkCorrelationImageToImageMetricv4.h:109
itk::ObjectToObjectMetricBaseTemplate::MeasureType
typename Superclass::MeasureType MeasureType
Definition: itkObjectToObjectMetricBase.h:109
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::ImageToImageMetricv4
Definition: itkImageToImageMetricv4.h:174
itk::CorrelationImageToImageMetricv4::FixedImagePixelType
typename Superclass::FixedImagePixelType FixedImagePixelType
Definition: itkCorrelationImageToImageMetricv4.h:102
itk::CorrelationImageToImageMetricv4::MovingImagePointType
typename Superclass::MovingImagePointType MovingImagePointType
Definition: itkCorrelationImageToImageMetricv4.h:105
itk::ObjectToObjectMetricBaseTemplate::DerivativeType
typename Superclass::DerivativeType DerivativeType
Definition: itkObjectToObjectMetricBase.h:112