go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkSumOfPairwiseCorrelationCoefficientsMetric.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 __itkSumOfPairwiseCorrelationCoefficientsMetric_H__
19 #define __itkSumOfPairwiseCorrelationCoefficientsMetric_H__
20 
22 
23 #include "itkSmoothingRecursiveGaussianImageFilter.h"
25 #include "itkNearestNeighborInterpolateImageFunction.h"
26 #include "itkExtractImageFilter.h"
27 
28 using namespace std;
29 
30 namespace itk
31 {
32 template< class TFixedImage, class TMovingImage >
34  public AdvancedImageToImageMetric< TFixedImage, TMovingImage >
35 {
36 public:
37 
41  TFixedImage, TMovingImage > Superclass;
43  typedef SmartPointer< const Self > ConstPointer;
44 
45  typedef typename Superclass::FixedImageRegionType FixedImageRegionType;
46  typedef typename FixedImageRegionType::SizeType FixedImageSizeType;
47 
49  itkNewMacro( Self );
50 
53 
55  itkSetMacro( NumAdditionalSamplesFixed, unsigned int );
56  itkSetMacro( ReducedDimensionIndex, unsigned int );
57  itkSetMacro( SubtractMean, bool );
58  itkSetMacro( GridSize, FixedImageSizeType );
59  itkSetMacro( TransformIsStackTransform, bool );
60 
62  typedef typename
63  Superclass::CoordinateRepresentationType CoordinateRepresentationType;
64  typedef typename Superclass::MovingImageType MovingImageType;
65  typedef typename Superclass::MovingImagePixelType MovingImagePixelType;
66  typedef typename Superclass::MovingImageConstPointer MovingImageConstPointer;
67  typedef typename Superclass::FixedImageType FixedImageType;
68  typedef typename Superclass::FixedImageConstPointer FixedImageConstPointer;
69  typedef typename Superclass::TransformType TransformType;
70  typedef typename Superclass::TransformPointer TransformPointer;
71  typedef typename Superclass::InputPointType InputPointType;
72  typedef typename Superclass::OutputPointType OutputPointType;
73  typedef typename Superclass::TransformParametersType TransformParametersType;
74  typedef typename Superclass::TransformJacobianType TransformJacobianType;
75  typedef typename Superclass::InterpolatorType InterpolatorType;
76  typedef typename Superclass::InterpolatorPointer InterpolatorPointer;
77  typedef typename Superclass::RealType RealType;
78  typedef typename Superclass::GradientPixelType GradientPixelType;
79  typedef typename Superclass::GradientImageType GradientImageType;
80  typedef typename Superclass::GradientImagePointer GradientImagePointer;
81  typedef typename Superclass::GradientImageFilterType GradientImageFilterType;
82  typedef typename Superclass::GradientImageFilterPointer GradientImageFilterPointer;
83  typedef typename Superclass::FixedImageMaskType FixedImageMaskType;
84  typedef typename Superclass::FixedImageMaskPointer FixedImageMaskPointer;
85  typedef typename Superclass::MovingImageMaskType MovingImageMaskType;
86  typedef typename Superclass::MovingImageMaskPointer MovingImageMaskPointer;
87  typedef typename Superclass::MeasureType MeasureType;
88  typedef typename Superclass::DerivativeType DerivativeType;
89  typedef typename Superclass::ParametersType ParametersType;
90  typedef typename Superclass::FixedImagePixelType FixedImagePixelType;
91  typedef typename Superclass::MovingImageRegionType MovingImageRegionType;
92  typedef typename Superclass::ImageSamplerType ImageSamplerType;
93  typedef typename Superclass::ImageSamplerPointer ImageSamplerPointer;
94  typedef typename Superclass::ImageSampleContainerType ImageSampleContainerType;
95  typedef typename
96  Superclass::ImageSampleContainerPointer ImageSampleContainerPointer;
97  typedef typename Superclass::FixedImageLimiterType FixedImageLimiterType;
98  typedef typename Superclass::MovingImageLimiterType MovingImageLimiterType;
99  typedef typename
100  Superclass::FixedImageLimiterOutputType FixedImageLimiterOutputType;
101  typedef typename
102  Superclass::MovingImageLimiterOutputType MovingImageLimiterOutputType;
103  typedef typename
104  Superclass::MovingImageDerivativeScalesType MovingImageDerivativeScalesType;
105 
107  itkStaticConstMacro( FixedImageDimension, unsigned int,
108  FixedImageType::ImageDimension );
109 
111  itkStaticConstMacro( MovingImageDimension, unsigned int,
112  MovingImageType::ImageDimension );
113 
115  virtual MeasureType GetValue( const TransformParametersType & parameters ) const;
116 
118  virtual void GetDerivative( const TransformParametersType & parameters,
119  DerivativeType & derivative ) const;
120 
122  virtual void GetValueAndDerivative( const TransformParametersType & parameters,
123  MeasureType & Value, DerivativeType & Derivative ) const;
124 
129  virtual void Initialize( void ) throw ( ExceptionObject );
130 
131 protected:
132 
135  void PrintSelf( std::ostream & os, Indent indent ) const;
136 
140  typedef typename Superclass::FixedImageIndexType FixedImageIndexType;
141  typedef typename Superclass::FixedImageIndexValueType FixedImageIndexValueType;
142  typedef typename Superclass::MovingImageIndexType MovingImageIndexType;
143  typedef typename Superclass::FixedImagePointType FixedImagePointType;
144  typedef typename itk::ContinuousIndex< CoordinateRepresentationType, FixedImageDimension >
146  typedef typename Superclass::MovingImagePointType MovingImagePointType;
147  typedef typename Superclass::MovingImageContinuousIndexType MovingImageContinuousIndexType;
148  typedef typename Superclass::BSplineInterpolatorType BSplineInterpolatorType;
149  typedef typename Superclass::CentralDifferenceGradientFilterType CentralDifferenceGradientFilterType;
150  typedef typename Superclass::MovingImageDerivativeType MovingImageDerivativeType;
151  typedef typename Superclass::NonZeroJacobianIndicesType NonZeroJacobianIndicesType;
152 
156  void EvaluateTransformJacobianInnerProduct(
157  const TransformJacobianType & jacobian,
158  const MovingImageDerivativeType & movingImageDerivative,
159  DerivativeType & imageJacobian ) const;
160 
161 private:
162 
163  SumOfPairwiseCorrelationCoefficientsMetric( const Self & ); // purposely not implemented
164  void operator=( const Self & ); // purposely not implemented
165 
167  void SampleRandom( const int n, const int m, std::vector< int > & numbers ) const;
168 
172 
175 
177  FixedImageSizeType m_GridSize;
178 
181 
182 };
183 
184 } // end namespace itk
185 
186 #ifndef ITK_MANUAL_INSTANTIATION
187 #include "itkSumOfPairwiseCorrelationCoefficientsMetric.hxx"
188 #endif
189 
190 #endif // end #ifndef __itkSumOfPairwiseCorrelationCoefficientsMetric_H__
An extension of the ITK ImageToImageMetric. It is the intended base class for all elastix metrics...
itk::ContinuousIndex< CoordinateRepresentationType, FixedImageDimension > FixedImageContinuousIndexType
Superclass::CentralDifferenceGradientFilterType CentralDifferenceGradientFilterType
AdvancedImageToImageMetric< TFixedImage, TMovingImage > Superclass


Generated on OURCE_DATE_EPOCH for elastix by doxygen 1.8.13 elastix logo