frePointSupportedImageToImageMetric.h

Go to the documentation of this file.
00001 /*=========================================================================
00002  
00003   Program:   F.R.E.E. - flexible registration evaluation engine
00004   Version:   v.0.7.2
00005   Date:      $Date: 2006/09/01 12:00:00 $
00006   Module:    $RCSfile: frePointSupportedImageToImageMetric.h,v $
00007   Language:  C++
00008  
00009  
00010  
00011   Copyright (c) 2007 Ralf o Floca (Department of Medical Informatics,
00012   Institute for Medical Biometry and Informatics, University of Heidelberg,
00013   Germany). All rights reserved.
00014   See FREECopyright.txt or http://www.mi.med.uni-hd.de/free/copyright.htm
00015   for details.
00016  
00017      This software is distributed WITHOUT ANY WARRANTY; without even 
00018      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00019      PURPOSE.  See the above copyright notices for more information.
00020  
00021 =========================================================================*/
00022 #ifndef __frePointSupportedImageToImageMetric_h
00023 #define __frePointSupportedImageToImageMetric_h
00024 
00025 #include "itkImageToImageMetric.h"
00026 #include "itkPoint.h"
00027 #include "itkImageBase.h"
00028 #include "itkPointSet.h"
00029 
00030 
00031 namespace itk
00032 {
00055 template < class TFixedImage, class TMovingImage, class TFixedPointSet, class TMovingPointSet>
00056 class ITK_EXPORT PointSupportedImageToImageMetric :
00057             public ImageToImageMetric< TFixedImage, TMovingImage>
00058 {
00059 public:
00060 
00062     typedef PointSupportedImageToImageMetric    Self;
00063     typedef ImageToImageMetric<TFixedImage, TMovingImage >  Superclass;
00064 
00065     typedef SmartPointer<Self>         Pointer;
00066     typedef SmartPointer<const Self>   ConstPointer;
00067 
00069     itkNewMacro(Self);
00070 
00072     itkTypeMacro(PointSupportedImageToImageMetric, ImageToImageMetric);
00073 
00074 
00076     typedef typename Superclass::RealType                 RealType;
00077     typedef typename Superclass::TransformType            TransformType;
00078     typedef typename Superclass::TransformPointer         TransformPointer;
00079     typedef typename Superclass::TransformParametersType  TransformParametersType;
00080     typedef typename Superclass::TransformJacobianType    TransformJacobianType;
00081     typedef typename Superclass::InputPointType     InputPointType;
00082     typedef typename Superclass::OutputPointType    OutputPointType;
00083 
00084     typedef typename Superclass::MeasureType              MeasureType;
00085     typedef typename Superclass::DerivativeType           DerivativeType;
00086     typedef typename Superclass::FixedImageType           FixedImageType;
00087     typedef typename Superclass::MovingImageType          MovingImageType;
00088     typedef typename Superclass::FixedImageConstPointer   FixedImageConstPointer;
00089     typedef typename Superclass::MovingImageConstPointer  MovingImageConstPointer;
00090 
00091     typedef typename Superclass::InterpolatorType                                       InterpolatorType;
00092     typedef typename Superclass::InterpolatorPointer                    InterpolatorPointer;
00093 
00094     typedef ImageToImageMetric<TFixedImage, TMovingImage> ImageMetricType;
00095     typedef typename ImageMetricType::Pointer             ImageMetricPointer;
00096 
00097     typedef TFixedPointSet FixedPointSetType;
00098     typedef typename FixedPointSetType::ConstPointer              FixedPointSetConstPointer;
00099 
00100     typedef TMovingPointSet MovingPointSetType;
00101     typedef typename MovingPointSetType::ConstPointer             MovingPointSetConstPointer;
00102 
00104     void GetDerivative( const TransformParametersType & parameters,
00105                         DerivativeType & derivative ) const;
00106 
00108     MeasureType GetValue( const TransformParametersType & parameters ) const;
00109 
00111     void GetValueAndDerivative( const TransformParametersType & parameters,
00112                                 MeasureType& Value, DerivativeType& Derivative ) const;
00113 
00114     itkGetConstMacro( Alpha, MeasureType );
00115     itkSetMacro( Alpha, MeasureType );
00116 
00117     itkGetConstMacro( LastImageMetricValue, MeasureType );
00118     itkGetConstMacro( LastPointMetricValue, MeasureType );
00119 
00120     itkGetConstMacro( LastImageDerivative, DerivativeType );
00121     itkGetConstMacro( LastPointDerivative, DerivativeType );
00122 
00124     itkSetConstObjectMacro( FixedPointSet, FixedPointSetType );
00125 
00127     itkGetConstObjectMacro( FixedPointSet, FixedPointSetType );
00128 
00130     itkSetConstObjectMacro( MovingPointSet, MovingPointSetType );
00131 
00133     itkGetConstObjectMacro( MovingPointSet, MovingPointSetType );
00134 
00136     itkSetObjectMacro( ImageMetric, ImageMetricType );
00137 
00139     itkGetObjectMacro( ImageMetric, ImageMetricType );
00140 
00141     virtual void Initialize(void) throw ( ExceptionObject );
00142 
00143 protected:
00144     PointSupportedImageToImageMetric();
00145     virtual ~PointSupportedImageToImageMetric()
00146     {};
00147 
00148     MeasureType m_Alpha;
00149 
00150     mutable MeasureType m_LastImageMetricValue;
00151     mutable MeasureType m_LastPointMetricValue;
00152 
00153     mutable DerivativeType m_LastImageDerivative;
00154     mutable DerivativeType m_LastPointDerivative;
00155 
00156     MovingPointSetConstPointer m_MovingPointSet;
00157     FixedPointSetConstPointer m_FixedPointSet;
00158 
00159     ImageMetricPointer m_ImageMetric;
00160 
00162     void GetPointDerivative( const TransformParametersType & parameters,
00163                         DerivativeType & derivative ) const;
00164 
00166     MeasureType GetPointValue( const TransformParametersType & parameters ) const;
00167 
00169     void GetPointValueAndDerivative( const TransformParametersType & parameters,
00170                                 MeasureType& Value, DerivativeType& Derivative ) const;
00171 
00172 private:
00173     PointSupportedImageToImageMetric(const Self&); //purposely not implemented
00174     void operator=(const Self&); //purposely not implemented
00175 
00176 };
00177 
00178 } // end namespace FREE
00179 
00180 #ifndef ITK_MANUAL_INSTANTIATION
00181 #include "frePointSupportedImageToImageMetric.txx"
00182 #endif
00183 
00184 #endif
00185 
00186 
00187 

Generated at Sat Oct 13 17:04:43 2007 for f.r.e.e. - Flexible Registration and Evaluation Engine by doxygen 1.5.3 written by Dimitri van Heesch, © 1997-2000