STIRA  0.1
Public Member Functions | List of all members
stira::imageanalysis::WatershedMeyer< T > Class Template Reference

Template class for watershed transformations variant of Meyer algorithm, as used in Matlab http://www.mathworks.com/access/helpdesk/help/toolbox/images/watershed.html Meyer, Fernand, "Topographic distance and watershed lines," Signal Processing , Vol. 38, July 1994, pp. 113-125 Alternative watershed algorithms with source code can be found on http://www.esiee.fr/~info/tw/. More...

#include <WatershedMeyer.h>

Public Member Functions

 WatershedMeyer ()
 Default constructor.
 
 ~WatershedMeyer ()
 Destructor.
 
double GetMaxMinimaLevel ()
 Gets upper limit for pixel to be considered a minimum and thus serve as starting seed for flooding.
 
void SetMaxMinimaLevel (double maxLevel)
 Sets upper limit for pixel to be considered a minimum and thus serve as starting seed for flooding. More...
 
double GetEqualityPrecision ()
 Gets precision factor in pixel value comparison What is the minimum difference in value between pixels in order to consider them actually different.
 
void SetEqualityPrecision (double precision)
 Sets precision factor in pixel value comparison. More...
 
bool Run (ArrayGrid< T > *iInputImage, bool usegradientImage, std::string sourceDataName=std::string(""))
 Executes the transformation on iInputImage. More...
 
int GetNumberOfWatershedPixels ()
 Get the number of detected watershed pixels.
 
ArrayGrid< bool > * GetWatershedGrid ()
 Get grid where watershed points have value true; other points have value false.
 
int GetNumberOfLabels ()
 Get the number of watershed segments.
 
ArrayGrid< int > * GetLabelImage ()
 Get the grid with watershed labels.
 
ImageCreateLabelsRidgeImage ()
 Creates image on which labels and ridges are rendered.
 
ImageCreateLabelsIntensitiesImage ()
 Creates image on which ridges are rendered on top of the original image intensities.
 
bool IsElementNoMinima (PixelElement< T > pe1, PixelElement< T > pe2)
 Checks if intensity at pe1 is not a local miminum. More...
 
bool IsElementSame (PixelElement< T > pe1, PixelElement< T > pe2)
 Checks if intensities of pe1 and pe2 are the same. More...
 
PixelElement< T > CreatePixelElement (int x, int y)
 creates a pixel element for the given coordinates (x, y) More...
 
PixelElement< T > CreatePixelElement (stira::common::Point< int > pt)
 creates a pixel element for the given point pt More...
 
bool IsValidNeighbour (int x, int y, int dx, int dy)
 checks if point (x+dx, y+dx) is a valid neighbour of (x, y) Basically, we check (1) if (x+dx, y+dx) doesn't fall out of the image and (2) that (x+dx, y+dx) is not the point (x, y) itself (case dx == dy == 0) More...
 

Detailed Description

template<class T>
class stira::imageanalysis::WatershedMeyer< T >

Template class for watershed transformations variant of Meyer algorithm, as used in Matlab http://www.mathworks.com/access/helpdesk/help/toolbox/images/watershed.html Meyer, Fernand, "Topographic distance and watershed lines," Signal Processing , Vol. 38, July 1994, pp. 113-125 Alternative watershed algorithms with source code can be found on http://www.esiee.fr/~info/tw/.

Member Function Documentation

template<class T >
PixelElement< T > stira::imageanalysis::WatershedMeyer< T >::CreatePixelElement ( int  x,
int  y 
)

creates a pixel element for the given coordinates (x, y)

Parameters
xx coordinate for which to create a pixel element
yy coordinate for which to create a pixel element
Returns
pixel element for the given position

References stira::imageanalysis::PixelElement< T >::value, stira::imageanalysis::PixelElement< T >::x, and stira::imageanalysis::PixelElement< T >::y.

template<class T >
PixelElement< T > stira::imageanalysis::WatershedMeyer< T >::CreatePixelElement ( stira::common::Point< int >  pt)

creates a pixel element for the given point pt

Parameters
ptpoint for which to create a pixel element
Returns
pixel element for the given position

References stira::common::Point< T >::x, and stira::common::Point< T >::y.

template<class T >
bool stira::imageanalysis::WatershedMeyer< T >::IsElementNoMinima ( PixelElement< T >  pe1,
PixelElement< T >  pe2 
)

Checks if intensity at pe1 is not a local miminum.

Parameters
pe1first element in the comparison
pe2second element in the comparison
Returns
true if value in pe2 is smaller than in pe1; false otherwise

References stira::imageanalysis::PixelElement< T >::value.

template<class T >
bool stira::imageanalysis::WatershedMeyer< T >::IsElementSame ( PixelElement< T >  pe1,
PixelElement< T >  pe2 
)

Checks if intensities of pe1 and pe2 are the same.

Parameters
pe1first element in the comparison
pe2second element in the comparison
Returns
true if value in pe2 is the same as in pe1; false otherwise

References stira::imageanalysis::PixelElement< T >::value.

template<class T >
bool stira::imageanalysis::WatershedMeyer< T >::IsValidNeighbour ( int  x,
int  y,
int  dx,
int  dy 
)

checks if point (x+dx, y+dx) is a valid neighbour of (x, y) Basically, we check (1) if (x+dx, y+dx) doesn't fall out of the image and (2) that (x+dx, y+dx) is not the point (x, y) itself (case dx == dy == 0)

Parameters
xx coordinate of reference point
yy coordinate of reference point
dxdifference in x direction to neighbour
dydifference in y direction to neighbour
Returns
true if (x+dx, y+dy) is within the grid, and dx or dy is different from 0 (if both zero, it's the point itself)
template<class T >
bool stira::imageanalysis::WatershedMeyer< T >::Run ( ArrayGrid< T > *  iInputImage,
bool  usegradientImage,
std::string  sourceDataName = std::string("") 
)
inline

Executes the transformation on iInputImage.

Parameters
iInputImageInput Image
template<class T >
void stira::imageanalysis::WatershedMeyer< T >::SetEqualityPrecision ( double  precision)

Sets precision factor in pixel value comparison.

Parameters
precisionthe minimum difference in value between pixels in order to consider them as different
template<class T >
void stira::imageanalysis::WatershedMeyer< T >::SetMaxMinimaLevel ( double  maxLevel)

Sets upper limit for pixel to be considered a minimum and thus serve as starting seed for flooding.

Parameters
maxLevelthe largest value for a minimum to be allowed as starting seed for flooding

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