35 #ifndef AIMS_SIGNALFILTER_FILTERINGFUNCTION_ELEMENT_H
36 #define AIMS_SIGNALFILTER_FILTERINGFUNCTION_ELEMENT_H
46 template <
typename T>
class VolumeRef;
47 template <
typename T>
class rc_ptr;
52 class StructuringElement;
107 static std::set<std::string>
names();
110 static std::map<std::string,carto::rc_ptr<ElementFilteringFunction<T> > > &
_map();
120 #define AIMS_DECLARE_ELEMENTFILTERFUNC_CUSTOMIZED( NAME ) \
121 template <typename T> \
122 class NAME: public ElementFilteringFunction<T> \
125 NAME( carto::Object options = carto::none() ) \
126 { setOptions( options ); } \
127 NAME( const NAME<T> & other ); \
129 NAME<T> & operator=( const NAME<T> & other ); \
130 virtual NAME<T> *clone() const { return new NAME<T>(*this); } \
131 virtual void setOptions( const carto::Object & options ); \
132 virtual T execute( const carto::VolumeRef<T> & in ) const; \
133 virtual T execute( const carto::VolumeRef<T> & in, \
134 const carto::rc_ptr<StructuringElement> & se ) const;
136 #define AIMS_DEFINE_ELEMENTFILTERFUNC_BASIC( NAME ) \
137 template <typename T> \
138 NAME<T>::NAME( const NAME<T> & ) : ElementFilteringFunction<T>() {} \
139 template <typename T> \
140 NAME<T>::~NAME() {} \
141 template <typename T> \
142 NAME<T> & NAME<T>::operator=( const NAME<T> & ) { return *this; } \
143 template <typename T> \
144 void NAME<T>::setOptions( const carto::Object & ) {}
146 #define AIMS_DECLARE_ELEMENTFILTERFUNC_BASIC( NAME ) \
147 AIMS_DECLARE_ELEMENTFILTERFUNC_CUSTOMIZED(NAME) \
149 AIMS_DEFINE_ELEMENTFILTERFUNC_BASIC(NAME)
Associates a string with a ElementFilteringFunction.
static std::set< std::string > names()
List all function ids registered in the factory.
static std::map< std::string, carto::rc_ptr< ElementFilteringFunction< T > > > & _map()
static ElementFilteringFunction< T > * create(const std::string &name, carto::Object options=carto::none())
Build and return the ElementFilteringFunction associated with the id name.
static void registerFunction(const std::string &name, const ElementFilteringFunction< T > &func)
Register a ElementFilterigFunction into the factory.
Base class for filtering functions applied in a structuring element.
virtual ElementFilteringFunction< T > * clone() const =0
clone
virtual T execute(const carto::VolumeRef< T > &in) const =0
virtual ~ElementFilteringFunction()
ElementFilteringFunction< T > & operator=(const ElementFilteringFunction< T > &)
ElementFilteringFunction()
virtual T execute(const carto::VolumeRef< T > &in, const carto::rc_ptr< StructuringElement > &se) const =0
ElementFilteringFunction(const ElementFilteringFunction< T > &)
Pure virtual class: interface for filtering functions called by aims::FilteringImageAlgorithm and aim...
#define AIMS_DECLARE_ELEMENTFILTERFUNC_BASIC(NAME)