go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkPCAMetric.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 __itkPCAMetric_h
19#define __itkPCAMetric_h
20
22
23#include "itkSmoothingRecursiveGaussianImageFilter.h"
25#include "itkNearestNeighborInterpolateImageFunction.h"
26#include "itkExtractImageFilter.h"
27
28using namespace std;
29
30namespace itk
31{
32template< class TFixedImage, class TMovingImage >
33class PCAMetric :
34 public AdvancedImageToImageMetric< TFixedImage, TMovingImage >
35{
36public:
37
39 typedef PCAMetric Self;
41 TFixedImage, TMovingImage > Superclass;
43 typedef SmartPointer< const Self > ConstPointer;
44
46 typedef typename FixedImageRegionType::SizeType FixedImageSizeType;
47
49 itkNewMacro( Self );
50
53
55 itkSetMacro( SampleLastDimensionRandomly, bool );
56 itkSetMacro( NumSamplesLastDimension, unsigned int );
57 itkSetMacro( NumAdditionalSamplesFixed, unsigned int );
58 itkSetMacro( ReducedDimensionIndex, unsigned int );
59 itkSetMacro( SubtractMean, bool );
60 itkSetMacro( GridSize, FixedImageSizeType );
61 itkSetMacro( TransformIsStackTransform, bool );
62 itkSetMacro( NumEigenValues, unsigned int );
63 itkSetMacro( UseDerivativeOfMean, bool );
64 itkSetMacro( DeNoise, bool );
65 itkSetMacro( VarNoise, double );
66
68 itkGetConstMacro( SampleLastDimensionRandomly, bool );
69 itkGetConstMacro( NumSamplesLastDimension, int );
70
72 typedef typename
105 typedef typename
109 typedef typename
111 typedef typename
113 typedef typename
115
117 itkStaticConstMacro( FixedImageDimension, unsigned int,
118 FixedImageType::ImageDimension );
119
121 itkStaticConstMacro( MovingImageDimension, unsigned int,
122 MovingImageType::ImageDimension );
123
125 virtual MeasureType GetValue( const TransformParametersType & parameters ) const;
126
128 virtual void GetDerivative( const TransformParametersType & parameters,
129 DerivativeType & derivative ) const;
130
132 virtual void GetValueAndDerivative( const TransformParametersType & parameters,
133 MeasureType & Value, DerivativeType & Derivative ) const;
134
139 virtual void Initialize( void );
140
141protected:
142
144 virtual ~PCAMetric() {}
145 void PrintSelf( std::ostream & os, Indent indent ) const;
146
154 typedef typename itk::ContinuousIndex< CoordinateRepresentationType, FixedImageDimension >
162
167 const TransformJacobianType & jacobian,
168 const MovingImageDerivativeType & movingImageDerivative,
169 DerivativeType & imageJacobian ) const;
170
180 mutable int m_NumberOfSamples;
181
182private:
183
184 PCAMetric( const Self & ); // purposely not implemented
185 void operator=( const Self & ); // purposely not implemented
186
188 void SampleRandom( const int n, const int m, std::vector< int > & numbers ) const;
189
195
197
199
202
205
208
210 unsigned int m_NumEigenValues;
211
213
214};
215
216} // end namespace itk
217
218#ifndef ITK_MANUAL_INSTANTIATION
219#include "itkPCAMetric.hxx"
220#endif
221
222#endif // end #ifndef __itkPCAMetric_h
An extension of the ITK ImageToImageMetric. It is the intended base class for all elastix metrics.
BSplineInterpolateImageFunction< MovingImageType, CoordinateRepresentationType, double > BSplineInterpolatorType
Superclass::FixedImageConstPointer FixedImageConstPointer
Superclass::TransformParametersType TransformParametersType
Superclass::MovingImageConstPointer MovingImageConstPointer
Superclass::FixedImageMaskPointer FixedImageMaskPointer
InterpolatorType::ContinuousIndexType MovingImageContinuousIndexType
Superclass::GradientImageFilterPointer GradientImageFilterPointer
Superclass::GradientImageFilterType GradientImageFilterType
Superclass::TransformJacobianType TransformJacobianType
FixedArray< double, Self::MovingImageDimension > MovingImageDerivativeScalesType
Superclass::GradientImagePointer GradientImagePointer
Superclass::TransformPointer TransformPointer
ImageSamplerType::OutputVectorContainerPointer ImageSampleContainerPointer
AdvancedTransformType::NonZeroJacobianIndicesType NonZeroJacobianIndicesType
ImageSamplerBase< FixedImageType > ImageSamplerType
Superclass::CoordinateRepresentationType CoordinateRepresentationType
ImageSamplerType::OutputVectorContainerType ImageSampleContainerType
Superclass::InterpolatorPointer InterpolatorPointer
Superclass::MovingImageMaskPointer MovingImageMaskPointer
TransformType::InputPointType FixedImagePointType
Superclass::MovingImageMaskType MovingImageMaskType
Superclass::GradientPixelType GradientPixelType
MovingImageType::IndexType MovingImageIndexType
MovingImageType::RegionType MovingImageRegionType
FixedImageLimiterType::OutputType FixedImageLimiterOutputType
FixedImageIndexType::IndexValueType FixedImageIndexValueType
Superclass::MovingImagePixelType MovingImagePixelType
MovingImageLimiterType::OutputType MovingImageLimiterOutputType
GradientImageFilter< MovingImageType, RealType, RealType > CentralDifferenceGradientFilterType
LimiterFunctionBase< RealType, MovingImageDimension > MovingImageLimiterType
BSplineInterpolatorType::CovariantVectorType MovingImageDerivativeType
Superclass::FixedImageMaskType FixedImageMaskType
Superclass::GradientImageType GradientImageType
Superclass::InterpolatorType InterpolatorType
TransformType::OutputPointType MovingImagePointType
LimiterFunctionBase< RealType, FixedImageDimension > FixedImageLimiterType
Superclass::FixedImageRegionType FixedImageRegionType
Superclass::TransformPointer TransformPointer
Definition: itkPCAMetric.h:80
Superclass::FixedImageLimiterType FixedImageLimiterType
Definition: itkPCAMetric.h:107
unsigned int m_NumSamplesLastDimension
Definition: itkPCAMetric.h:192
Superclass::MovingImagePointType MovingImagePointType
Definition: itkPCAMetric.h:156
unsigned int m_NumEigenValues
Definition: itkPCAMetric.h:210
Superclass::InterpolatorPointer InterpolatorPointer
Definition: itkPCAMetric.h:86
vnl_vector< double > m_fourthEigenVector
Definition: itkPCAMetric.h:174
Superclass::DerivativeType DerivativeType
Definition: itkPCAMetric.h:98
itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension)
vnl_vector< double > m_thirdEigenVector
Definition: itkPCAMetric.h:173
Superclass::MovingImageLimiterOutputType MovingImageLimiterOutputType
Definition: itkPCAMetric.h:112
void PrintSelf(std::ostream &os, Indent indent) const
Superclass::ImageSamplerType ImageSamplerType
Definition: itkPCAMetric.h:102
virtual void Initialize(void)
Superclass::MovingImageContinuousIndexType MovingImageContinuousIndexType
Definition: itkPCAMetric.h:157
Superclass::GradientImagePointer GradientImagePointer
Definition: itkPCAMetric.h:90
Superclass::GradientImageFilterPointer GradientImageFilterPointer
Definition: itkPCAMetric.h:92
Superclass::ImageSamplerPointer ImageSamplerPointer
Definition: itkPCAMetric.h:103
bool m_SampleLastDimensionRandomly
Definition: itkPCAMetric.h:191
itk::ContinuousIndex< CoordinateRepresentationType, FixedImageDimension > FixedImageContinuousIndexType
Definition: itkPCAMetric.h:155
Superclass::MovingImageType MovingImageType
Definition: itkPCAMetric.h:74
vnl_vector< double > m_secondEigenVector
Definition: itkPCAMetric.h:172
Superclass::MovingImagePixelType MovingImagePixelType
Definition: itkPCAMetric.h:75
vnl_vector< double > m_normdCdmu
Definition: itkPCAMetric.h:179
Superclass::FixedImageConstPointer FixedImageConstPointer
Definition: itkPCAMetric.h:78
vnl_vector< double > m_sixthEigenVector
Definition: itkPCAMetric.h:176
Superclass::CentralDifferenceGradientFilterType CentralDifferenceGradientFilterType
Definition: itkPCAMetric.h:159
FixedImageSizeType m_GridSize
Definition: itkPCAMetric.h:204
Superclass::MovingImageIndexType MovingImageIndexType
Definition: itkPCAMetric.h:152
Superclass::OutputPointType OutputPointType
Definition: itkPCAMetric.h:82
Superclass::NonZeroJacobianIndicesType NonZeroJacobianIndicesType
Definition: itkPCAMetric.h:161
Superclass::MeasureType MeasureType
Definition: itkPCAMetric.h:97
void EvaluateTransformJacobianInnerProduct(const TransformJacobianType &jacobian, const MovingImageDerivativeType &movingImageDerivative, DerivativeType &imageJacobian) const
Superclass::InputPointType InputPointType
Definition: itkPCAMetric.h:81
vnl_vector< double > m_firstEigenVector
Definition: itkPCAMetric.h:171
virtual MeasureType GetValue(const TransformParametersType &parameters) const
Superclass::FixedImageMaskPointer FixedImageMaskPointer
Definition: itkPCAMetric.h:94
Superclass::MovingImageMaskType MovingImageMaskType
Definition: itkPCAMetric.h:95
bool m_TransformIsStackTransform
Definition: itkPCAMetric.h:207
Superclass::ImageSampleContainerType ImageSampleContainerType
Definition: itkPCAMetric.h:104
vnl_vector< double > m_fifthEigenVector
Definition: itkPCAMetric.h:175
Superclass::MovingImageRegionType MovingImageRegionType
Definition: itkPCAMetric.h:101
Superclass::GradientPixelType GradientPixelType
Definition: itkPCAMetric.h:88
void operator=(const Self &)
Superclass::TransformJacobianType TransformJacobianType
Definition: itkPCAMetric.h:84
Superclass::BSplineInterpolatorType BSplineInterpolatorType
Definition: itkPCAMetric.h:158
virtual void GetDerivative(const TransformParametersType &parameters, DerivativeType &derivative) const
Superclass::MovingImageDerivativeType MovingImageDerivativeType
Definition: itkPCAMetric.h:160
Superclass::RealType RealType
Definition: itkPCAMetric.h:87
AdvancedImageToImageMetric< TFixedImage, TMovingImage > Superclass
Definition: itkPCAMetric.h:41
Superclass::MovingImageDerivativeScalesType MovingImageDerivativeScalesType
Definition: itkPCAMetric.h:114
unsigned int m_NumAdditionalSamplesFixed
Definition: itkPCAMetric.h:193
Superclass::MovingImageConstPointer MovingImageConstPointer
Definition: itkPCAMetric.h:76
Superclass::CoordinateRepresentationType CoordinateRepresentationType
Definition: itkPCAMetric.h:73
itkStaticConstMacro(MovingImageDimension, unsigned int, MovingImageType::ImageDimension)
void SampleRandom(const int n, const int m, std::vector< int > &numbers) const
Superclass::FixedImageLimiterOutputType FixedImageLimiterOutputType
Definition: itkPCAMetric.h:110
Superclass::GradientImageType GradientImageType
Definition: itkPCAMetric.h:89
Superclass::InterpolatorType InterpolatorType
Definition: itkPCAMetric.h:85
Superclass::ParametersType ParametersType
Definition: itkPCAMetric.h:99
Superclass::FixedImageRegionType FixedImageRegionType
Definition: itkPCAMetric.h:45
PCAMetric(const Self &)
Superclass::GradientImageFilterType GradientImageFilterType
Definition: itkPCAMetric.h:91
Superclass::FixedImagePointType FixedImagePointType
Definition: itkPCAMetric.h:153
SmartPointer< Self > Pointer
Definition: itkPCAMetric.h:42
virtual ~PCAMetric()
Definition: itkPCAMetric.h:144
virtual void GetValueAndDerivative(const TransformParametersType &parameters, MeasureType &Value, DerivativeType &Derivative) const
Superclass::MovingImageLimiterType MovingImageLimiterType
Definition: itkPCAMetric.h:108
Superclass::FixedImagePixelType FixedImagePixelType
Definition: itkPCAMetric.h:100
Superclass::MovingImageMaskPointer MovingImageMaskPointer
Definition: itkPCAMetric.h:96
Superclass::FixedImageIndexType FixedImageIndexType
Definition: itkPCAMetric.h:150
Superclass::FixedImageMaskType FixedImageMaskType
Definition: itkPCAMetric.h:93
vnl_vector< double > m_seventhEigenVector
Definition: itkPCAMetric.h:177
Superclass::ImageSampleContainerPointer ImageSampleContainerPointer
Definition: itkPCAMetric.h:106
FixedImageRegionType::SizeType FixedImageSizeType
Definition: itkPCAMetric.h:46
Superclass::TransformParametersType TransformParametersType
Definition: itkPCAMetric.h:83
vnl_vector< double > m_eigenValues
Definition: itkPCAMetric.h:178
PCAMetric Self
Definition: itkPCAMetric.h:39
Superclass::FixedImageIndexValueType FixedImageIndexValueType
Definition: itkPCAMetric.h:151
unsigned int m_ReducedDimensionIndex
Definition: itkPCAMetric.h:194
SmartPointer< const Self > ConstPointer
Definition: itkPCAMetric.h:43
Superclass::TransformType TransformType
Definition: itkPCAMetric.h:79
bool m_UseDerivativeOfMean
Definition: itkPCAMetric.h:212
Superclass::FixedImageType FixedImageType
Definition: itkPCAMetric.h:77


Generated on 1667476801 for elastix by doxygen 1.9.4 elastix logo