ITK  5.0.0
Insight Segmentation and Registration 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, typename TMovingImage, typename TVirtualImage = TFixedImage,
55  typename TInternalComputationValueType = double,
56  typename TMetricTraits = DefaultImageToImageMetricTraitsv4<TFixedImage,TMovingImage,TVirtualImage,TInternalComputationValueType>
57  >
58 class ITK_TEMPLATE_EXPORT DemonsImageToImageMetricv4 :
59  public ImageToImageMetricv4<TFixedImage, TMovingImage, TVirtualImage, TInternalComputationValueType, TMetricTraits>
60 {
61 public:
62  ITK_DISALLOW_COPY_AND_ASSIGN(DemonsImageToImageMetricv4);
63 
66  using Superclass = ImageToImageMetricv4<TFixedImage, TMovingImage, TVirtualImage,
67  TInternalComputationValueType,TMetricTraits>;
70 
72  itkNewMacro(Self);
73 
76 
78  using MeasureType = typename Superclass::MeasureType;
79  using DerivativeType = typename Superclass::DerivativeType;
80 
81  using FixedImagePointType = typename Superclass::FixedImagePointType;
82  using FixedImagePixelType = typename Superclass::FixedImagePixelType;
83  using FixedImageGradientType = typename Superclass::FixedImageGradientType;
84 
85  using MovingImagePointType = typename Superclass::MovingImagePointType;
86  using MovingImagePixelType = typename Superclass::MovingImagePixelType;
87  using MovingImageGradientType = typename Superclass::MovingImageGradientType;
88 
89  using MovingTransformType = typename Superclass::MovingTransformType;
90  using JacobianType = typename Superclass::JacobianType;
91  using VirtualImageType = typename Superclass::VirtualImageType;
92  using VirtualIndexType = typename Superclass::VirtualIndexType;
93  using VirtualPointType = typename Superclass::VirtualPointType;
94  using VirtualSPointSetType = typename Superclass::VirtualPointSetType;
95  using NumberOfParametersType = typename Superclass::NumberOfParametersType;
96 
98  using InternalComputationValueType = TInternalComputationValueType;
99 
100  using ImageDimensionType = typename Superclass::ImageDimensionType;
101 
102  /* Image dimension accessors */
103  static constexpr ImageDimensionType VirtualImageDimension = TVirtualImage::ImageDimension;
104  static constexpr ImageDimensionType FixedImageDimension = TFixedImage::ImageDimension;
105  static constexpr ImageDimensionType MovingImageDimension = TMovingImage::ImageDimension;
106 
107  void Initialize() override;
108 
111  itkGetConstMacro(IntensityDifferenceThreshold, TInternalComputationValueType);
112  itkSetMacro(IntensityDifferenceThreshold, TInternalComputationValueType);
114 
116  itkGetConstMacro(DenominatorThreshold, TInternalComputationValueType);
117 
118 protected:
119  itkGetConstMacro(Normalizer, TInternalComputationValueType);
120 
122  ~DemonsImageToImageMetricv4() override = default;
123 
125  friend class DemonsImageToImageMetricv4GetValueAndDerivativeThreader< ThreadedIndexedContainerPartitioner, Superclass, Self >;
127  DemonsImageToImageMetricv4GetValueAndDerivativeThreader< ThreadedImageRegionPartitioner< Superclass::VirtualImageDimension >, Superclass, Self >;
129  DemonsImageToImageMetricv4GetValueAndDerivativeThreader< ThreadedIndexedContainerPartitioner, Superclass, Self >;
130 
131  void PrintSelf(std::ostream& os, Indent indent) const override;
132 
133 private:
134 
137  TInternalComputationValueType m_DenominatorThreshold;
138 
140  TInternalComputationValueType m_IntensityDifferenceThreshold;
141 
142  /* Used to normalize derivative calculation. Automatically calculated */
143  TInternalComputationValueType m_Normalizer;
144 
145 };
146 
147 } // end namespace itk
148 
149 #ifndef ITK_MANUAL_INSTANTIATION
150 #include "itkDemonsImageToImageMetricv4.hxx"
151 #endif
152 
153 #endif
Light weight base class for most itk classes.
typename Superclass::FixedImageGradientType FixedImageGradientType
Processes points for DemonsImageToImageMetricv4 GetValueAndDerivative.
typename Superclass::FixedImagePixelType FixedImagePixelType
Class for partitioning of an ImageRegion.
typename Superclass::MovingImageGradientType MovingImageGradientType
typename Superclass::FixedImagePointType FixedImagePointType
TInternalComputationValueType InternalComputationValueType
typename Superclass::MeasureType MeasureType
typename Superclass::JacobianType JacobianType
typename Superclass::VirtualPointType VirtualPointType
typename Superclass::ImageDimensionType ImageDimensionType
typename Superclass::MovingTransformType MovingTransformType
typename Superclass::MovingImagePixelType MovingImagePixelType
typename Superclass::VirtualIndexType VirtualIndexType
Class implementing demons metric.
typename Superclass::VirtualPointSetType VirtualSPointSetType
typename Superclass::DerivativeType DerivativeType
typename Superclass::VirtualImageType VirtualImageType
typename Superclass::MovingImagePointType MovingImagePointType