00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef __freMaskImageFilterController_h
00023 #define __freMaskImageFilterController_h
00024
00025 #include "freBinaryFunctorImageFilterControllerBase.h"
00026
00027 #include "itkMaskImageFilter.h"
00028
00029 namespace FREE
00030 {
00031
00041 freControllerIDMacro(MaskImageFilterControllerBase, "MaskImageFilterBase");
00042 template <class TInputImage, class TMaskImage>
00043 class MaskImageFilterControllerBase : public BinaryFunctorImageFilterControllerBase< itk::MaskImageFilter<TInputImage, TMaskImage, TInputImage> >
00044 {
00045 public:
00046 typedef itk::MaskImageFilter<TInputImage, TMaskImage, TInputImage> ComponentType;
00047 typedef BinaryFunctorImageFilterControllerBase<ComponentType> Superclass;
00048 typedef MaskImageFilterControllerBase<TInputImage, TMaskImage> 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(OutsideValue);
00056
00057 itkTypeMacro(MaskImageFilterControllerBase, BinaryFunctorImageFilterControllerBase);
00058
00059 protected:
00060 MaskImageFilterControllerBase()
00061 {
00062
00063 this->UpdateControllerID(ControllerID::MaskImageFilterControllerBase);
00064 this->m_Description = "Basis for itk::MaskImageFilter";
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
00074 profile.Parameters().AddParameter(cParam_OutsideValue,Parameter::PVTDouble,cParamDsc_OutsideValue,1,"0.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 dOutsideValue;
00085
00086 try
00087 {
00088 SessionAccessor::GetParameterValue(pComponentCache,cParam_OutsideValue,dOutsideValue);
00089 }
00090 catchAllNPassMacro("Error while retrieving parameter values.");
00091
00092 typedef typename ComponentType::InputImagePixelType InputPixelType;
00093 pMainComponent->SetOutsideValue(InputPixelType(dOutsideValue));
00094 };
00095 };
00096
00097 template <class TInputImage, class TMaskImage>
00098 const char* const MaskImageFilterControllerBase<TInputImage, TMaskImage> :: cParam_OutsideValue = "OutsideValue";
00099 template <class TInputImage, class TMaskImage>
00100 const char* const MaskImageFilterControllerBase<TInputImage, TMaskImage> :: cParamDsc_OutsideValue = "Value of all pixels which are not covered by the mask.";
00101
00107 freControllerIDMacro(Mask2DImageFilterController, "Mask 2D Image Filter");
00108 class Mask2DImageFilterController : public MaskImageFilterControllerBase< ImageTypes<2>::InternalImageType, ImageTypes<2>::InternalImageType>
00109 {
00110 public:
00111 typedef MaskImageFilterControllerBase< ImageTypes<2>::InternalImageType, ImageTypes<2>::InternalImageType > Superclass;
00112 typedef Mask2DImageFilterController 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(Mask2DImageFilterController, MaskImageFilterControllerBase);
00121
00122 Mask2DImageFilterController();
00123 };
00124
00130 freControllerIDMacro(Mask3DImageFilterController, "Mask 3D Image Filter");
00131 class Mask3DImageFilterController : public MaskImageFilterControllerBase< ImageTypes<3>::InternalImageType, ImageTypes<3>::InternalImageType >
00132 {
00133 public:
00134 typedef MaskImageFilterControllerBase< ImageTypes<3>::InternalImageType, ImageTypes<3>::InternalImageType > Superclass;
00135 typedef Mask3DImageFilterController 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(Mask3DImageFilterController, MaskImageFilterControllerBase);
00144
00145 Mask3DImageFilterController();
00146 };
00147
00153 freControllerIDMacro(Mask2DTransformFieldFilterController, "Mask 2D Transformation Field Filter");
00154 class Mask2DTransformFieldFilterController : public MaskImageFilterControllerBase< ImageTypes<2>::TransformationFieldType, ImageTypes<2>::InternalImageType>
00155 {
00156 public:
00157 typedef MaskImageFilterControllerBase< ImageTypes<2>::TransformationFieldType, ImageTypes<2>::InternalImageType > Superclass;
00158 typedef Mask2DTransformFieldFilterController Self;
00159
00160 typedef Superclass::ComponentType ComponentType;
00161 typedef ComponentType::Pointer ComponentPointer;
00162 typedef Superclass::GenericComponentType GenericComponentType;
00163 typedef Superclass::GenericComponentPointer GenericComponentPointer;
00164 typedef Superclass::GenericMediaPointer GenericMediaPointer;
00165
00166 itkTypeMacro(Mask2DTransformFieldFilterController, MaskImageFilterControllerBase);
00167
00168 Mask2DTransformFieldFilterController();
00169 };
00170
00176 freControllerIDMacro(Mask3DTransformFieldFilterController, "Mask 3D Transformation Field Filter");
00177 class Mask3DTransformFieldFilterController : public MaskImageFilterControllerBase< ImageTypes<3>::TransformationFieldType, ImageTypes<3>::InternalImageType >
00178 {
00179 public:
00180 typedef MaskImageFilterControllerBase< ImageTypes<3>::TransformationFieldType, ImageTypes<3>::InternalImageType > Superclass;
00181 typedef Mask3DTransformFieldFilterController Self;
00182
00183 typedef Superclass::ComponentType ComponentType;
00184 typedef ComponentType::Pointer ComponentPointer;
00185 typedef Superclass::GenericComponentType GenericComponentType;
00186 typedef Superclass::GenericComponentPointer GenericComponentPointer;
00187 typedef Superclass::GenericMediaPointer GenericMediaPointer;
00188
00189 itkTypeMacro(Mask3DTransformFieldFilterController, MaskImageFilterControllerBase);
00190
00191 Mask3DTransformFieldFilterController();
00192 };
00193
00194 }
00195
00196 #endif