freMaskedROIController.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: freMaskedROIController.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 __freMaskedROIController_h
00023 #define __freMaskedROIController_h
00024 
00025 #include "freROIController.h"
00026 #include "freROI.h"
00027 
00028 #include "itkNearestNeighborInterpolateImageFunction.h"
00029 #include "itkWarpImageFilter.h" 
00030 
00031 namespace FREE
00032 {
00041   freControllerIDMacro(MaskedROIControllerBase, "MaskedROIBase");
00042 template<unsigned int VImageDimension>
00043 class MaskedROIControllerBase : public ROIControllerBase< ImageMaskedROI<VImageDimension> >
00044 {
00045 public:  
00046   typedef ImageMaskedROI<VImageDimension> ComponentType;
00047   typedef ROIControllerBase<ComponentType> Superclass;
00048 
00049   itkTypeMacro(MaskedROIControllerBase, ROIControllerBase);
00050 
00051 protected:
00054   MaskedROIControllerBase()
00055   {
00056     this->UpdateControllerID(ControllerID::MaskedROIControllerBase);
00057     this->m_Description = "A single masked region of interest (ROI), only abstract, not for practical use";
00058   };
00059 
00060   virtual void GenerateProfile(CtrlProfile::ControllerProfile& profile,
00061                                const SessionComponentCache* pComponentCache,
00062                                bool bRegardOldSetup) const
00063   {
00064     Superclass::GenerateProfile(profile, pComponentCache, bRegardOldSetup);
00065 
00066     //Parameter info
00067     profile.Parameters().AddParameter(cParam_ROIMaskFile,Parameter::PVTURI,cParamDsc_ROIMaskFile);
00068     profile.Parameters().AddParameter(cParam_ROIMaskFileFeedback,Parameter::PVTBool,cParamDsc_ROIMaskFileFeedback,1,"false");
00069   };
00070 
00075         virtual void ActualizeMainComponent(ComponentType* pMainComponent,
00076                                       SessionComponentCache* pComponentCache,
00077                                       SessionInfo* pSessionInfo,
00078                                                                                                                                                         const unsigned int& iActLevel) const
00079   {
00080     Superclass::ActualizeMainComponent(pMainComponent,pComponentCache,pSessionInfo,iActLevel);
00081     
00082     bool bMaskFeedback;
00083     std::string sMaskFile;
00084 
00085     try
00086     {
00087       SessionAccessor::GetParameterValue(pComponentCache,cParam_ROIMaskFile,sMaskFile);
00088       SessionAccessor::GetParameterValue(pComponentCache,cParam_ROIMaskFileFeedback,bMaskFeedback);
00089     }
00090     catchAllNPassMacro("Error while retrieving parameter values.");
00091 
00092                 //Mask specific operations
00093                 if (!pMainComponent->GetMask())
00094                 { //There is no mask loaded yet so try to
00095                         if (sMaskFile!="") pMainComponent->SetMask(sMaskFile);
00096                 }
00097                 if (bMaskFeedback) MakeCallback(ccfROIFixed,&(pMainComponent->GetMaskSmartPointer()),pComponentCache);
00098   };
00099 };
00100 
00109   freControllerIDMacro(MaskedROI2DController, "Masked ROI 2D");
00110 class MaskedROI2DController : public MaskedROIControllerBase< 2 >
00111 {
00112 public:  
00113   itkTypeMacro(MaskedROI2DController, MaskedROIControllerBase);
00114 
00115   MaskedROI2DController();
00116 };
00117 
00126   freControllerIDMacro(MaskedROI3DController, "Masked ROI 3D");
00127 class MaskedROI3DController : public MaskedROIControllerBase< 3 >
00128 {
00129 public:  
00130   itkTypeMacro(MaskedROI3DController, MaskedROIControllerBase);
00131 
00132   MaskedROI3DController();
00133 };
00134 } //end of namespace free
00135 
00136 #endif

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