go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkAdvancedNormalizedCorrelationImageToImageMetric.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 __itkAdvancedNormalizedCorrelationImageToImageMetric_h
15 #define __itkAdvancedNormalizedCorrelationImageToImageMetric_h
16 
18 
19 namespace itk
20 {
85 template< class TFixedImage, class TMovingImage >
87  public AdvancedImageToImageMetric< TFixedImage, TMovingImage >
88 {
89 public:
90 
94  TFixedImage, TMovingImage > Superclass;
95  typedef SmartPointer< Self > Pointer;
96  typedef SmartPointer< const Self > ConstPointer;
97 
99  itkNewMacro( Self );
100 
103 
105  typedef typename
122  typedef typename Superclass::RealType RealType;
141  typedef typename
145  typedef typename
147  typedef typename
149  typedef typename
153 
155  itkStaticConstMacro( FixedImageDimension, unsigned int,
156  FixedImageType::ImageDimension );
157 
159  itkStaticConstMacro( MovingImageDimension, unsigned int,
160  MovingImageType::ImageDimension );
161 
163  MeasureType GetValue( const TransformParametersType & parameters ) const;
164 
166  void GetDerivative(
167  const TransformParametersType & parameters,
168  DerivativeType & derivative ) const;
169 
172  const TransformParametersType & parameters,
173  MeasureType & value, DerivativeType & derivative ) const;
174 
176  const TransformParametersType & parameters,
177  MeasureType & value, DerivativeType & derivative ) const;
178 
184  itkSetMacro( SubtractMean, bool );
185  itkGetConstReferenceMacro( SubtractMean, bool );
186  itkBooleanMacro( SubtractMean );
187 
188 protected:
189 
192 
193  void PrintSelf( std::ostream & os, Indent indent ) const;
194 
208 
213  const RealType & fixedImageValue,
214  const RealType & movingImageValue,
215  const DerivativeType & imageJacobian,
216  const NonZeroJacobianIndicesType & nzji,
217  DerivativeType & derivativeF,
218  DerivativeType & derivativeM,
219  DerivativeType & differential ) const;
220 
225  virtual void InitializeThreadingParameters( void ) const;
226 
228  inline void ThreadedGetValueAndDerivative( ThreadIdType threadID );
229 
232  MeasureType & value, DerivativeType & derivative ) const;
233 
235  static ITK_THREAD_RETURN_TYPE AccumulateDerivativesThreaderCallback( void * arg );
236 
237 private:
238 
239  AdvancedNormalizedCorrelationImageToImageMetric( const Self & ); // purposely not implemented
240  void operator=( const Self & ); // purposely not implemented
241 
242  mutable bool m_SubtractMean;
243 
244  typedef typename NumericTraits< MeasureType >::AccumulateType AccumulateType;
245 
250  {
252 
258  };
259 
261  {
272  };
274  PaddedCorrelationGetValueAndDerivativePerThreadStruct );
275  itkAlignedTypedef( ITK_CACHE_LINE_ALIGNMENT, PaddedCorrelationGetValueAndDerivativePerThreadStruct,
276  AlignedCorrelationGetValueAndDerivativePerThreadStruct );
277  mutable AlignedCorrelationGetValueAndDerivativePerThreadStruct * m_CorrelationGetValueAndDerivativePerThreadVariables;
279 
280 };
281 
282 } // end namespace itk
283 
284 #ifndef ITK_MANUAL_INSTANTIATION
285 #include "itkAdvancedNormalizedCorrelationImageToImageMetric.hxx"
286 #endif
287 
288 #endif // end #ifndef __itkAdvancedNormalizedCorrelationImageToImageMetric_h
AdvancedTransformType::NumberOfParametersType NumberOfParametersType
void ThreadedGetValueAndDerivative(ThreadIdType threadID)
itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension)
LimiterFunctionBase< RealType, FixedImageDimension > FixedImageLimiterType
Superclass::CoordinateRepresentationType CoordinateRepresentationType
Superclass::TransformParametersType TransformParametersType
Superclass::MovingImageType MovingImageType
Superclass::FixedImageMaskPointer FixedImageMaskPointer
An extension of the ITK ImageToImageMetric. It is the intended base class for all elastix metrics...
Superclass::GradientPixelType GradientPixelType
FixedImageLimiterType::OutputType FixedImageLimiterOutputType
Superclass::FixedImageRegionType FixedImageRegionType
ImageSamplerType::OutputVectorContainerType ImageSampleContainerType
MovingImageType::IndexType MovingImageIndexType
InterpolatorType::ContinuousIndexType MovingImageContinuousIndexType
itkAlignedTypedef(ITK_CACHE_LINE_ALIGNMENT, PaddedCorrelationGetValueAndDerivativePerThreadStruct, AlignedCorrelationGetValueAndDerivativePerThreadStruct)
static ITK_THREAD_RETURN_TYPE AccumulateDerivativesThreaderCallback(void *arg)
TransformType::InputPointType FixedImagePointType
FixedArray< double, Self::MovingImageDimension > MovingImageDerivativeScalesType
BSplineInterpolateImageFunction< MovingImageType, CoordinateRepresentationType, double > BSplineInterpolatorType
ImageSamplerBase< FixedImageType > ImageSamplerType
AdvancedTransformType::NonZeroJacobianIndicesType NonZeroJacobianIndicesType
void GetDerivative(const TransformParametersType &parameters, DerivativeType &derivative) const
void GetValueAndDerivative(const TransformParametersType &parameters, MeasureType &value, DerivativeType &derivative) const
Superclass::InterpolatorPointer InterpolatorPointer
FixedImageIndexType::IndexValueType FixedImageIndexValueType
TransformType::OutputPointType MovingImagePointType
Superclass::MovingImageMaskType MovingImageMaskType
LimiterFunctionBase< RealType, MovingImageDimension > MovingImageLimiterType
void GetValueAndDerivativeSingleThreaded(const TransformParametersType &parameters, MeasureType &value, DerivativeType &derivative) const
Superclass::GradientImageType GradientImageType
Superclass::TransformPointer TransformPointer
void PrintSelf(std::ostream &os, Indent indent) const
Superclass::GradientImageFilterType GradientImageFilterType
MovingImageType::RegionType MovingImageRegionType
AlignedCorrelationGetValueAndDerivativePerThreadStruct * m_CorrelationGetValueAndDerivativePerThreadVariables
Superclass::InterpolatorType InterpolatorType
Superclass::TransformJacobianType TransformJacobianType
Computes normalized correlation between two images, based on AdvancedImageToImageMetric...
Superclass::MovingImagePixelType MovingImagePixelType
GradientImageFilter< MovingImageType, RealType, RealType > CentralDifferenceGradientFilterType
Superclass::MovingImageMaskPointer MovingImageMaskPointer
void AfterThreadedGetValueAndDerivative(MeasureType &value, DerivativeType &derivative) const
MovingImageLimiterType::OutputType MovingImageLimiterOutputType
ThreaderType::ThreadInfoStruct ThreadInfoType
itkPadStruct(ITK_CACHE_LINE_ALIGNMENT, CorrelationGetValueAndDerivativePerThreadStruct, PaddedCorrelationGetValueAndDerivativePerThreadStruct)
ImageSamplerType::OutputVectorContainerPointer ImageSampleContainerPointer
Superclass::FixedImageMaskType FixedImageMaskType
BSplineInterpolatorType::CovariantVectorType MovingImageDerivativeType
Superclass::FixedImageConstPointer FixedImageConstPointer
Superclass::MovingImageConstPointer MovingImageConstPointer
void UpdateDerivativeTerms(const RealType &fixedImageValue, const RealType &movingImageValue, const DerivativeType &imageJacobian, const NonZeroJacobianIndicesType &nzji, DerivativeType &derivativeF, DerivativeType &derivativeM, DerivativeType &differential) const
MeasureType GetValue(const TransformParametersType &parameters) const
Superclass::GradientImageFilterPointer GradientImageFilterPointer
Superclass::GradientImagePointer GradientImagePointer


Generated on 11-03-2014 for elastix by doxygen 1.8.6 elastix logo