freFastChamferDistanceImageFilterController.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: freFastChamferDistanceImageFilterController.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 __freFastChamferDistanceImageFilterController_h
00023 #define __freFastChamferDistanceImageFilterController_h
00024 
00025 #include "freImageToImageFilterControllerBase.h"
00026 
00027 #include "itkFastChamferDistanceImageFilter.h"
00028 
00029 namespace FREE
00030 {
00031 
00041   freControllerIDMacro(FastChamferDistanceImageFilterControllerBase, "FastChamferDistanceImageFilterBase");
00042 template <class TInputImage>
00043 class FastChamferDistanceImageFilterControllerBase : public ImageToImageFilterControllerBase< itk::FastChamferDistanceImageFilter<TInputImage, TInputImage> >
00044 {
00045 public:  
00046   typedef itk::FastChamferDistanceImageFilter<TInputImage, TInputImage> ComponentType;
00047   typedef ImageToImageFilterControllerBase<ComponentType> Superclass;
00048   typedef FastChamferDistanceImageFilterControllerBase<TInputImage> Self;
00049 
00050   typedef typename ComponentType::Pointer ComponentPointer;
00051   typedef typename Superclass::GenericComponentType GenericComponentType;
00052   typedef typename Superclass::GenericComponentPointer GenericComponentPointer;
00053   typedef typename Superclass::GenericMediaPointer GenericMediaPointer;
00054 
00055   DeclareParameterMacro(MaximumDistance);
00056 
00057   itkTypeMacro(FastChamferDistanceImageFilterControllerBase, ImageToImageFilterControllerBase);
00058 
00059 protected:
00060   FastChamferDistanceImageFilterControllerBase()
00061   {
00062     //Profile settings
00063     this->UpdateControllerID(ControllerID::FastChamferDistanceImageFilterControllerBase);
00064     this->m_Description = "Basis for itk::FastChamferDistanceImageFilter";
00065   };
00066 
00067   virtual void GenerateProfile(CtrlProfile::ControllerProfile& profile,
00068                   const SessionComponentCache* pComponentCache,
00069                   bool bRegardOldSetup) const
00070   {
00071     Superclass::GenerateProfile(profile,pComponentCache,bRegardOldSetup);
00072 
00073     //Parameters
00074     profile.Parameters().AddParameter(cParam_MaximumDistance,Parameter::PVTDouble,cParamDsc_MaximumDistance,1,"30.0");
00075   };
00076 
00077         virtual void ActualizeMainComponent(ComponentType* pMainComponent,
00078                                       SessionComponentCache* pComponentCache,
00079                                       SessionInfo* pSessionInfo,
00080                                                                                                                                                         const unsigned int& iActLevel) const
00081   {
00082     Superclass::ActualizeMainComponent(pMainComponent,pComponentCache, pSessionInfo, iActLevel);
00083     
00084           double dMaximumDistance;
00085 
00086     try
00087     {
00088       SessionAccessor::GetParameterValue(pComponentCache,cParam_MaximumDistance,dMaximumDistance);
00089     }
00090     catchAllNPassMacro("Error while retrieving parameter values.");
00091 
00092           pMainComponent->SetMaximumDistance(dMaximumDistance);
00093   };
00094 
00095 };
00096 
00097 template <class TInputImage>
00098 const char* const FastChamferDistanceImageFilterControllerBase<TInputImage> :: cParam_MaximumDistance = "MaximumDistance";
00099 template <class TInputImage>
00100 const char* const FastChamferDistanceImageFilterControllerBase<TInputImage> :: cParamDsc_MaximumDistance = "Indicates if input image is binary and therefore any nonzero pixel is a singel object.";
00101 
00107 freControllerIDMacro(FastChamferDistance2DImageFilterController, "Fast Chamfer Distance 2D Image Filter");
00108 class FastChamferDistance2DImageFilterController : public FastChamferDistanceImageFilterControllerBase< ImageTypes<2>::InternalImageType >
00109 {
00110 public:  
00111   typedef FastChamferDistanceImageFilterControllerBase< ImageTypes<2>::InternalImageType > Superclass;
00112   typedef FastChamferDistance2DImageFilterController Self;
00113 
00114   typedef Superclass::ComponentType ComponentType;
00115   typedef ComponentType::Pointer ComponentPointer;
00116   typedef Superclass::GenericComponentType GenericComponentType;
00117   typedef Superclass::GenericComponentPointer GenericComponentPointer;
00118   typedef Superclass::GenericMediaPointer GenericMediaPointer;
00119 
00120   itkTypeMacro(FastChamferDistance2DImageFilterController, FastChamferDistanceImageFilterControllerBase);
00121 
00122   FastChamferDistance2DImageFilterController();
00123 };
00124 
00130 freControllerIDMacro(FastChamferDistance3DImageFilterController, "Fast Chamfer Distance 3D Image Filter");
00131 class FastChamferDistance3DImageFilterController : public FastChamferDistanceImageFilterControllerBase< ImageTypes<3>::InternalImageType >
00132 {
00133 public:  
00134   typedef FastChamferDistanceImageFilterControllerBase< ImageTypes<3>::InternalImageType > Superclass;
00135   typedef FastChamferDistance3DImageFilterController Self;
00136 
00137   typedef Superclass::ComponentType ComponentType;
00138   typedef ComponentType::Pointer ComponentPointer;
00139   typedef Superclass::GenericComponentType GenericComponentType;
00140   typedef Superclass::GenericComponentPointer GenericComponentPointer;
00141   typedef Superclass::GenericMediaPointer GenericMediaPointer;
00142 
00143   itkTypeMacro(FastChamferDistance3DImageFilterController, FastChamferDistanceImageFilterControllerBase);
00144 
00145   FastChamferDistance3DImageFilterController();
00146 };
00147 
00148 } //end of namespace free
00149 
00150 #endif

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