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  * 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 __itkPatternIntensityImageToImageMetric_h
19 #define __itkPatternIntensityImageToImageMetric_h
20 
22 
23 #include "itkPoint.h"
24 #include "itkCastImageFilter.h"
25 #include "itkResampleImageFilter.h"
26 #include "itkMultiplyImageFilter.h"
27 #include "itkSubtractImageFilter.h"
28 #include "itkOptimizer.h"
29 #include "itkRescaleIntensityImageFilter.h"
32 
33 namespace itk
34 {
35 
44 template< class TFixedImage, class TMovingImage >
46  public AdvancedImageToImageMetric< TFixedImage, TMovingImage >
47 {
48 public:
49 
53  TFixedImage, TMovingImage > Superclass;
55  typedef SmartPointer< const Self > ConstPointer;
56 
58  itkNewMacro( Self );
59 
61  itkTypeMacro( PatternIntensityImageToImageMetric, ImageToImageMetric );
62 
64  typedef typename
74  typedef typename TransformType::ScalarType ScalarType;
82  typedef typename Superclass::RealType RealType;
100  typedef typename
104  typedef typename
106  typedef typename
108  typedef typename
110  typedef typename itk::Optimizer OptimizerType;
111  typedef typename OptimizerType::ScalesType ScalesType;
112 
114  itkStaticConstMacro( FixedImageDimension, unsigned int,
115  FixedImageType::ImageDimension );
116 
117  typedef itk::Image< FixedImagePixelType,
118  itkGetStaticConstMacro( FixedImageDimension ) > TransformedMovingImageType;
119  typedef typename itk::AdvancedCombinationTransform<
120  ScalarType, FixedImageDimension > CombinationTransformType;
125  typedef itk::ResampleImageFilter<
127  typedef typename TransformMovingImageFilterType::Pointer TransformMovingImageFilterPointer;
128  typedef itk::RescaleIntensityImageFilter<
130  typedef typename RescaleIntensityImageFilterType::Pointer RescaleIntensityImageFilterPointer;
131 
132  typedef itk::SubtractImageFilter<
135  TransformedMovingImageType > DifferenceImageFilterType;
136  typedef typename DifferenceImageFilterType::Pointer DifferenceImageFilterPointer;
137  typedef itk::MultiplyImageFilter<
140  TransformedMovingImageType > MultiplyImageFilterType;
141  typedef typename MultiplyImageFilterType::Pointer MultiplyImageFilterPointer;
142 
144  itkStaticConstMacro( MovingImageDimension, unsigned int,
145  MovingImageType::ImageDimension );
146 
148  virtual MeasureType GetValue( const TransformParametersType & parameters ) const;
149 
151  virtual void GetDerivative( const TransformParametersType & parameters,
152  DerivativeType & derivative ) const;
153 
155  virtual void GetValueAndDerivative( const TransformParametersType & parameters,
156  MeasureType & Value, DerivativeType & Derivative ) const;
157 
163  virtual void Initialize( void ) throw ( ExceptionObject );
164 
166  itkSetMacro( Scales, ScalesType );
167  itkGetConstReferenceMacro( Scales, ScalesType );
168 
170  itkSetMacro( NoiseConstant, double );
171  itkGetConstReferenceMacro( NoiseConstant, double );
172 
174  itkSetMacro( OptimizeNormalizationFactor, bool );
175  itkGetConstReferenceMacro( OptimizeNormalizationFactor, bool );
176 
177 protected:
178 
180  virtual ~PatternIntensityImageToImageMetric() {}
181  void PrintSelf( std::ostream & os, Indent indent ) const;
182 
184  MeasureType ComputePIFixed( void ) const;
185 
187  MeasureType ComputePIDiff( const TransformParametersType & parameters, float scalingfactor ) const;
188 
189 private:
190 
191  PatternIntensityImageToImageMetric( const Self & ); // purposely not implemented
192  void operator=( const Self & ); // purposely not implemented
193 
194  TransformMovingImageFilterPointer m_TransformMovingImageFilter;
195  DifferenceImageFilterPointer m_DifferenceImageFilter;
196  RescaleIntensityImageFilterPointer m_RescaleImageFilter;
197  MultiplyImageFilterPointer m_MultiplyImageFilter;
199  unsigned int m_NeighborhoodRadius;
204  ScalesType m_Scales;
205  MeasureType m_FixedMeasure;
206  CombinationTransformPointer m_CombinationTransform;
207 
208 };
209 
210 } // end namespace itk
211 
212 #ifndef ITK_MANUAL_INSTANTIATION
213 #include "itkPatternIntensityImageToImageMetric.hxx"
214 #endif
215 
216 #endif // end #ifndef __itkPatternIntensityImageToImageMetric_h
This class combines two transforms: an 'initial transform' with a 'current transform'.
AdvancedImageToImageMetric< TFixedImage, TMovingImage > Superclass
itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension)
LimiterFunctionBase< RealType, FixedImageDimension > FixedImageLimiterType
Superclass::CoordinateRepresentationType CoordinateRepresentationType
Superclass::TransformParametersType TransformParametersType
Superclass::FixedImageMaskPointer FixedImageMaskPointer
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.
Superclass::GradientPixelType GradientPixelType
FixedImageLimiterType::OutputType FixedImageLimiterOutputType
Superclass::FixedImageRegionType FixedImageRegionType
itk::AdvancedRayCastInterpolateImageFunction< MovingImageType, ScalarType > RayCastInterpolatorType
TransformMovingImageFilterType::Pointer TransformMovingImageFilterPointer
virtual void GetDerivative(const TransformParametersType &parameters, DerivativeType &derivative) const
ImageSamplerType::OutputVectorContainerType ImageSampleContainerType
Superclass::TransformParametersType TransformParametersType
Superclass::ImageSampleContainerType ImageSampleContainerType
DifferenceImageFilterType::Pointer DifferenceImageFilterPointer
itk::ResampleImageFilter< MovingImageType, TransformedMovingImageType > TransformMovingImageFilterType
Superclass::ImageSampleContainerPointer ImageSampleContainerPointer
FixedArray< double, Self::MovingImageDimension > MovingImageDerivativeScalesType
ImageSamplerBase< FixedImageType > ImageSamplerType
itk::RescaleIntensityImageFilter< TransformedMovingImageType, TransformedMovingImageType > RescaleIntensityImageFilterType
Superclass::MovingImageConstPointer MovingImageConstPointer
Superclass::GradientImageFilterPointer GradientImageFilterPointer
Superclass::InterpolatorPointer InterpolatorPointer
itk::Image< FixedImagePixelType, itkGetStaticConstMacro(FixedImageDimension) > TransformedMovingImageType
itk::SubtractImageFilter< FixedImageType, TransformedMovingImageType, TransformedMovingImageType > DifferenceImageFilterType
Superclass::MovingImageMaskType MovingImageMaskType
LimiterFunctionBase< RealType, MovingImageDimension > MovingImageLimiterType
virtual void GetValueAndDerivative(const TransformParametersType &parameters, MeasureType &Value, DerivativeType &Derivative) const
Superclass::GradientImageType GradientImageType
virtual MeasureType GetValue(const TransformParametersType &parameters) const
Superclass::TransformPointer TransformPointer
MeasureType ComputePIDiff(const TransformParametersType &parameters, float scalingfactor) const
itk::MultiplyImageFilter< TransformedMovingImageType, TransformedMovingImageType, TransformedMovingImageType > MultiplyImageFilterType
Superclass::GradientImageFilterType GradientImageFilterType
MovingImageType::RegionType MovingImageRegionType
Superclass::InterpolatorType InterpolatorType
RescaleIntensityImageFilterType::Pointer RescaleIntensityImageFilterPointer
Projective interpolation of an image at specified positions.
Superclass::TransformJacobianType TransformJacobianType
void PrintSelf(std::ostream &os, Indent indent) const
Superclass::GradientImageFilterType GradientImageFilterType
Superclass::MovingImagePixelType MovingImagePixelType
Superclass::CoordinateRepresentationType CoordinateRepresentationType
Superclass::MovingImageDerivativeScalesType MovingImageDerivativeScalesType
Superclass::MovingImageMaskPointer MovingImageMaskPointer
MovingImageLimiterType::OutputType MovingImageLimiterOutputType
MeasureType ComputePIFixed(void) const
Superclass::MovingImageLimiterOutputType MovingImageLimiterOutputType
ImageSamplerType::OutputVectorContainerPointer ImageSampleContainerPointer
Superclass::FixedImageMaskType FixedImageMaskType
itk::AdvancedCombinationTransform< ScalarType, FixedImageDimension > CombinationTransformType
Superclass::FixedImageConstPointer FixedImageConstPointer
Superclass::MovingImageConstPointer MovingImageConstPointer
Superclass::GradientImageFilterPointer GradientImageFilterPointer
Superclass::GradientImagePointer GradientImagePointer


Generated on 04-09-2015 for elastix by doxygen 1.8.9.1 elastix logo