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;
115 iterator
begin() {
return _vector.begin(); }
117 iterator
end() {
return _vector.end(); }
121 const_iterator
begin()
const {
return _vector.begin(); }
125 const_iterator
end()
const {
return _vector.end(); }
131 size_t size()
const {
return _vector.size(); }
135 const std::vector<Point3dl> &
getVector()
const {
return _vector; }
146 std::vector<int> getAmplitude(
const Point3dl & origin =
Point3dl(0,0,0) )
const;
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;
239 iterator
begin() {
return (*this)->begin(); }
240 iterator
end() {
return (*this)->end(); }
241 const_iterator
begin()
const {
return (*this)->begin(); }
242 const_iterator
end()
const {
return (*this)->end(); }
244 size_t size()
const {
return (*this)->size(); }
246 {
return (*this)->getVector(); }
249 {
return (*this)->getAmplitude(origin); }
276 virtual Shape* clone()
const = 0;
280 void setParameters(
const double amplitude = 1.,
281 const bool usecenter =
false );
282 void setParameters(
const Point3dl & origin,
283 const double amplitude = 1.,
284 const bool usecenter =
false );
285 void setParameters(
const Point3d & origin,
286 const double amplitude = 1,
287 const bool usecenter =
false );
288 void setParameters(
const std::vector<double> & amplitude,
289 const bool usecenter =
false );
290 void setParameters(
const Point3d & origin,
291 const std::vector<double> & amplitude,
292 const bool usecenter =
false );
295 virtual void setParameters(
const Point3dl & origin,
296 const std::vector<double> & amplitude,
297 const bool usecenter =
false ) = 0;
329 static Shape* create(
const std::string & type,
330 const double amplitude = 1.,
331 const bool usecenter =
false );
332 static Shape* create(
const std::string & type,
334 const double amplitude = 1.,
335 const bool usecenter =
false );
336 static Shape* create(
const std::string & type,
338 const double amplitude = 1.,
339 const bool usecenter =
false );
340 static Shape* create(
const std::string & type,
341 const std::vector<double> & amplitude,
342 const bool usecenter =
false );
343 static Shape* create(
const std::string & type,
345 const std::vector<double> & amplitude,
346 const bool usecenter =
false );
347 static Shape* create(
const std::string & type,
349 const std::vector<double> & amplitude,
350 const bool usecenter =
false );
351 static void registerShape(
const std::string & type,
352 const Shape & strel );
353 static std::set<std::string> shapes();
356 static std::map<std::string,carto::rc_ptr<Shape> > & _map();
383 typedef const bool (&Matrix3x3x3Const)[3][3][3];
393 virtual Matrix3x3x3Const getMatrix()
const = 0;
396 const bool usecenter =
false );
443 const bool usecenter =
false );
446 const bool usecenter =
false );
449 const bool usecenter =
false );
450 static void registerConnectivity(
const std::string & type,
452 static std::set<std::string> connectivities();
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()
528 { Shape::setParameters( amplitude, usecenter ); }
530 const double amplitude = 1.,
531 const bool usecenter =
false ): CircleXY()
532 { Shape::setParameters( origin, amplitude, usecenter ); }
534 const double amplitude = 1.,
535 const bool usecenter =
false ): CircleXY()
536 { Shape::setParameters( origin, amplitude, usecenter ); }
538 const bool usecenter =
false ): CircleXY()
539 { Shape::setParameters( amplitude, usecenter ); }
541 const std::vector<double> & amplitude,
542 const bool usecenter =
false ): CircleXY()
543 { Shape::setParameters( origin, amplitude, usecenter ); }
545 const std::vector<double> & amplitude,
546 const bool usecenter =
false ): CircleXY()
547 { setParameters( origin, amplitude, usecenter ); }
551 virtual void clockwise_order();
552 virtual void setParameters(
const Point3dl & origin,
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); } \
std::vector< Point3dl > _vector
StructuringElement(const std::vector< Point3dl > &vector)
iterator end()
Return iterator to end.
StructuredVolume< T >::const_iterator begin() const
StructuredVolume(carto::Volume< T > &vol, const StructuringElement &se)
#define AIMS_DECLARE_STREL_CONNECTIVITY(NAME)
const_iterator begin() const
virtual ~ClockWiseCircleXY()
aims::strel::Connectivity pure abstract class representing a "connectivity" 3D structuring element...
StructuredVolume< T >::const_iterator end() const
reference_wrapper< const T > cref(const T &ref)
The class for EcatSino data write operation.
const_iterator begin() const
Return const_iterator to beginning.
aims::strel::Connectivity generator
Class giving access to an iterator over the voxels of a volume inside of a structuring element...
const std::vector< Point3dl > & getVector() const
aims::strel::Shape generator
StructuringElement::iterator iterator
StructuredVolume< T >::iterator begin()
#define AIMS_DECLARE_STREL_SHAPE(NAME)
std::vector< carto::reference_wrapper< const T > > _vector
StructuringElement::const_iterator const_iterator
StructuringElement::const_iterator const_iterator
aims::StructuringElement class representing a 3D structuring element.
StructuringElement::const_iterator const_iterator
StructuringElementRef(StructuringElement *se)
New object constructor.
ClockWiseCircleXY(const Point3dl &origin, const double amplitude=1., const bool usecenter=false)
ClockWiseCircleXY(const Point3dl &origin, const std::vector< double > &litude, const bool usecenter=false)
Convenient handle for a StructuringElement.
StructuringElementRef()
Default constructor.
StructuredConstVolume< T >::const_iterator begin() const
StructuredConstVolume< T >::iterator end()
StructuredConstVolume(const carto::Volume< T > &vol, const StructuringElement &se)
std::vector< int > getAmplitude(const Point3dl &origin=Point3dl(0, 0, 0)) const
virtual ClockWiseCircleXY * clone() const
StructuringElement::iterator iterator
std::vector< carto::reference_wrapper< const T > >::const_iterator const_iterator
ClockWiseCircleXY(const Point3d &origin, const double amplitude=1., const bool usecenter=false)
std::vector< carto::reference_wrapper< T > >::const_iterator const_iterator
StructuringElementRef(const carto::rc_ptr< StructuringElement > &se)
Copy constructor.
ClockWiseCircleXY(const std::vector< double > &litude, const bool usecenter=false)
const_iterator end() const
std::vector< Point3dl >::iterator iterator
StructuredConstVolume< T >::iterator begin()
StructuredVolume< T >::iterator end()
iterator begin()
Return iterator to beginning.
ClockWiseCircleXY(const Point3d &origin, const std::vector< double > &litude, const bool usecenter=false)
StructuringElement::const_iterator const_iterator
ClockWiseCircleXY(const double amplitude=1., const bool usecenter=false)
std::vector< carto::reference_wrapper< T > >::iterator iterator
virtual ~StructuringElement()
std::vector< Point3dl >::const_iterator const_iterator
Object none()
Pointer to an empty aims::StructuringElement.
const_iterator end() const
Return const_iterator to end.
aims::strel::Shape pure abstract class representing a "shape" 3D structuring element.
std::vector< carto::reference_wrapper< const T > >::iterator iterator
const std::vector< Point3dl > & getVector() const
Return std::vector<Point3dl>
StructuringElement::iterator iterator
std::vector< carto::reference_wrapper< T > > _vector
StructuringElement::iterator iterator
StructuredConstVolume< T >::const_iterator end() const
reference_wrapper< T > ref(T &ref)
virtual StructuringElement * clone() const
Clone the StructuringElement.