go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkVarianceOverLastDimensionImageMetric.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
19#ifndef itkVarianceOverLastDimensionImageMetric_h
20#define itkVarianceOverLastDimensionImageMetric_h
21
22#include "itkSmoothingRecursiveGaussianImageFilter.h"
24#include "itkNearestNeighborInterpolateImageFunction.h"
26
27namespace itk
28{
29
51template <class TFixedImage, class TMovingImage>
52class ITK_TEMPLATE_EXPORT VarianceOverLastDimensionImageMetric
53 : public AdvancedImageToImageMetric<TFixedImage, TMovingImage>
54{
55public:
57
61 using Pointer = SmartPointer<Self>;
62 using ConstPointer = SmartPointer<const Self>;
63
64 using typename Superclass::FixedImageRegionType;
65 using FixedImageSizeType = typename FixedImageRegionType::SizeType;
66
68 itkNewMacro(Self);
69
72
74 itkSetMacro(SampleLastDimensionRandomly, bool);
75 itkSetMacro(NumSamplesLastDimension, unsigned int);
76 itkSetMacro(NumAdditionalSamplesFixed, unsigned int);
77 itkSetMacro(ReducedDimensionIndex, unsigned int);
78 itkSetMacro(SubtractMean, bool);
79 itkSetMacro(GridSize, FixedImageSizeType);
80 itkSetMacro(TransformIsStackTransform, bool);
81
83 itkGetConstMacro(SampleLastDimensionRandomly, bool);
84 itkGetConstMacro(NumSamplesLastDimension, int);
85
87 using typename Superclass::CoordinateRepresentationType;
88 using typename Superclass::MovingImageType;
89 using typename Superclass::MovingImagePixelType;
90 using typename Superclass::MovingImageConstPointer;
91 using typename Superclass::FixedImageType;
92 using typename Superclass::FixedImageConstPointer;
93 using typename Superclass::TransformType;
94 using typename Superclass::TransformPointer;
95 using typename Superclass::InputPointType;
96 using typename Superclass::OutputPointType;
97 using typename Superclass::TransformParametersType;
98 using typename Superclass::TransformJacobianType;
99 using typename Superclass::InterpolatorType;
100 using typename Superclass::InterpolatorPointer;
101 using typename Superclass::RealType;
102 using typename Superclass::GradientPixelType;
103 using typename Superclass::GradientImageType;
104 using typename Superclass::GradientImagePointer;
105 using typename Superclass::GradientImageFilterType;
106 using typename Superclass::GradientImageFilterPointer;
107 using typename Superclass::FixedImageMaskType;
108 using typename Superclass::FixedImageMaskPointer;
109 using typename Superclass::MovingImageMaskType;
110 using typename Superclass::MovingImageMaskPointer;
111 using typename Superclass::MeasureType;
112 using typename Superclass::DerivativeType;
113 using typename Superclass::ParametersType;
114 using typename Superclass::FixedImagePixelType;
116 using typename Superclass::ImageSamplerType;
117 using typename Superclass::ImageSamplerPointer;
125
127 itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension);
128
130 itkStaticConstMacro(MovingImageDimension, unsigned int, MovingImageType::ImageDimension);
131
133 MeasureType
134 GetValue(const TransformParametersType & parameters) const override;
135
137 void
138 GetDerivative(const TransformParametersType & parameters, DerivativeType & derivative) const override;
139
141 void
142 GetValueAndDerivative(const TransformParametersType & parameters,
143 MeasureType & Value,
144 DerivativeType & Derivative) const override;
145
149 void
150 Initialize() override;
151
152protected:
155 void
156 PrintSelf(std::ostream & os, Indent indent) const override;
157
161 using typename Superclass::FixedImageIndexType;
164 using typename Superclass::FixedImagePointType;
166 typename itk::ContinuousIndex<CoordinateRepresentationType, FixedImageDimension>;
173
177 void
178 EvaluateTransformJacobianInnerProduct(const TransformJacobianType & jacobian,
179 const MovingImageDerivativeType & movingImageDerivative,
180 DerivativeType & imageJacobian) const override;
181
182private:
184 void
185 SampleRandom(const int n, const int m, std::vector<int> & numbers) const;
186
188 bool m_SampleLastDimensionRandomly{ false };
189 unsigned int m_NumSamplesLastDimension{ 10 };
192
194 bool m_SubtractMean{ false };
195
198
201
203 bool m_TransformIsStackTransform{ false };
204};
205
206} // end namespace itk
207
208#ifndef ITK_MANUAL_INSTANTIATION
209# include "itkVarianceOverLastDimensionImageMetric.hxx"
210#endif
211
212#endif // end #ifndef itkVarianceOverLastDimensionImageMetric_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.
Compute the sum of variances over the slowest varying dimension in the moving image.
itkStaticConstMacro(MovingImageDimension, unsigned int, MovingImageType::ImageDimension)
~VarianceOverLastDimensionImageMetric() override=default
void SampleRandom(const int n, const int m, std::vector< int > &numbers) const
void PrintSelf(std::ostream &os, Indent indent) const override
typename itk::ContinuousIndex< CoordinateRepresentationType, FixedImageDimension > FixedImageContinuousIndexType
MeasureType GetValue(const TransformParametersType &parameters) const override
void EvaluateTransformJacobianInnerProduct(const TransformJacobianType &jacobian, const MovingImageDerivativeType &movingImageDerivative, DerivativeType &imageJacobian) const override
void GetDerivative(const TransformParametersType &parameters, DerivativeType &derivative) const override
typename BSplineInterpolatorType::CovariantVectorType MovingImageDerivativeType
itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension)
ITK_DISALLOW_COPY_AND_MOVE(VarianceOverLastDimensionImageMetric)
void GetValueAndDerivative(const TransformParametersType &parameters, MeasureType &Value, DerivativeType &Derivative) const override
typename FixedImageRegionType::SizeType FixedImageSizeType


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