ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkNormalizedCorrelationImageToImageMetric.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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 itkNormalizedCorrelationImageToImageMetric_h
19 #define itkNormalizedCorrelationImageToImageMetric_h
20 
21 #include "itkImageToImageMetric.h"
22 #include "itkPoint.h"
23 
24 namespace itk
25 {
45 template< typename TFixedImage, typename TMovingImage >
46 class ITK_TEMPLATE_EXPORT NormalizedCorrelationImageToImageMetric:
47  public ImageToImageMetric< TFixedImage, TMovingImage >
48 {
49 public:
50  ITK_DISALLOW_COPY_AND_ASSIGN(NormalizedCorrelationImageToImageMetric);
51 
57 
59  itkNewMacro(Self);
60 
63 
65  using RealType = typename Superclass::RealType;
66  using TransformType = typename Superclass::TransformType;
67  using TransformPointer = typename Superclass::TransformPointer;
68  using TransformParametersType = typename Superclass::TransformParametersType;
69  using TransformJacobianType = typename Superclass::TransformJacobianType;
70  using GradientPixelType = typename Superclass::GradientPixelType;
71  using OutputPointType = typename Superclass::OutputPointType;
72  using InputPointType = typename Superclass::InputPointType;
73 
74  using MeasureType = typename Superclass::MeasureType;
75  using DerivativeType = typename Superclass::DerivativeType;
76  using FixedImageType = typename Superclass::FixedImageType;
77  using MovingImageType = typename Superclass::MovingImageType;
78  using FixedImageConstPointer = typename Superclass::FixedImageConstPointer;
79  using MovingImageConstPointer = typename Superclass::MovingImageConstPointer;
80 
82  void GetDerivative(const TransformParametersType & parameters,
83  DerivativeType & Derivative) const override;
84 
86  MeasureType GetValue(const TransformParametersType & parameters) const override;
87 
89  void GetValueAndDerivative(const TransformParametersType & parameters,
90  MeasureType & Value, DerivativeType & Derivative) const override;
91 
96  itkSetMacro(SubtractMean, bool);
97  itkGetConstReferenceMacro(SubtractMean, bool);
98  itkBooleanMacro(SubtractMean);
100 
101 protected:
103  ~NormalizedCorrelationImageToImageMetric() override = default;
104  void PrintSelf(std::ostream & os, Indent indent) const override;
105 
106 private:
108 };
109 } // end namespace itk
110 
111 #ifndef ITK_MANUAL_INSTANTIATION
112 #include "itkNormalizedCorrelationImageToImageMetric.hxx"
113 #endif
114 
115 #endif
Array class with size defined at construction time.
Definition: itkArray.h:46
Light weight base class for most itk classes.
typename TransformType::InputPointType InputPointType
typename TransformType::JacobianType TransformJacobianType
Transform points and vectors from an input space to an output space.
Definition: itkTransform.h:83
Computes similarity between two images to be registered.
typename TransformType::ParametersType TransformParametersType
typename TransformType::OutputPointType OutputPointType
typename FixedImageType::ConstPointer FixedImageConstPointer
typename TransformType::Pointer TransformPointer
typename NumericTraits< MovingImagePixelType >::RealType RealType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Base class for most ITK classes.
Definition: itkObject.h:60
Computes similarity between regions of two images.
A templated class holding a n-Dimensional covariant vector.
typename MovingImageType::ConstPointer MovingImageConstPointer