GooseEYE 0.9.1
Loading...
Searching...
No Matches
GooseEYE::ClusterLabeller< Dimension, Periodicity > Class Template Reference

(Incrementally) Label clusters (0 as background, 1..n as labels). More...

#include <GooseEYE/GooseEYE.h>

Public Member Functions

template<class T >
 ClusterLabeller (const T &shape)
 
template<class T , class K >
 ClusterLabeller (const T &shape, const K &kernel)
 
void reset ()
 Reset labels to zero.
 
void prune ()
 Prune: renumber labels to lowest possible label, see also AvalancheSegmenter::nlabels.
 
template<class T >
void add_image (const T &img)
 Add image.
 
template<class T >
void add_points (const T &begin, const T &end)
 Add sequence of points.
 
template<class T >
void add_points (const T &idx)
 Add sequence of points.
 
template<class T >
std::vector< size_t > add_sequence (const T &idx)
 Add a sequence of points.
 
std::string repr () const
 Basic class info.
 
const auto & shape () const
 Shape of ClusterLabeller::s and ClusterLabeller::labels.
 
auto size () const
 Size of ClusterLabeller::s and ClusterLabeller::labels (== prod(shape)).
 
const auto & labels () const
 Per block, the label (0 for background).
 

Static Public Attributes

static constexpr size_t Dim = Dimension
 Dimensionality of the system.
 
static constexpr bool Periodic = Periodicity
 Periodicity of the system.
 

Detailed Description

template<size_t Dimension, bool Periodicity = true>
class GooseEYE::ClusterLabeller< Dimension, Periodicity >

(Incrementally) Label clusters (0 as background, 1..n as labels).

Template Parameters
DimensionThe rank (a.k.a. dimension) of the image.
Note
The default kernel is GooseEYE::kernel::nearest().

Definition at line 672 of file GooseEYE.h.

Constructor & Destructor Documentation

◆ ClusterLabeller() [1/2]

template<size_t Dimension, bool Periodicity = true>
template<class T >
GooseEYE::ClusterLabeller< Dimension, Periodicity >::ClusterLabeller ( const T & shape)
inline
Parameters
shapeShape of the system.

Definition at line 714 of file GooseEYE.h.

◆ ClusterLabeller() [2/2]

template<size_t Dimension, bool Periodicity = true>
template<class T , class K >
GooseEYE::ClusterLabeller< Dimension, Periodicity >::ClusterLabeller ( const T & shape,
const K & kernel )
inline
Parameters
shapeShape of the system.
kernelKernel (e.g. GooseEYE::kernel::nearest()).

Definition at line 738 of file GooseEYE.h.

Member Function Documentation

◆ add_image()

template<size_t Dimension, bool Periodicity = true>
template<class T >
void GooseEYE::ClusterLabeller< Dimension, Periodicity >::add_image ( const T & img)
inline

Add image.

Previous labels are not overwritten.

Parameters
imgImage (can be incremental only).

Definition at line 1025 of file GooseEYE.h.

◆ add_points() [1/2]

template<size_t Dimension, bool Periodicity = true>
template<class T >
void GooseEYE::ClusterLabeller< Dimension, Periodicity >::add_points ( const T & begin,
const T & end )
inline

Add sequence of points.

Parameters
beginIterator to first point.
endIterator to last point.

Definition at line 1061 of file GooseEYE.h.

◆ add_points() [2/2]

template<size_t Dimension, bool Periodicity = true>
template<class T >
void GooseEYE::ClusterLabeller< Dimension, Periodicity >::add_points ( const T & idx)
inline

Add sequence of points.

Parameters
idxList of points.

Definition at line 1078 of file GooseEYE.h.

◆ add_sequence()

template<size_t Dimension, bool Periodicity = true>
template<class T >
std::vector< size_t > GooseEYE::ClusterLabeller< Dimension, Periodicity >::add_sequence ( const T & idx)
inline

Add a sequence of points.

Mark index every time a new cluster is started or a cluster is merged.

Parameters
idxList of points.
Returns
List of indices.

Definition at line 1093 of file GooseEYE.h.

◆ labels()

template<size_t Dimension, bool Periodicity = true>
const auto & GooseEYE::ClusterLabeller< Dimension, Periodicity >::labels ( ) const
inline

Per block, the label (0 for background).

Returns
array of signed integers.

Definition at line 1165 of file GooseEYE.h.

◆ prune()

template<size_t Dimension, bool Periodicity = true>
void GooseEYE::ClusterLabeller< Dimension, Periodicity >::prune ( )
inline

Prune: renumber labels to lowest possible label, see also AvalancheSegmenter::nlabels.

Note
This might change all labels.

Definition at line 788 of file GooseEYE.h.

◆ repr()

template<size_t Dimension, bool Periodicity = true>
std::string GooseEYE::ClusterLabeller< Dimension, Periodicity >::repr ( ) const
inline

Basic class info.

Returns
std::string

Definition at line 1135 of file GooseEYE.h.

◆ reset()

template<size_t Dimension, bool Periodicity = true>
void GooseEYE::ClusterLabeller< Dimension, Periodicity >::reset ( )
inline

Reset labels to zero.

Definition at line 776 of file GooseEYE.h.

◆ shape()

template<size_t Dimension, bool Periodicity = true>
const auto & GooseEYE::ClusterLabeller< Dimension, Periodicity >::shape ( ) const
inline

Shape of ClusterLabeller::s and ClusterLabeller::labels.

Returns
Shape

Definition at line 1145 of file GooseEYE.h.

◆ size()

template<size_t Dimension, bool Periodicity = true>
auto GooseEYE::ClusterLabeller< Dimension, Periodicity >::size ( ) const
inline

Size of ClusterLabeller::s and ClusterLabeller::labels (== prod(shape)).

Returns
Size

Definition at line 1154 of file GooseEYE.h.

Member Data Documentation

◆ Dim

template<size_t Dimension, bool Periodicity = true>
constexpr size_t GooseEYE::ClusterLabeller< Dimension, Periodicity >::Dim = Dimension
staticconstexpr

Dimensionality of the system.

Definition at line 674 of file GooseEYE.h.

◆ Periodic

template<size_t Dimension, bool Periodicity = true>
constexpr bool GooseEYE::ClusterLabeller< Dimension, Periodicity >::Periodic = Periodicity
staticconstexpr

Periodicity of the system.

Definition at line 675 of file GooseEYE.h.


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