Horus Doc || C++ Reference || Class Overview   Pixels   Images   Detector   Geometry   Registry || Doxygen's quick Index  

HxNgbLWshed2d Class Template Reference

Neighbourhood functor for watershed segmentation this look in a vecinity and decides if there is a border The smallest neighbour (if not wshed) is replaced by wshed value. More...

#include <HxNgbLWshed2d.h>

List of all members.

Public Types

typedef HxTagLoop IteratorCategory
 Loop version. More...

typedef HxTag1Phase PhaseCategory
 1 phase. More...


Public Methods

 HxNgbLWshed2d (HxTagList &tags)
 Constructor. More...

 ~HxNgbLWshed2d ()
 Destructor. More...

HxSizes size ()
 Size of the neighbourhood. More...

void init (int, int, ArgType)
 Initialization. More...

void next (int x, int y, ArgType value)
 Processing one pixel. More...

ResType result () const
 Produce the result value. More...


Static Public Methods

HxString className ()
 The name : "lwshed". More...


Detailed Description

template<class ArgType, class ResType>
class HxNgbLWshed2d< ArgType, ResType >

Neighbourhood functor for watershed segmentation this look in a vecinity and decides if there is a border The smallest neighbour (if not wshed) is replaced by wshed value.


Member Typedef Documentation

template<class ArgType, class ResType>
typedef HxTagLoop HxNgbLWshed2d::IteratorCategory
 

Loop version.

template<class ArgType, class ResType>
typedef HxTag1Phase HxNgbLWshed2d::PhaseCategory
 

1 phase.


Constructor & Destructor Documentation

template<class ArgType, class ResType>
HxNgbLWshed2d< ArgType, ResType >::HxNgbLWshed2d HxTagList   tags
 

Constructor.

Taglist should contain: int "conn", int "wshedval"

00025     : _values(0)
00026 {
00027     _size       = HxGetTag(tags, "size", 3);
00028     _wshedval   = HxGetTag(tags, "wshedval", -3);
00029     _conn       = HxGetTag(tags, "conn", 8);
00030     _pctIdx     = 4;
00031 
00032     _values = new ArgType[_size * _size];
00033 
00034 }

template<class ArgType, class ResType>
HxNgbLWshed2d< ArgType, ResType >::~HxNgbLWshed2d  
 

Destructor.

00038 {
00039     if (_values)
00040         delete [] _values;
00041 }


Member Function Documentation

template<class ArgType, class ResType>
HxSizes HxNgbLWshed2d< ArgType, ResType >::size   [inline]
 

Size of the neighbourhood.

00105 {
00106 //    return HxSizes(_size, _size, 1);
00107     return HxSizes(3, 3, 1);
00108 }

template<class ArgType, class ResType>
void HxNgbLWshed2d< ArgType, ResType >::init int   ,
int   ,
ArgType   
[inline]
 

Initialization.

00091 {
00092     _i = 0;
00093 }

template<class ArgType, class ResType>
void HxNgbLWshed2d< ArgType, ResType >::next int    x,
int    y,
ArgType    value
[inline]
 

Processing one pixel.

00098 {
00099     _values[_i++] = value;
00100 }

template<class ArgType, class ResType>
ResType HxNgbLWshed2d< ArgType, ResType >::result   const [inline]
 

Produce the result value.

00113 {
00114     ArgType minval=_values[_pctIdx];
00115     if(_conn==4)
00116     {
00117         if( _values[1] < minval && _values[1]>_wshedval)
00118             minval = _values[1];
00119         if( _values[3] < minval && _values[3]>_wshedval)
00120             minval = _values[3];
00121         if( _values[5] < minval && _values[5]>_wshedval)
00122             minval = _values[5];
00123         if( _values[7] < minval && _values[7]>_wshedval)
00124             minval = _values[7];
00125 
00126         if(minval<_values[_pctIdx])
00127             return _wshedval;
00128         else
00129             return _values[_pctIdx];
00130     }
00131     if(_conn==8)
00132     {
00133         if( _values[0] < minval && _values[0]>_wshedval)
00134             minval = _values[0];
00135         if( _values[1] < minval && _values[1]>_wshedval)
00136             minval = _values[1];
00137         if( _values[2] < minval && _values[2]>_wshedval)
00138             minval = _values[2];
00139         if( _values[3] < minval && _values[3]>_wshedval)
00140             minval = _values[3];
00141         if( _values[5] < minval && _values[5]>_wshedval)
00142             minval = _values[5];
00143         if( _values[6] < minval && _values[6]>_wshedval)
00144             minval = _values[6];
00145         if( _values[7] < minval && _values[7]>_wshedval)
00146             minval = _values[7];
00147         if( _values[8] < minval && _values[8]>_wshedval)
00148             minval = _values[8];
00149 
00150         if(minval>_wshedval && minval<_values[_pctIdx])
00151             return _wshedval;
00152         else
00153             return _values[_pctIdx];
00154     }
00155 
00156     return _values[_pctIdx];
00157 }

template<class ArgType, class ResType>
HxString HxNgbLWshed2d< ArgType, ResType >::className   [inline, static]
 

The name : "lwshed".

00083 {
00084     static HxString s("lwshed");
00085     return s;
00086 }


The documentation for this class was generated from the following files:
Generated on Mon Jan 27 15:49:08 2003 for C++Reference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001