MeVisLabToolboxReference
|
00001 // **InsertLicense** code 00002 //---------------------------------------------------------------------------------- 00004 00009 //---------------------------------------------------------------------------------- 00010 #ifndef __mlITKFlatStructElement_H 00011 #define __mlITKFlatStructElement_H 00012 00014 #include "mlInitSystemITKSupport.h" 00015 00017 #include "mlModuleIncludes.h" 00018 #include "itkFlatStructuringElement.h" 00019 00020 00021 // Be sure that all your modules are part of the ml. So collisions 00022 // with names in system files or other libraries are minimized. 00023 ML_START_NAMESPACE 00024 00025 //---------------------------------------------------------------------------------- 00027 //---------------------------------------------------------------------------------- 00028 class MLITK_SUPPORT_EXPORT ITKFlatStructElement : public Module{ 00029 00030 public: 00031 00033 ITKFlatStructElement(); 00034 00036 enum { 00037 Box = 0, 00038 Ball, 00039 Cross, 00040 Annulus, 00041 Polygon, 00042 00043 NumFlatStructuringElements 00044 00045 } FlatStructureElementTypes; 00046 00048 static const char * const FlatStructuringElementTypeNames[NumFlatStructuringElements]; 00049 00051 template <size_t DIM> const itk::FlatStructuringElement<DIM> &getFlatStructuringElement() const; 00052 00053 protected: 00054 00056 virtual void activateAttachments(); 00057 00059 virtual void handleNotification(Field * field); 00060 00061 private: 00062 00064 BaseField *_outputBaseFld; 00065 00067 EnumField *_selectElementFld; 00068 00070 ImageVectorField *_radiusFld; 00071 00073 IntField *_thicknessFld; 00074 00076 BoolField *_includeCenterFld; 00077 00079 IntField *_numLinesFld; 00080 00082 00083 itk::FlatStructuringElement<1> _dim1FlatStructuringElement; 00084 itk::FlatStructuringElement<2> _dim2FlatStructuringElement; 00085 itk::FlatStructuringElement<3> _dim3FlatStructuringElement; 00086 itk::FlatStructuringElement<4> _dim4FlatStructuringElement; 00087 itk::FlatStructuringElement<5> _dim5FlatStructuringElement; 00088 itk::FlatStructuringElement<6> _dim6FlatStructuringElement; 00090 00093 ML_MODULE_CLASS_HEADER(ITKFlatStructElement) 00094 }; 00095 00096 00098 00099 template<> inline const itk::FlatStructuringElement<1> &ITKFlatStructElement::getFlatStructuringElement<1>() const { return _dim1FlatStructuringElement; }; 00100 template<> inline const itk::FlatStructuringElement<2> &ITKFlatStructElement::getFlatStructuringElement<2>() const { return _dim2FlatStructuringElement; }; 00101 template<> inline const itk::FlatStructuringElement<3> &ITKFlatStructElement::getFlatStructuringElement<3>() const { return _dim3FlatStructuringElement; }; 00102 template<> inline const itk::FlatStructuringElement<4> &ITKFlatStructElement::getFlatStructuringElement<4>() const { return _dim4FlatStructuringElement; }; 00103 template<> inline const itk::FlatStructuringElement<5> &ITKFlatStructElement::getFlatStructuringElement<5>() const { return _dim5FlatStructuringElement; }; 00104 template<> inline const itk::FlatStructuringElement<6> &ITKFlatStructElement::getFlatStructuringElement<6>() const { return _dim6FlatStructuringElement; }; 00106 00107 ML_END_NAMESPACE 00108 00109 #endif