ITK  6.0.0
Insight Toolkit
itkNormalizedCorrelationImageToImageMetric.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 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 : public ImageToImageMetric<TFixedImage, TMovingImage>
47 {
48 public:
49  ITK_DISALLOW_COPY_AND_MOVE(NormalizedCorrelationImageToImageMetric);
50 
56 
58  itkNewMacro(Self);
59 
61  itkOverrideGetNameOfClassMacro(NormalizedCorrelationImageToImageMetric);
62 
64  using typename Superclass::RealType;
65  using typename Superclass::TransformType;
66  using typename Superclass::TransformPointer;
67  using typename Superclass::TransformParametersType;
68  using typename Superclass::TransformJacobianType;
69  using typename Superclass::GradientPixelType;
70  using typename Superclass::OutputPointType;
71  using typename Superclass::InputPointType;
72 
73  using typename Superclass::MeasureType;
74  using typename Superclass::DerivativeType;
75  using typename Superclass::FixedImageType;
76  using typename Superclass::MovingImageType;
77  using typename Superclass::FixedImageConstPointer;
78  using typename Superclass::MovingImageConstPointer;
79 
81  void
82  GetDerivative(const TransformParametersType & parameters, DerivativeType & derivative) const override;
83 
86  GetValue(const TransformParametersType & parameters) const override;
87 
89  void
90  GetValueAndDerivative(const TransformParametersType & parameters,
91  MeasureType & value,
92  DerivativeType & derivative) const override;
93 
98  itkSetMacro(SubtractMean, bool);
99  itkGetConstReferenceMacro(SubtractMean, bool);
100  itkBooleanMacro(SubtractMean);
103 protected:
105  ~NormalizedCorrelationImageToImageMetric() override = default;
106  void
107  PrintSelf(std::ostream & os, Indent indent) const override;
108 
109 private:
110  bool m_SubtractMean{};
111 };
112 } // end namespace itk
113 
114 #ifndef ITK_MANUAL_INSTANTIATION
115 # include "itkNormalizedCorrelationImageToImageMetric.hxx"
116 #endif
117 
118 #endif
itk::ImageToImageMetric
Computes similarity between regions of two images.
Definition: itkImageToImageMetric.h:54
itk::SingleValuedCostFunction::MeasureType
double MeasureType
Definition: itkSingleValuedCostFunction.h:50
itk::ImageToImageMetric::TransformParametersType
typename TransformType::ParametersType TransformParametersType
Definition: itkImageToImageMetric.h:92
itkPoint.h
itk::NormalizedCorrelationImageToImageMetric
Computes similarity between two images to be registered.
Definition: itkNormalizedCorrelationImageToImageMetric.h:46
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itkImageToImageMetric.h
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::Array
Array class with size defined at construction time.
Definition: itkArray.h:47