NumCpp  2.12.1
A Templatized Header Only C++ Implementation of the Python NumPy Library
nc::imageProcessing::Cluster< dtype > Class Template Reference

Holds the information for a cluster of pixels. More...

#include <Cluster.hpp>

Public Types

using accumulator_t = typename std::conditional< std::is_integral< dtype >::value, int64, double >::type
 
using const_iterator = typename std::vector< Pixel< dtype > >::const_iterator
 

Public Member Functions

 Cluster ()=default
 
 Cluster (uint32 inClusterId) noexcept
 
void addPixel (const Pixel< dtype > &inPixel)
 
const Pixel< dtype > & at (uint32 inIndex) const
 
const_iterator begin () const noexcept
 
uint32 clusterId () const noexcept
 
uint32 colMax () const noexcept
 
uint32 colMin () const noexcept
 
const_iterator end () const noexcept
 
double eod () const noexcept
 
uint32 height () const noexcept
 
accumulator_t intensity () const noexcept
 
bool operator!= (const Cluster< dtype > &rhs) const noexcept
 
bool operator== (const Cluster< dtype > &rhs) const noexcept
 
const Pixel< dtype > & operator[] (uint32 inIndex) const noexcept
 
dtype peakPixelIntensity () const noexcept
 
void print () const
 
uint32 rowMax () const noexcept
 
uint32 rowMin () const noexcept
 
uint32 size () const noexcept
 
std::string str () const
 
uint32 width () const noexcept
 

Friends

std::ostream & operator<< (std::ostream &inStream, const Cluster< dtype > &inCluster)
 

Detailed Description

template<typename dtype>
class nc::imageProcessing::Cluster< dtype >

Holds the information for a cluster of pixels.

Member Typedef Documentation

◆ accumulator_t

template<typename dtype >
using nc::imageProcessing::Cluster< dtype >::accumulator_t = typename std::conditional<std::is_integral<dtype>::value, int64, double>::type

◆ const_iterator

template<typename dtype >
using nc::imageProcessing::Cluster< dtype >::const_iterator = typename std::vector<Pixel<dtype> >::const_iterator

Constructor & Destructor Documentation

◆ Cluster() [1/2]

template<typename dtype >
nc::imageProcessing::Cluster< dtype >::Cluster ( )
default

default constructor needed by containers

◆ Cluster() [2/2]

template<typename dtype >
nc::imageProcessing::Cluster< dtype >::Cluster ( uint32  inClusterId)
inlineexplicitnoexcept

constructor

Parameters
inClusterId

Member Function Documentation

◆ addPixel()

template<typename dtype >
void nc::imageProcessing::Cluster< dtype >::addPixel ( const Pixel< dtype > &  inPixel)
inline

adds a pixel to the cluster

Parameters
inPixel

◆ at()

template<typename dtype >
const Pixel< dtype > & nc::imageProcessing::Cluster< dtype >::at ( uint32  inIndex) const
inline

access method with bounds checking

Parameters
inIndex
Returns
Pixel

◆ begin()

template<typename dtype >
const_iterator nc::imageProcessing::Cluster< dtype >::begin ( ) const
inlinenoexcept

returns in iterator to the beginning pixel of the cluster

Returns
const_iterator

◆ clusterId()

template<typename dtype >
uint32 nc::imageProcessing::Cluster< dtype >::clusterId ( ) const
inlinenoexcept

returns the minimum row number of the cluster

Returns
minimum row number of the cluster

◆ colMax()

template<typename dtype >
uint32 nc::imageProcessing::Cluster< dtype >::colMax ( ) const
inlinenoexcept

returns the maximum column number of the cluster

Returns
maximum column number of the cluster

◆ colMin()

template<typename dtype >
uint32 nc::imageProcessing::Cluster< dtype >::colMin ( ) const
inlinenoexcept

returns the minimum column number of the cluster

Returns
minimum column number of the cluster

◆ end()

template<typename dtype >
const_iterator nc::imageProcessing::Cluster< dtype >::end ( ) const
inlinenoexcept

returns in iterator to the 1 past the end pixel of the cluster

Returns
const_iterator

◆ eod()

template<typename dtype >
double nc::imageProcessing::Cluster< dtype >::eod ( ) const
inlinenoexcept

returns the cluster estimated energy on detector (EOD)

Returns
eod

◆ height()

template<typename dtype >
uint32 nc::imageProcessing::Cluster< dtype >::height ( ) const
inlinenoexcept

returns the number of rows the cluster spans

Returns
number of rows

◆ intensity()

template<typename dtype >
accumulator_t nc::imageProcessing::Cluster< dtype >::intensity ( ) const
inlinenoexcept

returns the summed intensity of the cluster

Returns
summed cluster intensity

◆ operator!=()

template<typename dtype >
bool nc::imageProcessing::Cluster< dtype >::operator!= ( const Cluster< dtype > &  rhs) const
inlinenoexcept

not equality operator

Parameters
rhs
Returns
bool

◆ operator==()

template<typename dtype >
bool nc::imageProcessing::Cluster< dtype >::operator== ( const Cluster< dtype > &  rhs) const
inlinenoexcept

equality operator

Parameters
rhs
Returns
bool

◆ operator[]()

template<typename dtype >
const Pixel< dtype > & nc::imageProcessing::Cluster< dtype >::operator[] ( uint32  inIndex) const
inlinenoexcept

access operator, no bounds checking

Parameters
inIndex
Returns
Pixel

◆ peakPixelIntensity()

template<typename dtype >
dtype nc::imageProcessing::Cluster< dtype >::peakPixelIntensity ( ) const
inlinenoexcept

returns the intensity of the peak pixel in the cluster

Returns
peak pixel intensity

◆ print()

template<typename dtype >
void nc::imageProcessing::Cluster< dtype >::print ( ) const
inline

Method Description: prints the Cluster object to the console

◆ rowMax()

template<typename dtype >
uint32 nc::imageProcessing::Cluster< dtype >::rowMax ( ) const
inlinenoexcept

returns the maximum row number of the cluster

Returns
maximum row number of the cluster

◆ rowMin()

template<typename dtype >
uint32 nc::imageProcessing::Cluster< dtype >::rowMin ( ) const
inlinenoexcept

returns the minimum row number of the cluster

Returns
minimum row number of the cluster

◆ size()

template<typename dtype >
uint32 nc::imageProcessing::Cluster< dtype >::size ( ) const
inlinenoexcept

returns the number of pixels in the cluster

Returns
number of pixels in the cluster

◆ str()

template<typename dtype >
std::string nc::imageProcessing::Cluster< dtype >::str ( ) const
inline

returns a string representation of the cluster

Returns
string

◆ width()

template<typename dtype >
uint32 nc::imageProcessing::Cluster< dtype >::width ( ) const
inlinenoexcept

returns the number of columns the cluster spans

Returns
number of columns

Friends And Related Function Documentation

◆ operator<<

template<typename dtype >
std::ostream & operator<< ( std::ostream &  inStream,
const Cluster< dtype > &  inCluster 
)
friend

osstream operator

Parameters
inStream
inCluster
Returns
std::ostream

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