go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkPatternIntensityImageToImageMetric.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright UMC Utrecht and contributors
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 itkPatternIntensityImageToImageMetric_h
19#define itkPatternIntensityImageToImageMetric_h
20
22
23#include "itkPoint.h"
24#include "itkCastImageFilter.h"
25#include "itkResampleImageFilter.h"
26#include "itkMultiplyImageFilter.h"
27#include "itkSubtractImageFilter.h"
28#include "itkOptimizer.h"
29#include "itkRescaleIntensityImageFilter.h"
32
33namespace itk
34{
35
44template <class TFixedImage, class TMovingImage>
45class ITK_TEMPLATE_EXPORT PatternIntensityImageToImageMetric
46 : public AdvancedImageToImageMetric<TFixedImage, TMovingImage>
47{
48public:
50
54 using Pointer = SmartPointer<Self>;
55 using ConstPointer = SmartPointer<const Self>;
56
58 itkNewMacro(Self);
59
61 itkTypeMacro(PatternIntensityImageToImageMetric, ImageToImageMetric);
62
64 using typename Superclass::CoordinateRepresentationType;
65 using typename Superclass::MovingImageType;
66 using typename Superclass::MovingImagePixelType;
67 using typename Superclass::MovingImagePointer;
68 using typename Superclass::MovingImageConstPointer;
69 using typename Superclass::FixedImageType;
70 using typename Superclass::FixedImageConstPointer;
71 using typename Superclass::FixedImageRegionType;
72 using typename Superclass::TransformType;
73 using ScalarType = typename TransformType::ScalarType;
74 using typename Superclass::TransformPointer;
75 using typename Superclass::InputPointType;
76 using typename Superclass::OutputPointType;
77 using typename Superclass::TransformParametersType;
78 using typename Superclass::TransformJacobianType;
79 using typename Superclass::InterpolatorType;
80 using typename Superclass::InterpolatorPointer;
81 using typename Superclass::RealType;
82 using typename Superclass::GradientPixelType;
83 using typename Superclass::GradientImageType;
84 using typename Superclass::GradientImagePointer;
85 using typename Superclass::GradientImageFilterType;
86 using typename Superclass::GradientImageFilterPointer;
87 using typename Superclass::FixedImageMaskType;
88 using typename Superclass::FixedImageMaskPointer;
89 using typename Superclass::MovingImageMaskType;
90 using typename Superclass::MovingImageMaskPointer;
91 using typename Superclass::MeasureType;
92 using typename Superclass::DerivativeType;
93 using typename Superclass::ParametersType;
96 using typename Superclass::ImageSamplerType;
105 using ScalesType = typename Optimizer::ScalesType;
106
108 itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension);
109
110 using TransformedMovingImageType = itk::Image<FixedImagePixelType, Self::FixedImageDimension>;
112 using CombinationTransformPointer = typename CombinationTransformType::Pointer;
114 using RayCastInterpolatorPointer = typename RayCastInterpolatorType::Pointer;
115 using TransformMovingImageFilterType = itk::ResampleImageFilter<MovingImageType, TransformedMovingImageType>;
116 using TransformMovingImageFilterPointer = typename TransformMovingImageFilterType::Pointer;
118 itk::RescaleIntensityImageFilter<TransformedMovingImageType, TransformedMovingImageType>;
119 using RescaleIntensityImageFilterPointer = typename RescaleIntensityImageFilterType::Pointer;
120
122 itk::SubtractImageFilter<FixedImageType, TransformedMovingImageType, TransformedMovingImageType>;
123 using DifferenceImageFilterPointer = typename DifferenceImageFilterType::Pointer;
125 itk::MultiplyImageFilter<TransformedMovingImageType, TransformedMovingImageType, TransformedMovingImageType>;
126 using MultiplyImageFilterPointer = typename MultiplyImageFilterType::Pointer;
127
129 itkStaticConstMacro(MovingImageDimension, unsigned int, MovingImageType::ImageDimension);
130
132 MeasureType
133 GetValue(const TransformParametersType & parameters) const override;
134
136 void
137 GetDerivative(const TransformParametersType & parameters, DerivativeType & derivative) const override;
138
140 void
141 GetValueAndDerivative(const TransformParametersType & parameters,
142 MeasureType & Value,
143 DerivativeType & Derivative) const override;
144
150 void
151 Initialize() override;
152
154 itkSetMacro(Scales, ScalesType);
155 itkGetConstReferenceMacro(Scales, ScalesType);
156
158 itkSetMacro(NoiseConstant, double);
159 itkGetConstReferenceMacro(NoiseConstant, double);
160
162 itkSetMacro(OptimizeNormalizationFactor, bool);
163 itkGetConstReferenceMacro(OptimizeNormalizationFactor, bool);
164
165protected:
168 void
169 PrintSelf(std::ostream & os, Indent indent) const override;
170
172 MeasureType
174
176 MeasureType
177 ComputePIDiff(const TransformParametersType & parameters, float scalingfactor) const;
178
179private:
191 MeasureType m_FixedMeasure;
193};
194
195} // end namespace itk
196
197#ifndef ITK_MANUAL_INSTANTIATION
198# include "itkPatternIntensityImageToImageMetric.hxx"
199#endif
200
201#endif // end #ifndef itkPatternIntensityImageToImageMetric_h
This class combines two transforms: an 'initial transform' with a 'current transform'.
An extension of the ITK ImageToImageMetric. It is the intended base class for all elastix metrics.
typename ImageSamplerType::OutputVectorContainerPointer ImageSampleContainerPointer
typename MovingImageType::RegionType MovingImageRegionType
typename FixedImageType::PixelType FixedImagePixelType
typename ImageSamplerType::OutputVectorContainerType ImageSampleContainerType
typename MovingImageType::Pointer MovingImagePointer
typename MovingImageLimiterType::OutputType MovingImageLimiterOutputType
typename FixedImageLimiterType::OutputType FixedImageLimiterOutputType
typename ImageSamplerType::Pointer ImageSamplerPointer
Projective interpolation of an image at specified positions.
This class is a base class for any image sampler.
Base class for all ITK limiter function objects.
Computes similarity between two objects to be registered.
itkStaticConstMacro(MovingImageDimension, unsigned int, MovingImageType::ImageDimension)
typename MultiplyImageFilterType::Pointer MultiplyImageFilterPointer
MeasureType ComputePIDiff(const TransformParametersType &parameters, float scalingfactor) const
~PatternIntensityImageToImageMetric() override=default
typename RescaleIntensityImageFilterType::Pointer RescaleIntensityImageFilterPointer
void GetValueAndDerivative(const TransformParametersType &parameters, MeasureType &Value, DerivativeType &Derivative) const override
typename CombinationTransformType::Pointer CombinationTransformPointer
typename DifferenceImageFilterType::Pointer DifferenceImageFilterPointer
typename itk::AdvancedRayCastInterpolateImageFunction< MovingImageType, ScalarType > RayCastInterpolatorType
itk::SubtractImageFilter< FixedImageType, TransformedMovingImageType, TransformedMovingImageType > DifferenceImageFilterType
itk::ResampleImageFilter< MovingImageType, TransformedMovingImageType > TransformMovingImageFilterType
itk::RescaleIntensityImageFilter< TransformedMovingImageType, TransformedMovingImageType > RescaleIntensityImageFilterType
itk::MultiplyImageFilter< TransformedMovingImageType, TransformedMovingImageType, TransformedMovingImageType > MultiplyImageFilterType
typename TransformMovingImageFilterType::Pointer TransformMovingImageFilterPointer
MeasureType GetValue(const TransformParametersType &parameters) const override
ITK_DISALLOW_COPY_AND_MOVE(PatternIntensityImageToImageMetric)
void GetDerivative(const TransformParametersType &parameters, DerivativeType &derivative) const override
itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension)
void PrintSelf(std::ostream &os, Indent indent) const override
itk::Image< FixedImagePixelType, Self::FixedImageDimension > TransformedMovingImageType
typename itk::AdvancedCombinationTransform< ScalarType, FixedImageDimension > CombinationTransformType
typename RayCastInterpolatorType::Pointer RayCastInterpolatorPointer


Generated on 2023-01-13 for elastix by doxygen 1.9.6 elastix logo