ITK  5.4.0
Insight Toolkit
itkDemonsImageToImageMetricv4.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 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_MOVE(DemonsImageToImageMetricv4);
65 
68  using Superclass =
72 
74  itkNewMacro(Self);
75 
77  itkOverrideGetNameOfClassMacro(DemonsImageToImageMetricv4);
78 
80  using typename Superclass::MeasureType;
81  using typename Superclass::DerivativeType;
82 
83  using typename Superclass::FixedImagePointType;
84  using typename Superclass::FixedImagePixelType;
85  using typename Superclass::FixedImageGradientType;
86 
87  using typename Superclass::MovingImagePointType;
88  using typename Superclass::MovingImagePixelType;
89  using typename Superclass::MovingImageGradientType;
90 
91  using typename Superclass::MovingTransformType;
92  using typename Superclass::JacobianType;
93  using VirtualImageType = typename Superclass::VirtualImageType;
94  using typename Superclass::VirtualIndexType;
95  using typename Superclass::VirtualPointType;
96  using VirtualSPointSetType = typename Superclass::VirtualPointSetType;
97  using typename Superclass::NumberOfParametersType;
98 
100  using InternalComputationValueType = TInternalComputationValueType;
101 
102  using 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);
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::ThreadedImageRegionPartitioner
Class for partitioning of an ImageRegion.
Definition: itkThreadedImageRegionPartitioner.h:45
itkDemonsImageToImageMetricv4GetValueAndDerivativeThreader.h
itk::SmartPointer< Self >
itk::DemonsImageToImageMetricv4
Class implementing demons metric.
Definition: itkDemonsImageToImageMetricv4.h:60
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itk::DemonsImageToImageMetricv4::VirtualSPointSetType
typename Superclass::VirtualPointSetType VirtualSPointSetType
Definition: itkDemonsImageToImageMetricv4.h:96
itkImageToImageMetricv4.h
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::ImageToImageMetricv4
Definition: itkImageToImageMetricv4.h:174
itk::DemonsImageToImageMetricv4GetValueAndDerivativeThreader
Processes points for DemonsImageToImageMetricv4 GetValueAndDerivative.
Definition: itkDemonsImageToImageMetricv4GetValueAndDerivativeThreader.h:33