frePointSetRegistrationProcessor.h

Go to the documentation of this file.
00001 /*=========================================================================
00002  
00003   Program:   F.R.E.E. - flexible registration evaluation engine
00004   Version:   v.1.0.0
00005   Date:      $Date: 2006/09/01 12:00:00 $
00006   Module:    $RCSfile: frePointSetRegistrationProcessor.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 __frePointSetRegistrationProcessor_h
00023 #define __frePointSetRegistrationProcessor_h
00024 
00025 #include "freRegistrationProcessorBase.h"
00026 #include "freControllerCentral.h"
00027 #include "freRegistrationObserver.h"
00028 #include "freTransformFunctionMedia.h"
00029 #include "freTransformBasedRegistrationProcessorInterface.h"
00030 
00031 #include "itkPointSetToPointSetRegistrationMethod.h"
00032 
00033 namespace FREE
00034 {
00035 
00036 
00051 template <unsigned int VImageDimension>
00052 class PointSetRegistrationProcessor
00053             : public RegistrationProcessorBase<VImageDimension>,
00054               public TransformBasedRegistrationProcessorInterface< typename itk::PointSetToPointSetMetric< typename ImageTypes<VImageDimension>::PointSetType,
00055                                                                                                            typename ImageTypes<VImageDimension>::PointSetType >::TransformType,
00056                                                                    VImageDimension >
00057 {
00058 public:
00060   typedef PointSetRegistrationProcessor<VImageDimension> Self;
00061   typedef RegistrationProcessorBase<VImageDimension> Superclass;
00062   typedef itk::SmartPointer<Self>        Pointer;
00063   typedef itk::SmartPointer<const Self>  ConstPointer;
00064 
00066   itkTypeMacro( PointSetRegistrationProcessor, RegistrationProcessorBase );
00067   itkNewMacro(Self);
00068 
00069   itkStaticConstMacro(PointSetDimension, unsigned int, VImageDimension);
00070 
00071   typedef typename Superclass::PointType                      PointType;
00072   typedef typename ImageTypes<VImageDimension>::PointSetType  PointSetType;
00073   typedef typename PointSetType::Pointer                      PointSetPointer;
00074 
00076   typedef itk::PointSetToPointSetRegistrationMethod<PointSetType,PointSetType>  RegistrationType;
00078   typedef typename RegistrationType::Pointer                                    RegistrationPointer;
00079 
00081   typedef itk::PointSetToPointSetMetric<PointSetType,PointSetType>    MetricType;
00082   typedef typename MetricType::Pointer                                MetricPointer;
00084   typedef typename MetricType::TransformType                          TransformType;
00085   typedef typename TransformType::Pointer                             TransformPointer;
00087   typedef itk::MultipleValuedNonLinearOptimizer                       OptimizerType;
00088   typedef typename OptimizerType::Pointer                             OptimizerPointer;
00089 
00090   typedef TransformBasedRegistrationProcessorInterface< TransformType, VImageDimension > TransformInterface;
00091 
00092   typedef typename Superclass::ImageType              ImageType;
00093   typedef typename Superclass::RegionType             RegionType;
00094   typedef typename Superclass::SpacingType            SpacingType;
00095   typedef typename Superclass::ImagePointer           ImagePointer;
00096 
00097   typedef typename TransformInterface::TransformFieldType            TransformFieldType;
00098   typedef typename TransformInterface::TransformFieldPointer         TransformFieldPointer;
00099   typedef typename TransformInterface::TransformParametersType       TransformParametersType;
00100   typedef typename TransformInterface::TransformFunctionMediaType    TransformFunctionMediaType;
00101   typedef typename TransformInterface::TransformFunctionMediaPointer TransformFunctionMediaPointer;
00102 
00103   itkGetObjectMacro(Metric,MetricType);
00104   itkSetObjectMacro(Metric,MetricType);
00105 
00106   itkGetObjectMacro(Optimizer,OptimizerType);
00107   itkSetObjectMacro(Optimizer,OptimizerType);
00108 
00109   itkGetObjectMacro(Registration,RegistrationType);
00110 
00111   itkGetObjectMacro(MovingPointSet,PointSetType);
00112   itkSetObjectMacro(MovingPointSet,PointSetType);
00113 
00114   itkGetObjectMacro(FixedPointSet,PointSetType);
00115   itkSetObjectMacro(FixedPointSet,PointSetType);
00116 
00119   IterationObserver::Pointer m_IterationObserver;
00120   typename NotificationEvent<PointSetRegistrationProcessor>::Pointer m_IterationNotificationEvent;
00121 
00126   virtual const long GetMaxIterationCount() const;
00127 
00128   using TransformInterface::GetTransformationFunction;
00134   TransformFunctionMediaPointer GetTransformationFunction();
00135 
00136   using TransformInterface::GetInverseTransformationFunction;
00143   TransformFunctionMediaPointer GetInverseTransformationFunction();
00144 
00145 protected:
00146   PointSetRegistrationProcessor();
00147 
00148   virtual ~PointSetRegistrationProcessor();
00149 
00150   virtual void ReleaseInputs();
00151 
00152   virtual void ComputeRegistration();
00153 
00155   virtual bool TransformationIsValid () const;
00156 
00158   virtual void NotifyProgress(const RegistrationStatusType status, const std::string& sComment);
00159 
00166   virtual TransformFieldPointer ComputeTransformationField(const PointType& origin,
00167                                                            const RegionType& region,
00168                                                            const SpacingType& spacing);
00169 
00177   void OnNewIteration(void* pSender, long threadID);
00178 
00180   SessionComponentCache* m_pOptimizerCache;
00181 
00185   MetricPointer m_Metric;
00186 
00190   OptimizerPointer m_Optimizer;
00191 
00193   RegistrationPointer m_Registration;
00194 
00196   PointSetPointer m_FixedPointSet;
00198   PointSetPointer m_MovingPointSet;
00199 };
00200 
00201 }//End of Namespace free
00202 
00203 #ifndef ITK_MANUAL_INSTANTIATION
00204 #include "frePointSetRegistrationProcessor.txx"
00205 #endif
00206 
00207 #endif

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