go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkPCAMetric2.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 itkPCAMetric2_h
19#define itkPCAMetric2_h
20
22
23#include "itkSmoothingRecursiveGaussianImageFilter.h"
25#include "itkNearestNeighborInterpolateImageFunction.h"
26#include "itkExtractImageFilter.h"
27
28namespace itk
29{
30template <class TFixedImage, class TMovingImage>
31class ITK_TEMPLATE_EXPORT PCAMetric2 : public AdvancedImageToImageMetric<TFixedImage, TMovingImage>
32{
33public:
35
39 using Pointer = SmartPointer<Self>;
40 using ConstPointer = SmartPointer<const Self>;
41
42 using typename Superclass::FixedImageRegionType;
43 using FixedImageSizeType = typename FixedImageRegionType::SizeType;
44
46 itkNewMacro(Self);
47
50
52 itkSetMacro(NumAdditionalSamplesFixed, unsigned int);
53 itkSetMacro(ReducedDimensionIndex, unsigned int);
54 itkSetMacro(SubtractMean, bool);
55 itkSetMacro(GridSize, FixedImageSizeType);
56 itkSetMacro(TransformIsStackTransform, bool);
57
59 using typename Superclass::CoordinateRepresentationType;
60 using typename Superclass::MovingImageType;
61 using typename Superclass::MovingImagePixelType;
62 using typename Superclass::MovingImageConstPointer;
63 using typename Superclass::FixedImageType;
64 using typename Superclass::FixedImageConstPointer;
65 using typename Superclass::TransformType;
66 using typename Superclass::TransformPointer;
67 using typename Superclass::InputPointType;
68 using typename Superclass::OutputPointType;
69 using typename Superclass::TransformParametersType;
70 using typename Superclass::TransformJacobianType;
71 using typename Superclass::InterpolatorType;
72 using typename Superclass::InterpolatorPointer;
73 using typename Superclass::RealType;
74 using typename Superclass::GradientPixelType;
75 using typename Superclass::GradientImageType;
76 using typename Superclass::GradientImagePointer;
77 using typename Superclass::GradientImageFilterType;
78 using typename Superclass::GradientImageFilterPointer;
79 using typename Superclass::FixedImageMaskType;
80 using typename Superclass::FixedImageMaskPointer;
81 using typename Superclass::MovingImageMaskType;
82 using typename Superclass::MovingImageMaskPointer;
83 using typename Superclass::MeasureType;
84 using typename Superclass::DerivativeType;
85 using typename Superclass::ParametersType;
88 using typename Superclass::ImageSamplerType;
97
99 itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension);
100
102 itkStaticConstMacro(MovingImageDimension, unsigned int, MovingImageType::ImageDimension);
103
105 MeasureType
106 GetValue(const TransformParametersType & parameters) const override;
107
109 void
110 GetDerivative(const TransformParametersType & parameters, DerivativeType & derivative) const override;
111
113 void
114 GetValueAndDerivative(const TransformParametersType & parameters,
115 MeasureType & Value,
116 DerivativeType & Derivative) const override;
117
122 void
123 Initialize() override;
124
125protected:
127 ~PCAMetric2() override = default;
128 void
129 PrintSelf(std::ostream & os, Indent indent) const override;
130
134 using typename Superclass::FixedImageIndexType;
137 using typename Superclass::FixedImagePointType;
139 typename itk::ContinuousIndex<CoordinateRepresentationType, FixedImageDimension>;
146
151 void
152 EvaluateTransformJacobianInnerProduct(const TransformJacobianType & jacobian,
153 const MovingImageDerivativeType & movingImageDerivative,
154 DerivativeType & imageJacobian) const override;
155
156private:
158 void
159 SampleRandom(const int n, const int m, std::vector<int> & numbers) const;
160
164
166 bool m_SubtractMean{ false };
167
170
172 bool m_TransformIsStackTransform{ false };
173};
174
175} // end namespace itk
176
177#ifndef ITK_MANUAL_INSTANTIATION
178# include "itkPCAMetric2.hxx"
179#endif
180
181#endif // end #ifndef itkPCAMetric2_h
An extension of the ITK ImageToImageMetric. It is the intended base class for all elastix metrics.
typename TransformType::OutputPointType MovingImagePointType
typename ImageSamplerType::OutputVectorContainerPointer ImageSampleContainerPointer
typename MovingImageType::RegionType MovingImageRegionType
typename AdvancedTransformType::NonZeroJacobianIndicesType NonZeroJacobianIndicesType
typename FixedImageType::PixelType FixedImagePixelType
GradientImageFilter< MovingImageType, RealType, RealType > CentralDifferenceGradientFilterType
typename FixedImageIndexType::IndexValueType FixedImageIndexValueType
typename MovingImageType::IndexType MovingImageIndexType
typename ImageSamplerType::OutputVectorContainerType ImageSampleContainerType
BSplineInterpolateImageFunction< MovingImageType, CoordinateRepresentationType, double > BSplineInterpolatorType
typename FixedImageType::IndexType FixedImageIndexType
typename BSplineInterpolatorType::CovariantVectorType MovingImageDerivativeType
typename MovingImageLimiterType::OutputType MovingImageLimiterOutputType
typename TransformType::InputPointType FixedImagePointType
typename FixedImageLimiterType::OutputType FixedImageLimiterOutputType
typename ImageSamplerType::Pointer ImageSamplerPointer
typename InterpolatorType::ContinuousIndexType MovingImageContinuousIndexType
This class is a base class for any image sampler.
Base class for all ITK limiter function objects.
MeasureType GetValue(const TransformParametersType &parameters) const override
itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension)
FixedImageSizeType m_GridSize
typename FixedImageRegionType::SizeType FixedImageSizeType
Definition: itkPCAMetric2.h:43
unsigned int m_NumAdditionalSamplesFixed
void PrintSelf(std::ostream &os, Indent indent) const override
void GetValueAndDerivative(const TransformParametersType &parameters, MeasureType &Value, DerivativeType &Derivative) const override
void SampleRandom(const int n, const int m, std::vector< int > &numbers) const
itkStaticConstMacro(MovingImageDimension, unsigned int, MovingImageType::ImageDimension)
typename itk::ContinuousIndex< CoordinateRepresentationType, FixedImageDimension > FixedImageContinuousIndexType
unsigned int m_ReducedDimensionIndex
~PCAMetric2() override=default
SmartPointer< const Self > ConstPointer
Definition: itkPCAMetric2.h:40
typename BSplineInterpolatorType::CovariantVectorType MovingImageDerivativeType
ITK_DISALLOW_COPY_AND_MOVE(PCAMetric2)
void GetDerivative(const TransformParametersType &parameters, DerivativeType &derivative) const override
void Initialize() override
void EvaluateTransformJacobianInnerProduct(const TransformJacobianType &jacobian, const MovingImageDerivativeType &movingImageDerivative, DerivativeType &imageJacobian) const override


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