ITK  5.1.0
Insight Toolkit
itkDemonsImageToImageMetricv4.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 itkDemonsImageToImageMetricv4_h
19 #define itkDemonsImageToImageMetricv4_h
20 
22 
24 
25 namespace itk
26 {
27 
54 template <typename TFixedImage,
55  typename TMovingImage,
56  typename TVirtualImage = TFixedImage,
57  typename TInternalComputationValueType = double,
58  typename TMetricTraits =
59  DefaultImageToImageMetricTraitsv4<TFixedImage, TMovingImage, TVirtualImage, TInternalComputationValueType>>
60 class ITK_TEMPLATE_EXPORT DemonsImageToImageMetricv4
61  : public ImageToImageMetricv4<TFixedImage, TMovingImage, TVirtualImage, TInternalComputationValueType, TMetricTraits>
62 {
63 public:
64  ITK_DISALLOW_COPY_AND_ASSIGN(DemonsImageToImageMetricv4);
65 
68  using Superclass =
72 
74  itkNewMacro(Self);
75 
78 
80  using MeasureType = typename Superclass::MeasureType;
81  using DerivativeType = typename Superclass::DerivativeType;
82 
83  using FixedImagePointType = typename Superclass::FixedImagePointType;
84  using FixedImagePixelType = typename Superclass::FixedImagePixelType;
85  using FixedImageGradientType = typename Superclass::FixedImageGradientType;
86 
87  using MovingImagePointType = typename Superclass::MovingImagePointType;
88  using MovingImagePixelType = typename Superclass::MovingImagePixelType;
89  using MovingImageGradientType = typename Superclass::MovingImageGradientType;
90 
91  using MovingTransformType = typename Superclass::MovingTransformType;
92  using JacobianType = typename Superclass::JacobianType;
93  using VirtualImageType = typename Superclass::VirtualImageType;
94  using VirtualIndexType = typename Superclass::VirtualIndexType;
95  using VirtualPointType = typename Superclass::VirtualPointType;
96  using VirtualSPointSetType = typename Superclass::VirtualPointSetType;
97  using NumberOfParametersType = typename Superclass::NumberOfParametersType;
98 
100  using InternalComputationValueType = TInternalComputationValueType;
101 
102  using ImageDimensionType = typename Superclass::ImageDimensionType;
103 
104  /* Image dimension accessors */
105  static constexpr ImageDimensionType VirtualImageDimension = TVirtualImage::ImageDimension;
106  static constexpr ImageDimensionType FixedImageDimension = TFixedImage::ImageDimension;
107  static constexpr ImageDimensionType MovingImageDimension = TMovingImage::ImageDimension;
108 
109  void
110  Initialize() override;
111 
114  itkGetConstMacro(IntensityDifferenceThreshold, TInternalComputationValueType);
115  itkSetMacro(IntensityDifferenceThreshold, TInternalComputationValueType);
117 
119  itkGetConstMacro(DenominatorThreshold, TInternalComputationValueType);
120 
121 protected:
122  itkGetConstMacro(Normalizer, TInternalComputationValueType);
123 
125  ~DemonsImageToImageMetricv4() override = default;
126 
128  ThreadedImageRegionPartitioner<Superclass::VirtualImageDimension>,
129  Superclass,
131  friend class DemonsImageToImageMetricv4GetValueAndDerivativeThreader<ThreadedIndexedContainerPartitioner,
132  Superclass,
133  Self>;
135  ThreadedImageRegionPartitioner<Superclass::VirtualImageDimension>,
136  Superclass,
137  Self>;
139  DemonsImageToImageMetricv4GetValueAndDerivativeThreader<ThreadedIndexedContainerPartitioner, Superclass, Self>;
140 
141  void
142  PrintSelf(std::ostream & os, Indent indent) const override;
143 
144 private:
147  TInternalComputationValueType m_DenominatorThreshold;
148 
150  TInternalComputationValueType m_IntensityDifferenceThreshold;
151 
152  /* Used to normalize derivative calculation. Automatically calculated */
153  TInternalComputationValueType m_Normalizer;
154 };
155 
156 } // end namespace itk
157 
158 #ifndef ITK_MANUAL_INSTANTIATION
159 # include "itkDemonsImageToImageMetricv4.hxx"
160 #endif
161 
162 #endif
itk::DemonsImageToImageMetricv4::InternalComputationValueType
TInternalComputationValueType InternalComputationValueType
Definition: itkDemonsImageToImageMetricv4.h:100
itk::DemonsImageToImageMetricv4::VirtualImageType
typename Superclass::VirtualImageType VirtualImageType
Definition: itkDemonsImageToImageMetricv4.h:93
itk::DemonsImageToImageMetricv4::JacobianType
typename Superclass::JacobianType JacobianType
Definition: itkDemonsImageToImageMetricv4.h:92
itk::ObjectToObjectMetricBaseTemplate::NumberOfParametersType
unsigned int NumberOfParametersType
Definition: itkObjectToObjectMetricBase.h:160
itk::ThreadedImageRegionPartitioner
Class for partitioning of an ImageRegion.
Definition: itkThreadedImageRegionPartitioner.h:45
itk::DemonsImageToImageMetricv4::MovingTransformType
typename Superclass::MovingTransformType MovingTransformType
Definition: itkDemonsImageToImageMetricv4.h:91
itkDemonsImageToImageMetricv4GetValueAndDerivativeThreader.h
itk::SmartPointer< Self >
itk::DemonsImageToImageMetricv4
Class implementing demons metric.
Definition: itkDemonsImageToImageMetricv4.h:60
itk::DemonsImageToImageMetricv4::FixedImageGradientType
typename Superclass::FixedImageGradientType FixedImageGradientType
Definition: itkDemonsImageToImageMetricv4.h:85
itk::DemonsImageToImageMetricv4::MovingImagePixelType
typename Superclass::MovingImagePixelType MovingImagePixelType
Definition: itkDemonsImageToImageMetricv4.h:88
itk::DemonsImageToImageMetricv4::VirtualIndexType
typename Superclass::VirtualIndexType VirtualIndexType
Definition: itkDemonsImageToImageMetricv4.h:94
itk::DemonsImageToImageMetricv4::FixedImagePixelType
typename Superclass::FixedImagePixelType FixedImagePixelType
Definition: itkDemonsImageToImageMetricv4.h:84
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::DemonsImageToImageMetricv4::VirtualSPointSetType
typename Superclass::VirtualPointSetType VirtualSPointSetType
Definition: itkDemonsImageToImageMetricv4.h:96
itkImageToImageMetricv4.h
itk::DemonsImageToImageMetricv4::MovingImageGradientType
typename Superclass::MovingImageGradientType MovingImageGradientType
Definition: itkDemonsImageToImageMetricv4.h:89
itk::DemonsImageToImageMetricv4::MovingImagePointType
typename Superclass::MovingImagePointType MovingImagePointType
Definition: itkDemonsImageToImageMetricv4.h:87
itk::DemonsImageToImageMetricv4::ImageDimensionType
typename Superclass::ImageDimensionType ImageDimensionType
Definition: itkDemonsImageToImageMetricv4.h:102
itk::DemonsImageToImageMetricv4::VirtualPointType
typename Superclass::VirtualPointType VirtualPointType
Definition: itkDemonsImageToImageMetricv4.h:95
itk::ObjectToObjectMetricBaseTemplate::MeasureType
typename Superclass::MeasureType MeasureType
Definition: itkObjectToObjectMetricBase.h:93
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkArray.h:26
itk::ImageToImageMetricv4
Definition: itkImageToImageMetricv4.h:174
itk::DemonsImageToImageMetricv4GetValueAndDerivativeThreader
Processes points for DemonsImageToImageMetricv4 GetValueAndDerivative.
Definition: itkDemonsImageToImageMetricv4GetValueAndDerivativeThreader.h:33
itk::DemonsImageToImageMetricv4::FixedImagePointType
typename Superclass::FixedImagePointType FixedImagePointType
Definition: itkDemonsImageToImageMetricv4.h:83
itk::ObjectToObjectMetricBaseTemplate::DerivativeType
typename Superclass::DerivativeType DerivativeType
Definition: itkObjectToObjectMetricBase.h:96