ITK  5.2.0
Insight Toolkit
itkKappaStatisticImageToImageMetric.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 itkKappaStatisticImageToImageMetric_h
19 #define itkKappaStatisticImageToImageMetric_h
20 
21 #include "itkImageToImageMetric.h"
22 
23 namespace itk
24 {
53 template <typename TFixedImage, typename TMovingImage>
54 class ITK_TEMPLATE_EXPORT KappaStatisticImageToImageMetric : public ImageToImageMetric<TFixedImage, TMovingImage>
55 {
56 public:
57  ITK_DISALLOW_COPY_AND_MOVE(KappaStatisticImageToImageMetric);
58 
64 
66  itkNewMacro(Self);
67 
70 
72  using RealType = typename Superclass::RealType;
73  using TransformType = typename Superclass::TransformType;
74  using TransformPointer = typename Superclass::TransformPointer;
75  using TransformParametersType = typename Superclass::TransformParametersType;
76  using TransformJacobianType = typename Superclass::TransformJacobianType;
77  using GradientImageType = typename Superclass::GradientImageType;
78  using GradientPixelType = typename Superclass::GradientPixelType;
79  using InputPointType = typename Superclass::InputPointType;
80  using OutputPointType = typename Superclass::OutputPointType;
81 
82  using MeasureType = typename Superclass::MeasureType;
83  using DerivativeType = typename Superclass::DerivativeType;
84  using FixedImageType = typename Superclass::FixedImageType;
85  using MovingImageType = typename Superclass::MovingImageType;
86  using FixedImageConstPointer = typename Superclass::FixedImageConstPointer;
87  using MovingImageConstPointer = typename Superclass::MovingImageConstPointer;
88  using FixedImageRegionType = typename Superclass::FixedImageRegionType;
89 
91  void
92  ComputeGradient() override;
93 
95  void
96  GetDerivative(const TransformParametersType &, DerivativeType & derivative) const override;
97 
104  GetValue(const TransformParametersType & parameters) const override;
105 
108  void
109  GetValueAndDerivative(const TransformParametersType & parameters,
110  MeasureType & Value,
111  DerivativeType & Derivative) const override;
112 
115  itkSetMacro(ForegroundValue, RealType);
116  itkGetConstMacro(ForegroundValue, RealType);
118 
123  itkSetMacro(Complement, bool);
124  itkBooleanMacro(Complement);
125  itkGetConstMacro(Complement, bool);
127 
128 protected:
130  ~KappaStatisticImageToImageMetric() override = default;
131  void
132  PrintSelf(std::ostream & os, Indent indent) const override;
133 
134 private:
136  bool m_Complement{ false };
137 };
138 } // end namespace itk
139 
140 #ifndef ITK_MANUAL_INSTANTIATION
141 # include "itkKappaStatisticImageToImageMetric.hxx"
142 #endif
143 
144 #endif
itk::ImageToImageMetric::FixedImageConstPointer
typename FixedImageType::ConstPointer FixedImageConstPointer
Definition: itkImageToImageMetric.h:77
itk::ImageToImageMetric
Computes similarity between regions of two images.
Definition: itkImageToImageMetric.h:52
itk::SingleValuedCostFunction::MeasureType
double MeasureType
Definition: itkSingleValuedCostFunction.h:50
itk::ImageToImageMetric::TransformParametersType
typename TransformType::ParametersType TransformParametersType
Definition: itkImageToImageMetric.h:90
itk::ImageToImageMetric::RealType
typename NumericTraits< MovingImagePixelType >::RealType RealType
Definition: itkImageToImageMetric.h:106
itk::ImageToImageMetric::TransformJacobianType
typename TransformType::JacobianType TransformJacobianType
Definition: itkImageToImageMetric.h:91
itk::ImageToImageMetric::FixedImageType
TFixedImage FixedImageType
Definition: itkImageToImageMetric.h:75
itk::ImageToImageMetric::OutputPointType
typename TransformType::OutputPointType OutputPointType
Definition: itkImageToImageMetric.h:89
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::ImageToImageMetric::InputPointType
typename TransformType::InputPointType InputPointType
Definition: itkImageToImageMetric.h:88
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itkImageToImageMetric.h
itk::ImageToImageMetric::MovingImageConstPointer
typename MovingImageType::ConstPointer MovingImageConstPointer
Definition: itkImageToImageMetric.h:72
itk::KappaStatisticImageToImageMetric
Computes similarity between two binary objects to be registered.
Definition: itkKappaStatisticImageToImageMetric.h:54
itk::CovariantVector
A templated class holding a n-Dimensional covariant vector.
Definition: itkCovariantVector.h:70
itk::ImageToImageMetric::TransformPointer
typename TransformType::Pointer TransformPointer
Definition: itkImageToImageMetric.h:87
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::ImageToImageMetric::MovingImageType
TMovingImage MovingImageType
Definition: itkImageToImageMetric.h:70
itk::KappaStatisticImageToImageMetric::m_ForegroundValue
RealType m_ForegroundValue
Definition: itkKappaStatisticImageToImageMetric.h:135
itk::Array
Array class with size defined at construction time.
Definition: itkArray.h:47
itk::Image
Templated n-dimensional image class.
Definition: itkImage.h:86
itk::Transform
Transform points and vectors from an input space to an output space.
Definition: itkTransform.h:82
itk::ImageToImageMetric::FixedImageRegionType
typename FixedImageType::RegionType FixedImageRegionType
Definition: itkImageToImageMetric.h:78