go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkPatternIntensityImageToImageMetric.h
Go to the documentation of this file.
1 /*======================================================================
2 
3  This file is part of the elastix software.
4 
5  Copyright (c) University Medical Center Utrecht. All rights reserved.
6  See src/CopyrightElastix.txt or http://elastix.isi.uu.nl/legal.php for
7  details.
8 
9  This software is distributed WITHOUT ANY WARRANTY; without even
10  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11  PURPOSE. See the above copyright notices for more information.
12 
13 ======================================================================*/
14 #ifndef __itkPatternIntensityImageToImageMetric_h
15 #define __itkPatternIntensityImageToImageMetric_h
16 
18 
19 #include "itkPoint.h"
20 #include "itkCastImageFilter.h"
21 #include "itkResampleImageFilter.h"
22 #include "itkMultiplyByConstantImageFilter.h"
23 #include "itkSubtractImageFilter.h"
24 #include "itkOptimizer.h"
25 #include "itkRescaleIntensityImageFilter.h"
28 
29 namespace itk
30 {
31 
40 template < class TFixedImage, class TMovingImage >
42 public AdvancedImageToImageMetric< TFixedImage, TMovingImage>
43 {
44 public:
45 
49  TFixedImage, TMovingImage > Superclass;
50  typedef SmartPointer<Self> Pointer;
51  typedef SmartPointer<const Self> ConstPointer;
52 
54  itkNewMacro( Self );
55 
57  itkTypeMacro( PatternIntensityImageToImageMetric, ImageToImageMetric );
58 
60  typedef typename
61  Superclass::CoordinateRepresentationType CoordinateRepresentationType;
62  typedef typename Superclass::MovingImageType MovingImageType;
63  typedef typename Superclass::MovingImagePixelType MovingImagePixelType;
64  typedef typename Superclass::MovingImagePointer MovingImagePointer;
65  typedef typename Superclass::MovingImageConstPointer MovingImageConstPointer;
66  typedef typename Superclass::FixedImageType FixedImageType;
67  typedef typename Superclass::FixedImageConstPointer FixedImageConstPointer;
68  typedef typename Superclass::FixedImageRegionType FixedImageRegionType;
69  typedef typename Superclass::TransformType TransformType;
70  typedef typename TransformType::ScalarType ScalarType;
71  typedef typename Superclass::TransformPointer TransformPointer;
72  typedef typename Superclass::InputPointType InputPointType;
73  typedef typename Superclass::OutputPointType OutputPointType;
74  typedef typename Superclass::TransformParametersType TransformParametersType;
75  typedef typename Superclass::TransformJacobianType TransformJacobianType;
76  typedef typename Superclass::InterpolatorType InterpolatorType;
77  typedef typename Superclass::InterpolatorPointer InterpolatorPointer;
78  typedef typename Superclass::RealType RealType;
79  typedef typename Superclass::GradientPixelType GradientPixelType;
80  typedef typename Superclass::GradientImageType GradientImageType;
81  typedef typename Superclass::GradientImagePointer GradientImagePointer;
82  typedef typename Superclass::GradientImageFilterType GradientImageFilterType;
83  typedef typename Superclass::GradientImageFilterPointer GradientImageFilterPointer;
84  typedef typename Superclass::FixedImageMaskType FixedImageMaskType;
85  typedef typename Superclass::FixedImageMaskPointer FixedImageMaskPointer;
86  typedef typename Superclass::MovingImageMaskType MovingImageMaskType;
87  typedef typename Superclass::MovingImageMaskPointer MovingImageMaskPointer;
88  typedef typename Superclass::MeasureType MeasureType;
89  typedef typename Superclass::DerivativeType DerivativeType;
90  typedef typename Superclass::ParametersType ParametersType;
91  typedef typename Superclass::FixedImagePixelType FixedImagePixelType;
92  typedef typename Superclass::MovingImageRegionType MovingImageRegionType;
93  typedef typename Superclass::ImageSamplerType ImageSamplerType;
94  typedef typename Superclass::ImageSamplerPointer ImageSamplerPointer;
95  typedef typename Superclass::ImageSampleContainerType ImageSampleContainerType;
96  typedef typename
97  Superclass::ImageSampleContainerPointer ImageSampleContainerPointer;
98  typedef typename Superclass::FixedImageLimiterType FixedImageLimiterType;
99  typedef typename Superclass::MovingImageLimiterType MovingImageLimiterType;
100  typedef typename
101  Superclass::FixedImageLimiterOutputType FixedImageLimiterOutputType;
102  typedef typename
103  Superclass::MovingImageLimiterOutputType MovingImageLimiterOutputType;
104  typedef typename
105  Superclass::MovingImageDerivativeScalesType MovingImageDerivativeScalesType;
106  typedef typename itk::Optimizer OptimizerType;
107  typedef typename OptimizerType::ScalesType ScalesType;
108 
110  itkStaticConstMacro( FixedImageDimension, unsigned int,
111  FixedImageType::ImageDimension );
112 
113  typedef itk::Image< FixedImagePixelType,
114  itkGetStaticConstMacro( FixedImageDimension ) > TransformedMovingImageType;
115  typedef typename itk::AdvancedCombinationTransform<
116  ScalarType, FixedImageDimension> CombinationTransformType;
117  typedef typename CombinationTransformType::Pointer CombinationTransformPointer;
121  typedef itk::ResampleImageFilter<
123  typedef itk::RescaleIntensityImageFilter<
126 
127  typedef itk::SubtractImageFilter<
130 
131  typedef itk::MultiplyByConstantImageFilter<
134 
136  itkStaticConstMacro( MovingImageDimension, unsigned int,
137  MovingImageType::ImageDimension );
138 
140  virtual MeasureType GetValue( const TransformParametersType & parameters ) const;
141 
143  virtual void GetDerivative( const TransformParametersType & parameters,
144  DerivativeType & derivative ) const;
145 
147  virtual void GetValueAndDerivative( const TransformParametersType & parameters,
148  MeasureType& Value, DerivativeType& Derivative ) const;
149 
155  virtual void Initialize(void) throw ( ExceptionObject );
156 
158  itkSetMacro( Scales , ScalesType );
159  itkGetConstReferenceMacro( Scales, ScalesType );
160 
162  itkSetMacro( NoiseConstant , double );
163  itkGetConstReferenceMacro( NoiseConstant, double );
164 
166  itkSetMacro( OptimizeNormalizationFactor , bool );
167  itkGetConstReferenceMacro( OptimizeNormalizationFactor, bool );
168 
169  protected:
171  virtual ~PatternIntensityImageToImageMetric() {};
172  void PrintSelf(std::ostream& os, Indent indent) const;
173 
175  MeasureType ComputePIFixed( void ) const;
176 
178  MeasureType ComputePIDiff( const TransformParametersType &parameters, float scalingfactor ) const;
179 
180  private:
181  PatternIntensityImageToImageMetric(const Self&); //purposely not implemented
182  void operator=(const Self&); //purposely not implemented
183 
184  typename TransformMovingImageFilterType::Pointer m_TransformMovingImageFilter;
185  typename DifferenceImageFilterType::Pointer m_DifferenceImageFilter;
186  typename RescaleIntensityImageFilterType::Pointer m_RescaleImageFilter;
187  typename MultiplyByConstantImageFilterType::Pointer m_MultiplyByConstantImageFilter;
189  unsigned int m_NeighborhoodRadius;
197 
198  }; // end class
199 
200 } // end namespace itk
201 
202 #ifndef ITK_MANUAL_INSTANTIATION
203 #include "itkPatternIntensityImageToImageMetric.hxx"
204 #endif
205 
206 #endif // end #ifndef __itkPatternIntensityImageToImageMetric_h
207 
This class combines two transforms: an &#39;initial transform&#39; with a &#39;current transform&#39;.
AdvancedImageToImageMetric< TFixedImage, TMovingImage > Superclass
An extension of the ITK ImageToImageMetric. It is the intended base class for all elastix metrics...
Superclass::FixedImageLimiterOutputType FixedImageLimiterOutputType
Computes similarity between two objects to be registered.
itk::AdvancedCombinationTransform< ScalarType, FixedImageDimension > CombinationTransformType
itk::AdvancedRayCastInterpolateImageFunction< MovingImageType, ScalarType > RayCastInterpolatorType
Superclass::TransformParametersType TransformParametersType
RescaleIntensityImageFilterType::Pointer m_RescaleImageFilter
itk::RescaleIntensityImageFilter< TransformedMovingImageType, TransformedMovingImageType > RescaleIntensityImageFilterType
Superclass::ImageSampleContainerType ImageSampleContainerType
itk::ResampleImageFilter< MovingImageType, TransformedMovingImageType > TransformMovingImageFilterType
Superclass::ImageSampleContainerPointer ImageSampleContainerPointer
Superclass::MovingImageConstPointer MovingImageConstPointer
Superclass::GradientImageFilterPointer GradientImageFilterPointer
MultiplyByConstantImageFilterType::Pointer m_MultiplyByConstantImageFilter
itk::Image< FixedImagePixelType, itkGetStaticConstMacro(FixedImageDimension) > TransformedMovingImageType
itk::SubtractImageFilter< FixedImageType, TransformedMovingImageType, TransformedMovingImageType > DifferenceImageFilterType
itk::MultiplyByConstantImageFilter< TransformedMovingImageType, double,TransformedMovingImageType > MultiplyByConstantImageFilterType
Projective interpolation of an image at specified positions.
Superclass::GradientImageFilterType GradientImageFilterType
Superclass::CoordinateRepresentationType CoordinateRepresentationType
Superclass::MovingImageDerivativeScalesType MovingImageDerivativeScalesType
TransformMovingImageFilterType::Pointer m_TransformMovingImageFilter
Superclass::MovingImageLimiterOutputType MovingImageLimiterOutputType


Generated on 06-12-2013 for elastix by doxygen 1.8.5 elastix logo