ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkHistogramImageToImageMetric.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 itkHistogramImageToImageMetric_h
19#define itkHistogramImageToImageMetric_h
20
21#include "itkHistogram.h"
23
24namespace itk
25{
38template <typename TFixedImage, typename TMovingImage>
39class ITK_TEMPLATE_EXPORT HistogramImageToImageMetric : public ImageToImageMetric<TFixedImage, TMovingImage>
40{
41public:
42 ITK_DISALLOW_COPY_AND_MOVE(HistogramImageToImageMetric);
43
49
51 itkOverrideGetNameOfClassMacro(HistogramImageToImageMetric);
52
54 using typename Superclass::RealType;
55 using typename Superclass::TransformType;
56 using typename Superclass::TransformPointer;
59 using typename Superclass::GradientPixelType;
60 using typename Superclass::InputPointType;
61 using typename Superclass::OutputPointType;
62 using typename Superclass::MeasureType;
63 using typename Superclass::DerivativeType;
64 using typename Superclass::FixedImageType;
65 using FixedImagePixelType = typename Superclass::FixedImageType::PixelType;
66 using typename Superclass::MovingImageType;
67 using MovingImagePixelType = typename Superclass::MovingImageType::PixelType;
70
75
79
81 void
82 Initialize() override;
83
86 void
87 SetTransform(TransformType * transform) override;
91 itkSetMacro(HistogramSize, HistogramSizeType);
92
94 itkGetConstReferenceMacro(HistogramSize, HistogramSizeType);
95
98 itkSetMacro(UpperBoundIncreaseFactor, double);
99 itkGetConstMacro(UpperBoundIncreaseFactor, double);
101
103 itkSetMacro(PaddingValue, FixedImagePixelType);
104
106 itkGetConstReferenceMacro(PaddingValue, FixedImagePixelType);
107
111 itkGetConstReferenceMacro(Histogram, HistogramPointer);
112
116 itkSetMacro(UsePaddingValue, bool);
117 itkGetConstMacro(UsePaddingValue, bool);
119
121 itkSetMacro(DerivativeStepLength, double);
122
124 itkGetConstMacro(DerivativeStepLength, double);
125
128
130 itkSetMacro(DerivativeStepLengthScales, ScalesType);
131
133 itkGetConstReferenceMacro(DerivativeStepLengthScales, ScalesType);
134
137 GetValue(const TransformParametersType & parameters) const override;
138
140 void
141 GetDerivative(const TransformParametersType & parameters, DerivativeType & derivative) const override;
142
144 void
146 MeasureType & value,
147 DerivativeType & derivative) const override;
148
152 void
154
158
162 void
164
168
169protected:
173 ~HistogramImageToImageMetric() override = default;
175
178
181
184
187
191
195
198 void
199 ComputeHistogram(const TransformParametersType & parameters, HistogramType & histogram) const;
200
203 void
205 unsigned int parameter,
206 double step,
207 HistogramType & histogram) const;
208
210 void
211 CopyHistogram(HistogramType & target, HistogramType & source) const;
212
215 virtual MeasureType
216 EvaluateMeasure(HistogramType & histogram) const = 0;
217
219 void
220 PrintSelf(std::ostream & os, Indent indent) const override;
221
222private:
225
230
233
236
240};
241} // end namespace itk
242
243#ifndef ITK_MANUAL_INSTANTIATION
244# include "itkHistogramImageToImageMetric.hxx"
245#endif
246
247#endif // itkHistogramImageToImageMetric_h
Array class with size defined at construction time.
Definition itkArray.h:48
void SetTransform(TransformType *transform) override
void ComputeHistogram(const TransformParametersType &parameters, unsigned int parameter, double step, HistogramType &histogram) const
const MeasurementVectorType & GetLowerBound() const
typename Superclass::MovingImageConstPointer MovingImageConstPointerType
const MeasurementVectorType & GetUpperBound() const
typename HistogramType::SizeType HistogramSizeType
typename TransformType::ParametersType TransformParametersType
void SetLowerBound(const MeasurementVectorType &bounds)
void GetValueAndDerivative(const TransformParametersType &parameters, MeasureType &value, DerivativeType &derivative) const override
void ComputeHistogram(const TransformParametersType &parameters, HistogramType &histogram) const
ImageToImageMetric< TFixedImage, TMovingImage > Superclass
~HistogramImageToImageMetric() override=default
virtual MeasureType EvaluateMeasure(HistogramType &histogram) const =0
void SetUpperBound(const MeasurementVectorType &bounds)
typename Superclass::MovingImageType::PixelType MovingImagePixelType
typename Superclass::FixedImageConstPointer FixedImageConstPointerType
typename Superclass::FixedImageType::PixelType FixedImagePixelType
Statistics::Histogram< double > HistogramType
Transform< CoordinateRepresentationType, Self::MovingImageDimension, Self::FixedImageDimension > TransformType
typename HistogramType::Pointer HistogramPointer
void CopyHistogram(HistogramType &target, HistogramType &source) const
MeasureType GetValue(const TransformParametersType &parameters) const override
void GetDerivative(const TransformParametersType &parameters, DerivativeType &derivative) const override
typename HistogramType::MeasurementVectorType MeasurementVectorType
void PrintSelf(std::ostream &os, Indent indent) const override
typename FixedImageType::ConstPointer FixedImageConstPointer
typename NumericTraits< MovingImagePixelType >::RealType RealType
typename TransformType::Pointer TransformPointer
Array< ParametersValueType > DerivativeType
typename MovingImageType::ConstPointer MovingImageConstPointer
typename TransformType::ParametersType TransformParametersType
CovariantVector< RealType, Self::MovingImageDimension > GradientPixelType
Transform< CoordinateRepresentationType, Self::MovingImageDimension, Self::FixedImageDimension > TransformType
typename TransformType::OutputPointType OutputPointType
typename TransformType::JacobianType TransformJacobianType
typename TransformType::InputPointType InputPointType
Control indentation during Print() invocation.
Definition itkIndent.h:50
Implements transparent reference counting.
This class stores measurement vectors in the context of n-dimensional histogram.
Array< itk::SizeValueType > SizeType
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....