00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef __freIsoContourDistanceImageFilterController_h
00023 #define __freIsoContourDistanceImageFilterController_h
00024
00025 #include "freImageToImageFilterControllerBase.h"
00026
00027 #include "itkIsoContourDistanceImageFilter.h"
00028
00029 namespace FREE
00030 {
00031
00041 freControllerIDMacro(IsoContourDistanceImageFilterControllerBase, "IsoContourDistanceImageFilterBase");
00042 template <class TInputImage>
00043 class IsoContourDistanceImageFilterControllerBase : public ImageToImageFilterControllerBase< itk::IsoContourDistanceImageFilter<TInputImage, TInputImage> >
00044 {
00045 public:
00046 typedef itk::IsoContourDistanceImageFilter<TInputImage, TInputImage> ComponentType;
00047 typedef ImageToImageFilterControllerBase<ComponentType> Superclass;
00048 typedef IsoContourDistanceImageFilterControllerBase<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(FarValue);
00056 DeclareParameterMacro(LevelSetValue);
00057
00058 itkTypeMacro(IsoContourDistanceImageFilterControllerBase, ImageToImageFilterControllerBase);
00059
00060 protected:
00061 IsoContourDistanceImageFilterControllerBase()
00062 {
00063
00064 this->UpdateControllerID(ControllerID::IsoContourDistanceImageFilterControllerBase);
00065 this->m_Description = "Basis for itk::IsoContourDistanceImageFilter";
00066 };
00067
00068 virtual void GenerateProfile(CtrlProfile::ControllerProfile& profile,
00069 const SessionComponentCache* pComponentCache,
00070 bool bRegardOldSetup) const
00071 {
00072 Superclass::GenerateProfile(profile,pComponentCache,bRegardOldSetup);
00073
00074
00075 profile.Parameters().AddParameter(cParam_FarValue,Parameter::PVTDouble,cParamDsc_FarValue,1,"255.0");
00076 profile.Parameters().AddParameter(cParam_LevelSetValue,Parameter::PVTDouble,cParamDsc_LevelSetValue,1,"255.0");
00077 };
00078
00079 virtual void ActualizeMainComponent(ComponentType* pMainComponent,
00080 SessionComponentCache* pComponentCache,
00081 SessionInfo* pSessionInfo,
00082 const unsigned int& iActLevel) const
00083 {
00084 Superclass::ActualizeMainComponent(pMainComponent,pComponentCache, pSessionInfo, iActLevel);
00085
00086 double dFarValue;
00087 double dLevelSetValue;
00088
00089 try
00090 {
00091 SessionAccessor::GetParameterValue(pComponentCache,cParam_FarValue,dFarValue);
00092 SessionAccessor::GetParameterValue(pComponentCache,cParam_LevelSetValue,dLevelSetValue);
00093 }
00094 catchAllNPassMacro("Error while retrieving parameter values.");
00095
00096 pMainComponent->SetLevelSetValue(dLevelSetValue);
00097 pMainComponent->SetFarValue(dFarValue);
00098 };
00099
00100 };
00101
00102 template <class TInputImage>
00103 const char* const IsoContourDistanceImageFilterControllerBase<TInputImage> :: cParam_FarValue = "FarValue";
00104 template <class TInputImage>
00105 const char* const IsoContourDistanceImageFilterControllerBase<TInputImage> :: cParamDsc_FarValue = "Indicates if input image is binary and therefore any nonzero pixel is a singel object.";
00106 template <class TInputImage>
00107 const char* const IsoContourDistanceImageFilterControllerBase<TInputImage> :: cParam_LevelSetValue = "LevelSetValue";
00108 template <class TInputImage>
00109 const char* const IsoContourDistanceImageFilterControllerBase<TInputImage> :: cParamDsc_LevelSetValue = "Indicates if the distance map should contain the squared dinstances.";
00110
00116 freControllerIDMacro(IsoContourDistanceImage2DFilterController, "Iso Contour Distance 2D Image Filter");
00117 class IsoContourDistanceImage2DFilterController : public IsoContourDistanceImageFilterControllerBase< ImageTypes<2>::InternalImageType >
00118 {
00119 public:
00120 typedef IsoContourDistanceImageFilterControllerBase< ImageTypes<2>::InternalImageType > Superclass;
00121 typedef IsoContourDistanceImage2DFilterController Self;
00122
00123 typedef Superclass::ComponentType ComponentType;
00124 typedef ComponentType::Pointer ComponentPointer;
00125 typedef Superclass::GenericComponentType GenericComponentType;
00126 typedef Superclass::GenericComponentPointer GenericComponentPointer;
00127 typedef Superclass::GenericMediaPointer GenericMediaPointer;
00128
00129 itkTypeMacro(IsoContourDistanceImage2DFilterController, IsoContourDistanceImageFilterControllerBase);
00130
00131 IsoContourDistanceImage2DFilterController();
00132 };
00133
00139 freControllerIDMacro(IsoContourDistanceImage3DFilterController, "Iso Contour Distance 3D Image Filter");
00140 class IsoContourDistanceImage3DFilterController : public IsoContourDistanceImageFilterControllerBase< ImageTypes<3>::InternalImageType >
00141 {
00142 public:
00143 typedef IsoContourDistanceImageFilterControllerBase< ImageTypes<3>::InternalImageType > Superclass;
00144 typedef IsoContourDistanceImage3DFilterController Self;
00145
00146 typedef Superclass::ComponentType ComponentType;
00147 typedef ComponentType::Pointer ComponentPointer;
00148 typedef Superclass::GenericComponentType GenericComponentType;
00149 typedef Superclass::GenericComponentPointer GenericComponentPointer;
00150 typedef Superclass::GenericMediaPointer GenericMediaPointer;
00151
00152 itkTypeMacro(IsoContourDistanceImage3DFilterController, IsoContourDistanceImageFilterControllerBase);
00153
00154 IsoContourDistanceImage3DFilterController();
00155 };
00156
00157 }
00158
00159 #endif