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(UseZeroAverageDisplacementConstraint, 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::FixedImageMaskType;
81 using typename Superclass::MeasureType;
82 using typename Superclass::DerivativeType;
83 using typename Superclass::ParametersType;
86 using typename Superclass::ImageSamplerType;
96
98 itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension);
99
101 itkStaticConstMacro(MovingImageDimension, unsigned int, MovingImageType::ImageDimension);
102
104 MeasureType
105 GetValue(const TransformParametersType & parameters) const override;
106
108 void
109 GetDerivative(const TransformParametersType & parameters, DerivativeType & derivative) const override;
110
112 void
113 GetValueAndDerivative(const TransformParametersType & parameters,
114 MeasureType & Value,
115 DerivativeType & Derivative) const override;
116
121 void
122 Initialize() override;
123
124protected:
126 ~PCAMetric2() override = default;
127 void
128 PrintSelf(std::ostream & os, Indent indent) const override;
129
133 using typename Superclass::FixedImageIndexType;
136 using typename Superclass::FixedImagePointType;
138 typename itk::ContinuousIndex<CoordinateRepresentationType, FixedImageDimension>;
144
149 void
150 EvaluateTransformJacobianInnerProduct(const TransformJacobianType & jacobian,
151 const MovingImageDerivativeType & movingImageDerivative,
152 DerivativeType & imageJacobian) const override;
153
154private:
156 void
157 SampleRandom(const int n, const int m, std::vector<int> & numbers) const;
158
160 unsigned int m_NumAdditionalSamplesFixed{};
161 unsigned int m_ReducedDimensionIndex{};
162
164 bool m_UseZeroAverageDisplacementConstraint{ true };
165
167 FixedImageSizeType m_GridSize{};
168
170 bool m_TransformIsStackTransform{ false };
171};
172
173} // end namespace itk
174
175#ifndef ITK_MANUAL_INSTANTIATION
176# include "itkPCAMetric2.hxx"
177#endif
178
179#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
typename DerivativeType::ValueType DerivativeValueType
typename FixedImageIndexType::IndexValueType FixedImageIndexValueType
typename MovingImageType::IndexType MovingImageIndexType
typename ImageSamplerType::OutputVectorContainerType ImageSampleContainerType
ImageMaskSpatialObject< Self::FixedImageDimension > FixedImageMaskType
typename FixedImageType::IndexType FixedImageIndexType
SmartPointer< MovingImageMaskType > MovingImageMaskPointer
typename BSplineInterpolatorType::CovariantVectorType MovingImageDerivativeType
typename MovingImageLimiterType::OutputType MovingImageLimiterOutputType
typename TransformType::InputPointType FixedImagePointType
typename FixedImageLimiterType::OutputType FixedImageLimiterOutputType
SmartPointer< FixedImageMaskType > FixedImageMaskPointer
BSplineInterpolateImageFunction< MovingImageType, CoordinateRepresentationType, double > BSplineInterpolatorType
typename ImageSamplerType::Pointer ImageSamplerPointer
typename InterpolatorType::ContinuousIndexType MovingImageContinuousIndexType
ImageMaskSpatialObject< Self::MovingImageDimension > MovingImageMaskType
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
typename itk::ContinuousIndex< CoordinateRepresentationType, FixedImageDimension > FixedImageContinuousIndexType
itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension)
typename FixedImageRegionType::SizeType FixedImageSizeType
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)
~PCAMetric2() override=default
SmartPointer< const Self > ConstPointer
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 2024-07-17 for elastix by doxygen 1.11.0 (9b424b03c9833626cd435af22a444888fbbb192d) elastix logo