SMIL 1.1.2
Loading...
Searching...
No Matches

Base structuring element. More...

Detailed Description

Base structuring element.

#include <DStructuringElement.h>

+ Inheritance diagram for StrElt:
+ Collaboration diagram for StrElt:

Public Member Functions

 StrElt (UINT s=1)
 Class constructor - generic structurant element.
 
 StrElt (const StrElt &rhs)
 Class constructor - clone another structuring element.
 
 StrElt (bool oddSE, vector< UINT > indexList)
 Class constructor.
 
IntPoint getPoint (const UINT i)
 getPoint() - Get the coordinates (as a point) of the pixel of order i in the structuring element
 
UINT getSize () const
 getSize() - Get the size of the Structuring Element
 
StrEltoperator= (const StrElt &rhs)
 Clone a structuring element.
 
void clone (const StrElt &rhs)
 clone() - Clone a structuring element
 
void addPoint (const UINT index)
 addPoint() - Add a point to the structurant element based on an index on a grid.
 
void addPoint (int x, int y, int z=0)
 addPoint() - Add a point to the structurant element given its coordinates
 
void addPoint (const IntPoint &pt)
 addPoint() - Add a point to the structurant element given its coordinates in a IntPoint data structure.
 
const StrElt operator() (int s=1) const
 operator() -
 
StrElt homothety (const UINT s) const
 homothety() - Build and return an homothetic SE with size s
 
StrElt transpose () const
 transpose() - Return the opposite SE (symmetry with respect to 0)
 
StrElt merge (const StrElt &rhs)
 merge() - Merge a structuring element
 
StrElt noCenter () const
 Return the SE with no center.
 
virtual seType getType () const
 getType() - Get the type of the structuring element
 
void setName (string name)
 setName() - Set the name of the structuring element
 
void setName ()
 setName() - Set the name of the structuring element
 
const char * getName () const
 getName() - Get the name of the structuring element
 
virtual void printSelf (ostream &os=std::cout, string indent="") const
 printSelf() - Print the contents of the structuring element
 
virtual void printSelf (string indent) const
 printSelf() - Print the contents of the structuring element
 

Public Attributes

vector< IntPointpoints
 List of neighbor points.
 

Constructor & Destructor Documentation

◆ StrElt() [1/3]

StrElt ( UINT  s = 1)
inline

Class constructor - generic structurant element.

Parameters
[in]s: size of the structinrg element

◆ StrElt() [2/3]

StrElt ( const StrElt rhs)
inline

Class constructor - clone another structuring element.

Parameters
[in]rhs: structuring element

◆ StrElt() [3/3]

StrElt ( bool  oddSE,
vector< UINT >  indexList 
)
inline

Class constructor.

Construct a structuring element with points defined by their indexes.

Parameters
[in]oddSE: Specify if we want to use an hexagonal grid (true) or a square grid (false)
[in]indexList: The list of point indexes

The index values are defined for each grid type as follow:

Example:

# Create a diagonal SE with the two points (0,0) and (1,1),
# on the square grid:
diagSE_s = StrElt(False, (0,8))
# on the hexagonal grid:
diagSE_h = StrElt(True, (0,6))

Member Function Documentation

◆ getPoint()

IntPoint getPoint ( const UINT  i)
inline

getPoint() - Get the coordinates (as a point) of the pixel of order i in the structuring element

Parameters
[in]i: pixel index
Returns
the coordinates of the pixel, relative to the StrElt center

◆ getSize()

UINT getSize ( ) const
inline

getSize() - Get the size of the Structuring Element

Returns
the size of the structuring element

◆ operator=()

StrElt & operator= ( const StrElt rhs)

Clone a structuring element.

Clone a strunturing element to, eventually, create another one based on it.

Example:

import smilPython as sp
se = sp.VertSE()
se.addPoint(1,0)
print(se)
# print result :
Structuring Element
Type : 5 VertSE
Size : 1
Point Nbr : 4
#1: (0,0,0)
#2: (0,-1,0)
#3: (0,1,0)
#4: (1,0,0)

◆ clone()

void clone ( const StrElt rhs)

clone() - Clone a structuring element

Parameters
[in]rhs: structuring element to be cloned

◆ addPoint() [1/3]

void addPoint ( const UINT  index)

addPoint() - Add a point to the structurant element based on an index on a grid.

Index are defined as in the following drawings :

  • Grids : Square and Hexagonal
Parameters
[in]index: index to predefined point coordinates, as above.

Example:

import smilPython as sp
# Create a diagonal structuring element in a square grid,
diagSE_s = sp.StrElt(False)
diagSE_s.addPoint(0)
diagSE_s.addPoint(4)
diagSE_s.addPoint(8)
# Create a diagonal structuring element in an hexagonal grid:
diagSE_h = sp.StrElt(True)
diagSE_h.addPoint(0)
diagSE_h.addPoint(3)
diagSE_h.addPoint(6)

◆ addPoint() [2/3]

void addPoint ( int  x,
int  y,
int  z = 0 
)

addPoint() - Add a point to the structurant element given its coordinates

Parameters
[in]x,y,[z]: point coordinates

◆ addPoint() [3/3]

void addPoint ( const IntPoint pt)

addPoint() - Add a point to the structurant element given its coordinates in a IntPoint data structure.

Parameters
[in]pt: a point to be added to the structuring element (itself)

◆ homothety()

StrElt homothety ( const UINT  s) const

homothety() - Build and return an homothetic SE with size s

Parameters
[in]s: size of the new structuring element
Returns
a structuring element of size s

◆ transpose()

StrElt transpose ( ) const

transpose() - Return the opposite SE (symmetry with respect to 0)

Returns
a structuring element

◆ merge()

StrElt merge ( const StrElt rhs)

merge() - Merge a structuring element

Parameters
[in]rhs: structuring element to be merged
Returns
a structuring element

◆ noCenter()

StrElt noCenter ( ) const

Return the SE with no center.

Remove the central point of the Structuring Element

Returns
a structuring element

◆ getType()

virtual seType getType ( ) const
inlinevirtual

getType() - Get the type of the structuring element

Returns
the content of the seT private field

◆ setName() [1/2]

void setName ( string  name)
inline

setName() - Set the name of the structuring element

Parameters
[in]name- the new name

◆ setName() [2/2]

void setName ( )
inline

setName() - Set the name of the structuring element

Set the structuring element based on the type field seT

◆ getName()

const char * getName ( ) const
inlinevirtual

getName() - Get the name of the structuring element

Returns
the name of the structuring element (as a string)

Reimplemented from BaseObject.

◆ printSelf() [1/2]

void printSelf ( ostream &  os = std::cout,
string  indent = "" 
) const
virtual

printSelf() - Print the contents of the structuring element

Note
In Python this has the same effect than print(se)

Reimplemented from BaseObject.

◆ printSelf() [2/2]

virtual void printSelf ( string  indent) const
inlinevirtual

printSelf() - Print the contents of the structuring element

Note
In Python this has the same effect than print(se)

The documentation for this class was generated from the following files: