freRegistrationProcessorBase.txx

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: freRegistrationProcessorBase.txx,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 
00023 #ifndef __freRegistrationProcessorBase_txx
00024 #define __freRegistrationProcessorBase_txx
00025 
00026 #include "freRegistrationProcessorBase.h"
00027 
00028 namespace FREE
00029 {
00030 
00031 template <unsigned int VImageDimension>
00032 typename RegistrationProcessorBase< VImageDimension>::TransformFieldPointer
00033 RegistrationProcessorBase< VImageDimension>::
00034 GetTransformationField(const PointType& origin, const RegionType& region, const SpacingType& spacing)
00035 {
00036         if (!m_bRegistrationStarted) throwExceptionMacro("Cannot return transformation field before section is processed.");
00037   return ComputeTransformationField(origin,region,spacing);
00038 };
00039 
00040 template <unsigned int VImageDimension>
00041 void
00042 RegistrationProcessorBase< VImageDimension>::
00043 ComputeRegistration()
00044 {
00045   //Rest will be defined in derived versions of the base class;
00046 };
00047 
00048 
00049 template <unsigned int VImageDimension>
00050 RegistrationProcessorBase< VImageDimension>::
00051 RegistrationProcessorBase()
00052 {
00053   m_ReleaseInputsAfterRegistration = false;
00054 };
00055 
00056 template <unsigned int VImageDimension>
00057 typename RegistrationProcessorBase< VImageDimension>::TransformFieldPointer
00058 RegistrationProcessorBase< VImageDimension>::
00059 ComputeTransformationField(const PointType& origin, const RegionType& region, const SpacingType& spacing)
00060 {
00061         return NULL;
00062 };      
00063 
00064 template <unsigned int VImageDimension>
00065 void
00066 RegistrationProcessorBase< VImageDimension>::
00067 StartRegistration()
00068 {
00069   m_iResolutionLevel = 0;
00070   m_lCurIteration = 0;
00071 
00072         m_bRegistrationStarted = true;
00073   if ((!m_pSessionInfo) || (!GetComponentSetup())) throwExceptionMacro("Cannot start registration; no setup and/or session info specified.");
00074 
00075         ComputeRegistration();
00076 
00077   ResetInternals();
00078 
00079   m_bRegistrationDone = true;
00080 
00081   if (m_ReleaseInputsAfterRegistration)
00082   {
00083     ReleaseInputs();
00084   }
00085 };
00086 
00087 template <unsigned int VImageDimension>
00088 void
00089 RegistrationProcessorBase< VImageDimension>::
00090 ReleaseInputs()
00091 {
00092   //Reimplement in descendant classes if needed
00093 };
00094 
00095 template <unsigned int VImageDimension>
00096 void
00097 RegistrationProcessorBase< VImageDimension>::
00098 ResetInternals()
00099 {
00100   //Reimplement in descendant classes if needed
00101 };
00102 
00103 }//End of Namespace free
00104 
00105 #endif

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