ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkKappaStatisticImageToImageMetric.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 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:
55  public ImageToImageMetric< TFixedImage, TMovingImage >
56 {
57 public:
58  ITK_DISALLOW_COPY_AND_ASSIGN(KappaStatisticImageToImageMetric);
59 
65 
67  itkNewMacro(Self);
68 
71 
73  using RealType = typename Superclass::RealType;
74  using TransformType = typename Superclass::TransformType;
75  using TransformPointer = typename Superclass::TransformPointer;
76  using TransformParametersType = typename Superclass::TransformParametersType;
77  using TransformJacobianType = typename Superclass::TransformJacobianType;
78  using GradientImageType = typename Superclass::GradientImageType;
79  using GradientPixelType = typename Superclass::GradientPixelType;
80  using InputPointType = typename Superclass::InputPointType;
81  using OutputPointType = typename Superclass::OutputPointType;
82 
83  using MeasureType = typename Superclass::MeasureType;
84  using DerivativeType = typename Superclass::DerivativeType;
85  using FixedImageType = typename Superclass::FixedImageType;
86  using MovingImageType = typename Superclass::MovingImageType;
87  using FixedImageConstPointer = typename Superclass::FixedImageConstPointer;
88  using MovingImageConstPointer = typename Superclass::MovingImageConstPointer;
89  using FixedImageRegionType = typename Superclass::FixedImageRegionType;
90 
92  void ComputeGradient() override;
93 
95  void GetDerivative(const TransformParametersType &,
96  DerivativeType & derivative) const override;
97 
103  MeasureType GetValue(const TransformParametersType & parameters) const override;
104 
107  void GetValueAndDerivative(const TransformParametersType & parameters,
108  MeasureType & Value, DerivativeType & Derivative) const override;
109 
112  itkSetMacro(ForegroundValue, RealType);
113  itkGetConstMacro(ForegroundValue, RealType);
115 
120  itkSetMacro(Complement, bool);
121  itkBooleanMacro(Complement);
122  itkGetConstMacro(Complement, bool);
124 
125 protected:
127  ~KappaStatisticImageToImageMetric() override = default;
128  void PrintSelf(std::ostream & os, Indent indent) const override;
129 
130 private:
132  bool m_Complement{ false };
133 };
134 } // end namespace itk
135 
136 #ifndef ITK_MANUAL_INSTANTIATION
137 #include "itkKappaStatisticImageToImageMetric.hxx"
138 #endif
139 
140 #endif
typename FixedImageType::RegionType FixedImageRegionType
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
Computes similarity between two binary objects to be registered.
Transform points and vectors from an input space to an output space.
Definition: itkTransform.h:83
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
Computes similarity between regions of two images.
A templated class holding a n-Dimensional covariant vector.
typename MovingImageType::ConstPointer MovingImageConstPointer
Templated n-dimensional image class.
Definition: itkImage.h:75