go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkParzenWindowMutualInformationImageToImageMetric.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 
15 #ifndef __itkParzenWindowMutualInformationImageToImageMetric_H__
16 #define __itkParzenWindowMutualInformationImageToImageMetric_H__
17 
19 
20 #include "itkArray2D.h"
21 
22 namespace itk
23 {
24 
71 template< class TFixedImage, class TMovingImage >
73  public ParzenWindowHistogramImageToImageMetric< TFixedImage, TMovingImage >
74 {
75 public:
76 
80  TFixedImage, TMovingImage > Superclass;
81  typedef SmartPointer< Self > Pointer;
82  typedef SmartPointer< const Self > ConstPointer;
83 
85  itkNewMacro( Self );
86 
88  itkTypeMacro(
91 
93  typedef typename
110  typedef typename Superclass::RealType RealType;
129  typedef typename
133  typedef typename
135  typedef typename
137  typedef typename
141 
143  itkStaticConstMacro( FixedImageDimension, unsigned int,
144  FixedImageType::ImageDimension );
145 
147  itkStaticConstMacro( MovingImageDimension, unsigned int,
148  MovingImageType::ImageDimension );
149 
151  MeasureType GetValue( const ParametersType & parameters ) const;
152 
154  itkGetConstMacro( UseJacobianPreconditioning, bool );
155  itkSetMacro( UseJacobianPreconditioning, bool );
156 
157 protected:
158 
161 
164 
192 
200  virtual void GetValueAndAnalyticDerivative(
201  const ParametersType & parameters,
202  MeasureType & value, DerivativeType & derivative ) const;
203 
214  const ParametersType & parameters,
215  MeasureType & value, DerivativeType & derivative ) const;
216 
223  const ParametersType & parameters,
224  MeasureType & value, DerivativeType & derivative ) const;
225 
227  virtual void ComputeJacobianPreconditioner(
228  const TransformJacobianType & jac,
229  const NonZeroJacobianIndicesType & nzji,
230  DerivativeType & preconditioner,
231  DerivativeType & divisor ) const;
232 
234  virtual void InitializeHistograms( void );
235 
238  {
240  };
241  ParzenWindowMutualInformationMultiThreaderParameterType m_ParzenWindowMutualInformationThreaderParameters;
242 
244  inline void ThreadedComputeDerivativeLowMemory( ThreadIdType threadId );
245 
248  DerivativeType & derivative ) const;
249 
251  static ITK_THREAD_RETURN_TYPE ComputeDerivativeLowMemoryThreaderCallback( void * arg );
252 
255 
256 private:
257 
259  ParzenWindowMutualInformationImageToImageMetric( const Self & ); // purposely not implemented
261  void operator=( const Self & ); // purposely not implemented
262 
264  typedef double PRatioType;
267 
270 
272  void ComputeDerivativeLowMemorySingleThreaded( DerivativeType & derivative ) const;
273 
274  void ComputeDerivativeLowMemory( DerivativeType & derivative ) const;
275 
278  const RealType & fixedImageValue,
279  const RealType & movingImageValue,
280  const DerivativeType & imageJacobian,
281  const NonZeroJacobianIndicesType & nzji,
282  DerivativeType & derivative ) const;
283 
285  void ComputeValueAndPRatioArray( double & MI ) const;
286 
287 };
288 
289 } // end namespace itk
290 
291 #ifndef ITK_MANUAL_INSTANTIATION
292 #include "itkParzenWindowMutualInformationImageToImageMetric.hxx"
293 #endif
294 
295 #endif // end #ifndef __itkParzenWindowMutualInformationImageToImageMetric_H__
AdvancedTransformType::NumberOfParametersType NumberOfParametersType
Superclass::MovingImageContinuousIndexType MovingImageContinuousIndexType
itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension)
Superclass::MovingImageDerivativeScalesType MovingImageDerivativeScalesType
An extension of the ITK ImageToImageMetric. It is the intended base class for all elastix metrics...
void ThreadedComputeDerivativeLowMemory(ThreadIdType threadId)
virtual void GetValueAndAnalyticDerivativeLowMemory(const ParametersType &parameters, MeasureType &value, DerivativeType &derivative) const
Superclass::CoordinateRepresentationType CoordinateRepresentationType
static ITK_THREAD_RETURN_TYPE ComputeDerivativeLowMemoryThreaderCallback(void *arg)
void ComputeDerivativeLowMemorySingleThreaded(DerivativeType &derivative) const
void UpdateDerivativeLowMemory(const RealType &fixedImageValue, const RealType &movingImageValue, const DerivativeType &imageJacobian, const NonZeroJacobianIndicesType &nzji, DerivativeType &derivative) const
virtual void ComputeJacobianPreconditioner(const TransformJacobianType &jac, const NonZeroJacobianIndicesType &nzji, DerivativeType &preconditioner, DerivativeType &divisor) const
A base class for image metrics based on a joint histogram computed using Parzen Windowing.
MeasureType GetValue(const ParametersType &parameters) const
virtual void GetValueAndAnalyticDerivative(const ParametersType &parameters, MeasureType &value, DerivativeType &derivative) const
ParzenWindowHistogramImageToImageMetric< TFixedImage, TMovingImage > Superclass
void AfterThreadedComputeDerivativeLowMemory(DerivativeType &derivative) const
void ComputeDerivativeLowMemory(DerivativeType &derivative) const
virtual void GetValueAndFiniteDifferenceDerivative(const ParametersType &parameters, MeasureType &value, DerivativeType &derivative) const
Computes the mutual information between two images to be registered using the method of Mattes et al...
ParzenWindowMutualInformationMultiThreaderParameterType m_ParzenWindowMutualInformationThreaderParameters
Superclass::CentralDifferenceGradientFilterType CentralDifferenceGradientFilterType


Generated on 27-04-2014 for elastix by doxygen 1.8.6 elastix logo