freROIController.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: freROIController.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 __freROIController_h
00023 #define __freROIController_h
00024 
00025 #include "freMediaControllerBase.h"
00026 #include "freROI.h"
00027 
00028 #include "itkNearestNeighborInterpolateImageFunction.h"
00029 #include "itkWarpImageFilter.h" 
00030 
00031 namespace FREE
00032 {
00033 
00042   freControllerIDMacro(ROIControllerBase, "ROIBase");
00043 template<class TSingleROI>
00044 class ROIControllerBase : public MediaControllerBase< TSingleROI >
00045 {
00046 public:  
00047   typedef TSingleROI ComponentType;
00048   typedef ComponentControllerBase<ComponentType> Superclass;
00049   typedef typename Superclass::GenericComponentType GenericComponentType;
00050   typedef typename Superclass::GenericComponentPointer GenericComponentPointer;
00051   typedef typename Superclass::GenericMediaPointer GenericMediaPointer;
00052 
00053   itkTypeMacro(ROIControllerBase, MediaControllerBase);
00054 
00055   virtual GenericMediaPointer ComputeActualizedMedia(GenericMediaType* pGenericMedia,
00056                                                      GenericMediaType* pGenericTransformationField) const
00057         {
00058                 //TODO
00059                 GenericMediaPointer proxy = itk::LightObject::New();
00060                 return proxy;
00061         };
00062 
00063   virtual GenericMediaPointer ComputeActualizedMediaByFunction(GenericMediaType* pGenericMedia,
00064                                                                GenericMediaType* pGenericTransformationFunction) const
00065         {
00066                 //TODO
00067                 GenericMediaPointer proxy = itk::LightObject::New();
00068                 return proxy;
00069         };
00070 
00071 protected:
00074   ROIControllerBase()
00075   {
00076     this->UpdateControllerID(ControllerID::ROIControllerBase);
00077     this->m_Description = "A single region of interest (ROI), only abstract, not for practical use";
00078   };
00079 
00080   virtual void GenerateProfile(CtrlProfile::ControllerProfile& profile,
00081                                const SessionComponentCache* pComponentCache,
00082                                bool bRegardOldSetup) const
00083   {
00084     Superclass::GenerateProfile(profile, pComponentCache, bRegardOldSetup);
00085 
00086     profile.MediaMap().Reset();
00087 
00088     //Parameter info
00089     profile.Parameters().AddParameter(cParam_ROIOrigin,CtrlProfile::Parameter::PVTDouble,cParamDsc_ROIOrigin,TSingleROI::GetImageDimension(),"0");
00090     profile.Parameters().AddParameter(cParam_ROISize,CtrlProfile::Parameter::PVTDouble,cParamDsc_ROISize,TSingleROI::GetImageDimension(),"1");
00091 
00092     //Media
00093     profile.MediaMap().AddMedia("media",this->ControllerID(), DAGet,this->GetMediaDimension());
00094   };
00095 
00100         virtual void ActualizeMainComponent(ComponentType* pMainComponent,
00101                                       SessionComponentCache* pComponentCache,
00102                                       SessionInfo* pSessionInfo,
00103                                                                                                                                                         const unsigned int& iActLevel) const
00104   {
00105     double dSize;
00106     double dOrigin;
00107     for (unsigned int i = 0; i<TSingleROI::GetImageDimension(); i++)
00108     {
00109       try
00110       {
00111         SessionAccessor::GetParameterValue(pComponentCache,cParam_ROIOrigin,dOrigin, i);
00112         SessionAccessor::GetParameterValue(pComponentCache,cParam_ROISize,dSize, i);
00113       }
00114       catchAllNPassMacro("Error while retrieving parameter values.");
00115 
00116       pMainComponent->SetOriginPoint(dOrigin, i);
00117       pMainComponent->SetSize(dSize, i);
00118     }
00119 
00120   };
00121 };
00122 
00131   freControllerIDMacro(ROI2DController, "ROI 2D");
00132 class ROI2DController : public ROIControllerBase< ImageROIBase<2> >
00133 {
00134 public:  
00135   typedef ImageROIBase<2> ComponentType;
00136   typedef ROIControllerBase<ComponentType> Superclass;
00137 
00138   itkTypeMacro(ROI2DController, ROIControllerBase);
00139 
00140   ROI2DController();
00141 };
00142 
00151   freControllerIDMacro(ROI3DController, "ROI 3D");
00152 class ROI3DController : public ROIControllerBase< ImageROIBase<3> >
00153 {
00154 public:  
00155   typedef ImageROIBase<3> ComponentType;
00156   typedef ROIControllerBase<ComponentType> Superclass;
00157 
00158   itkTypeMacro(ROI3DController, ROIControllerBase);
00159 
00160   ROI3DController();
00161 };
00162 
00163 } //end of namespace free
00164 
00165 #endif

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