00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef __freDanielssonDistanceMapImageFilterController_h
00023 #define __freDanielssonDistanceMapImageFilterController_h
00024
00025 #include "freImageToImageFilterControllerBase.h"
00026
00027 #include "itkDanielssonDistanceMapImageFilter.h"
00028
00029 namespace FREE
00030 {
00031
00041 freControllerIDMacro(DanielssonDistanceMapImageFilterControllerBase, "DanielssonDistanceMapImageFilterBase");
00042 template <class TInputImage>
00043 class DanielssonDistanceMapImageFilterControllerBase : public ImageToImageFilterControllerBase< itk::DanielssonDistanceMapImageFilter<TInputImage, TInputImage> >
00044 {
00045 public:
00046 typedef itk::DanielssonDistanceMapImageFilter<TInputImage, TInputImage> ComponentType;
00047 typedef ImageToImageFilterControllerBase<ComponentType> Superclass;
00048 typedef DanielssonDistanceMapImageFilterControllerBase<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(InputIsBinary);
00056 DeclareParameterMacro(SquaredDistance);
00057 DeclareParameterMacro(UseImageSpacing);
00058
00059 itkTypeMacro(DanielssonDistanceMapImageFilterControllerBase, ImageToImageFilterControllerBase);
00060
00061 protected:
00062 DanielssonDistanceMapImageFilterControllerBase()
00063 {
00064
00065 this->UpdateControllerID(ControllerID::DanielssonDistanceMapImageFilterControllerBase);
00066 this->m_Description = "Basis for itk::DanielssonDistanceMapImageFilter";
00067 };
00068
00069 virtual void GenerateProfile(CtrlProfile::ControllerProfile& profile,
00070 const SessionComponentCache* pComponentCache,
00071 bool bRegardOldSetup) const
00072 {
00073 Superclass::GenerateProfile(profile,pComponentCache,bRegardOldSetup);
00074
00075
00076 profile.Parameters().AddParameter(cParam_InputIsBinary,Parameter::PVTBool,cParamDsc_InputIsBinary,1,"false");
00077 profile.Parameters().AddParameter(cParam_SquaredDistance,Parameter::PVTBool,cParamDsc_SquaredDistance,1,"false");
00078 profile.Parameters().AddParameter(cParam_UseImageSpacing,Parameter::PVTBool,cParamDsc_UseImageSpacing,1,"true");
00079 };
00080
00081 virtual void ActualizeMainComponent(ComponentType* pMainComponent,
00082 SessionComponentCache* pComponentCache,
00083 SessionInfo* pSessionInfo,
00084 const unsigned int& iActLevel) const
00085 {
00086 Superclass::ActualizeMainComponent(pMainComponent,pComponentCache, pSessionInfo, iActLevel);
00087
00088 bool bInputIsBinary;
00089 bool bSquaredDistance;
00090 bool bUseImageSpacing;
00091
00092 try
00093 {
00094 SessionAccessor::GetParameterValue(pComponentCache,cParam_InputIsBinary,bInputIsBinary);
00095 SessionAccessor::GetParameterValue(pComponentCache,cParam_SquaredDistance,bSquaredDistance);
00096 SessionAccessor::GetParameterValue(pComponentCache,cParam_UseImageSpacing,bUseImageSpacing);
00097 }
00098 catchAllNPassMacro("Error while retrieving parameter values.");
00099
00100 pMainComponent->SetInputIsBinary(bInputIsBinary);
00101 pMainComponent->SetSquaredDistance(bSquaredDistance);
00102 pMainComponent->SetUseImageSpacing(bUseImageSpacing);
00103 };
00104
00105 };
00106
00107 template <class TInputImage>
00108 const char* const DanielssonDistanceMapImageFilterControllerBase<TInputImage> :: cParam_InputIsBinary = "InputIsBinary";
00109 template <class TInputImage>
00110 const char* const DanielssonDistanceMapImageFilterControllerBase<TInputImage> :: cParamDsc_InputIsBinary = "Indicates if input image is binary and therefore any nonzero pixel is a singel object.";
00111 template <class TInputImage>
00112 const char* const DanielssonDistanceMapImageFilterControllerBase<TInputImage> :: cParam_SquaredDistance = "SquaredDistance";
00113 template <class TInputImage>
00114 const char* const DanielssonDistanceMapImageFilterControllerBase<TInputImage> :: cParamDsc_SquaredDistance = "Indicates if the distance map should contain the squared dinstances.";
00115 template <class TInputImage>
00116 const char* const DanielssonDistanceMapImageFilterControllerBase<TInputImage> :: cParam_UseImageSpacing = "UseImageSpacing";
00117 template <class TInputImage>
00118 const char* const DanielssonDistanceMapImageFilterControllerBase<TInputImage> :: cParamDsc_UseImageSpacing = "Indicates if the distance should be calculated by using the spacing of the image.";
00119
00125 freControllerIDMacro(DanielssonDistanceMap2DImageFilterController, "Danielsson Distance Map 2D Image Filter");
00126 class DanielssonDistanceMap2DImageFilterController : public DanielssonDistanceMapImageFilterControllerBase< ImageTypes<2>::InternalImageType >
00127 {
00128 public:
00129 typedef DanielssonDistanceMapImageFilterControllerBase< ImageTypes<2>::InternalImageType > Superclass;
00130 typedef DanielssonDistanceMap2DImageFilterController Self;
00131
00132 typedef Superclass::ComponentType ComponentType;
00133 typedef ComponentType::Pointer ComponentPointer;
00134 typedef Superclass::GenericComponentType GenericComponentType;
00135 typedef Superclass::GenericComponentPointer GenericComponentPointer;
00136 typedef Superclass::GenericMediaPointer GenericMediaPointer;
00137
00138 itkTypeMacro(DanielssonDistanceMap2DImageFilterController, DanielssonDistanceMapImageFilterControllerBase);
00139
00140 DanielssonDistanceMap2DImageFilterController();
00141 };
00142
00148 freControllerIDMacro(DanielssonDistanceMap3DImageFilterController, "Danielsson Distance Map 3D Image Filter");
00149 class DanielssonDistanceMap3DImageFilterController : public DanielssonDistanceMapImageFilterControllerBase< ImageTypes<3>::InternalImageType >
00150 {
00151 public:
00152 typedef DanielssonDistanceMapImageFilterControllerBase< ImageTypes<3>::InternalImageType > Superclass;
00153 typedef DanielssonDistanceMap3DImageFilterController Self;
00154
00155 typedef Superclass::ComponentType ComponentType;
00156 typedef ComponentType::Pointer ComponentPointer;
00157 typedef Superclass::GenericComponentType GenericComponentType;
00158 typedef Superclass::GenericComponentPointer GenericComponentPointer;
00159 typedef Superclass::GenericMediaPointer GenericMediaPointer;
00160
00161 itkTypeMacro(DanielssonDistanceMap3DImageFilterController, DanielssonDistanceMapImageFilterControllerBase);
00162
00163 DanielssonDistanceMap3DImageFilterController();
00164 };
00165
00166 }
00167
00168 #endif