34 #ifndef AIMS_CONNECTIVITY_STRUCTURING_ELEMENT_2_H
35 #define AIMS_CONNECTIVITY_STRUCTURING_ELEMENT_2_H
49 template <
typename T>
class Volume;
95 typedef std::vector<Point3dl>::iterator
iterator;
159 template <
typename T>
170 for( i=se.
begin(); i!=e; ++i )
179 std::vector<carto::reference_wrapper<T> >
_vector;
183 template <
typename T>
194 for( i=se.
begin(); i!=e; ++i )
203 std::vector<carto::reference_wrapper<const T> >
_vector;
244 size_t size()
const {
return (*this)->size(); }
246 {
return (*this)->getVector(); }
249 {
return (*this)->getAmplitude(origin); }
281 const bool usecenter =
false );
283 const double amplitude = 1.,
284 const bool usecenter =
false );
286 const double amplitude = 1,
287 const bool usecenter =
false );
289 const bool usecenter =
false );
291 const std::vector<double> & amplitude,
292 const bool usecenter =
false );
296 const std::vector<double> & amplitude,
297 const bool usecenter =
false ) = 0;
330 const double amplitude = 1.,
331 const bool usecenter =
false );
334 const double amplitude = 1.,
335 const bool usecenter =
false );
338 const double amplitude = 1.,
339 const bool usecenter =
false );
341 const std::vector<double> & amplitude,
342 const bool usecenter =
false );
345 const std::vector<double> & amplitude,
346 const bool usecenter =
false );
349 const std::vector<double> & amplitude,
350 const bool usecenter =
false );
352 const Shape & strel );
356 static std::map<std::string,carto::rc_ptr<Shape> > &
_map();
396 const bool usecenter =
false );
443 const bool usecenter =
false );
446 const bool usecenter =
false );
449 const bool usecenter =
false );
455 static std::map<std::string,carto::rc_ptr<Connectivity> > &
_map();
465 #define AIMS_DECLARE_STREL_SHAPE( NAME ) \
466 class NAME: public Shape \
469 typedef StructuringElement::iterator iterator; \
470 typedef StructuringElement::const_iterator const_iterator; \
471 NAME( const double amplitude = 1., \
472 const bool usecenter = false ): Shape() \
473 { Shape::setParameters( amplitude, usecenter ); } \
474 NAME( const Point3d & origin, \
475 const double amplitude = 1., \
476 const bool usecenter = false ): Shape() \
477 { Shape::setParameters( origin, amplitude, usecenter ); } \
478 NAME( const Point3dl & origin, \
479 const double amplitude = 1., \
480 const bool usecenter = false ): Shape() \
481 { Shape::setParameters( origin, amplitude, usecenter ); } \
482 NAME( const std::vector<double> & amplitude, \
483 const bool usecenter = false ): Shape() \
484 { Shape::setParameters( amplitude, usecenter ); } \
485 NAME( const Point3d & origin, \
486 const std::vector<double> & amplitude, \
487 const bool usecenter = false ): Shape() \
488 { Shape::setParameters( origin, amplitude, usecenter ); } \
489 NAME( const Point3dl & origin, \
490 const std::vector<double> & amplitude, \
491 const bool usecenter = false ): Shape() \
492 { setParameters( origin, amplitude, usecenter ); } \
495 virtual void setParameters( const Point3dl & origin, \
496 const std::vector<double> & amplitude, \
497 const bool usecenter = false ); \
498 virtual NAME* clone() const { return new NAME(*this); } \
527 const bool usecenter =
false ): CircleXY()
530 const double amplitude = 1.,
531 const bool usecenter =
false ): CircleXY()
534 const double amplitude = 1.,
535 const bool usecenter =
false ): CircleXY()
538 const bool usecenter =
false ): CircleXY()
541 const std::vector<double> & amplitude,
542 const bool usecenter =
false ): CircleXY()
545 const std::vector<double> & amplitude,
546 const bool usecenter =
false ): CircleXY()
553 const std::vector<double> & amplitude,
554 const bool usecenter =
false );
565 #define AIMS_DECLARE_STREL_CONNECTIVITY( NAME ) \
566 class NAME: public Connectivity \
569 typedef StructuringElement::iterator iterator; \
570 typedef StructuringElement::const_iterator const_iterator; \
571 NAME(): Connectivity() { setVectorFromMatrix(); } \
573 Connectivity::Matrix3x3x3Const getMatrix() const; \
575 virtual NAME* clone() const \
576 { return new NAME(*this); } \
StructuredConstVolume< T >::iterator begin()
std::vector< carto::reference_wrapper< const T > > _vector
std::vector< carto::reference_wrapper< const T > >::const_iterator const_iterator
StructuredConstVolume< T >::iterator end()
StructuredConstVolume< T >::const_iterator end() const
StructuredConstVolume(const carto::Volume< T > &vol, const StructuringElement &se)
std::vector< carto::reference_wrapper< const T > >::iterator iterator
StructuredConstVolume< T >::const_iterator begin() const
Class giving access to an iterator over the voxels of a volume inside of a structuring element.
StructuredVolume< T >::iterator end()
std::vector< carto::reference_wrapper< T > >::iterator iterator
StructuredVolume< T >::iterator begin()
std::vector< carto::reference_wrapper< T > >::const_iterator const_iterator
StructuredVolume(carto::Volume< T > &vol, const StructuringElement &se)
StructuredVolume< T >::const_iterator begin() const
std::vector< carto::reference_wrapper< T > > _vector
StructuredVolume< T >::const_iterator end() const
Convenient handle for a StructuringElement.
StructuringElementRef()
Default constructor.
const_iterator begin() const
StructuringElementRef(StructuringElement *se)
New object constructor.
const std::vector< Point3dl > & getVector() const
const_iterator end() const
StructuringElement::iterator iterator
StructuringElementRef(const carto::rc_ptr< StructuringElement > &se)
Copy constructor.
StructuringElement::const_iterator const_iterator
std::vector< int > getAmplitude(const Point3dl &origin=Point3dl(0, 0, 0)) const
aims::StructuringElement class representing a 3D structuring element.
const_iterator begin() const
Return const_iterator to beginning.
iterator end()
Return iterator to end.
std::vector< int > getAmplitude(const Point3dl &origin=Point3dl(0, 0, 0)) const
Maximum distance to origin in each direction.
virtual ~StructuringElement()
iterator begin()
Return iterator to beginning.
const std::vector< Point3dl > & getVector() const
Return std::vector<Point3dl>
std::vector< Point3dl > _vector
const_iterator end() const
Return const_iterator to end.
std::vector< Point3dl >::iterator iterator
std::vector< Point3dl >::const_iterator const_iterator
virtual StructuringElement * clone() const
Clone the StructuringElement.
StructuringElement(const std::vector< Point3dl > &vector)
ClockWiseCircleXY(const Point3d &origin, const std::vector< double > &litude, const bool usecenter=false)
virtual void setParameters(const Point3dl &origin, const std::vector< double > &litude, const bool usecenter=false)
ClockWiseCircleXY(const Point3dl &origin, const std::vector< double > &litude, const bool usecenter=false)
ClockWiseCircleXY(const Point3dl &origin, const double amplitude=1., const bool usecenter=false)
ClockWiseCircleXY(const std::vector< double > &litude, const bool usecenter=false)
ClockWiseCircleXY(const double amplitude=1., const bool usecenter=false)
StructuringElement::const_iterator const_iterator
ClockWiseCircleXY(const Point3d &origin, const double amplitude=1., const bool usecenter=false)
virtual ~ClockWiseCircleXY()
virtual void clockwise_order()
StructuringElement::iterator iterator
virtual ClockWiseCircleXY * clone() const
aims::strel::Connectivity generator
static std::map< std::string, carto::rc_ptr< Connectivity > > & _map()
static Connectivity * create(const std::string &type, const bool usecenter=false)
static std::set< std::string > connectivities()
static Connectivity * create(const std::string &type, const Point3dl &origin, const bool usecenter=false)
static Connectivity * create(const std::string &type, const Point3d &origin, const bool usecenter=false)
static void registerConnectivity(const std::string &type, const Connectivity &strel)
aims::strel::Connectivity pure abstract class representing a "connectivity" 3D structuring element.
virtual Connectivity * clone() const =0
Clone the StructuringElement.
virtual Matrix3x3x3Const getMatrix() const =0
return the Matrix3x3x3Const representing a structuring element.
void setVectorFromMatrix(const Point3dl &origin=Point3dl(0, 0, 0), const bool usecenter=false)
StructuringElement::iterator iterator
const bool(& Matrix3x3x3Const)[3][3][3]
StructuringElement::const_iterator const_iterator
aims::strel::Shape generator
static Shape * create(const std::string &type, const double amplitude=1., const bool usecenter=false)
static Shape * create(const std::string &type, const Point3dl &origin, const double amplitude=1., const bool usecenter=false)
static std::set< std::string > shapes()
static void registerShape(const std::string &type, const Shape &strel)
static std::map< std::string, carto::rc_ptr< Shape > > & _map()
static Shape * create(const std::string &type, const Point3d &origin, const double amplitude=1., const bool usecenter=false)
static Shape * create(const std::string &type, const std::vector< double > &litude, const bool usecenter=false)
static Shape * create(const std::string &type, const Point3d &origin, const std::vector< double > &litude, const bool usecenter=false)
static Shape * create(const std::string &type, const Point3dl &origin, const std::vector< double > &litude, const bool usecenter=false)
aims::strel::Shape pure abstract class representing a "shape" 3D structuring element.
void setParameters(const double amplitude=1., const bool usecenter=false)
void setParameters(const Point3d &origin, const std::vector< double > &litude, const bool usecenter=false)
StructuringElement::const_iterator const_iterator
virtual Shape * clone() const =0
Clone the StructuringElement.
virtual void setParameters(const Point3dl &origin, const std::vector< double > &litude, const bool usecenter=false)=0
void setParameters(const std::vector< double > &litude, const bool usecenter=false)
void setParameters(const Point3dl &origin, const double amplitude=1., const bool usecenter=false)
void setParameters(const Point3d &origin, const double amplitude=1, const bool usecenter=false)
StructuringElement::iterator iterator
StructuringElementRef none()
Pointer to an empty aims::StructuringElement.
AIMS_DECLARE_STREL_CONNECTIVITY(Connectivity4XY)
AIMS_DECLARE_STREL_SHAPE(Cube)
The class for EcatSino data write operation.
reference_wrapper< const T > cref(const T &ref)
reference_wrapper< T > ref(T &ref)