Biomedical Image Analysis Library
The Biomedical Image Analysis Library is a poweful tool for developers, physicians, researchers, engineers, and so on.
Bial::Segmentation Namespace Reference

Image segmentation methods. More...

Functions

template<class D >
Image< D > Background (const Image< D > &img)
 Segments the darker clusters of the image, supposedly belonging to the background. More...
 
template<class D >
Image< D > Background (const Image< D > &img, const Image< D > &canny)
 Segments the darker clusters of the image, supposedly belonging to the background. More...
 
template<class D >
Image< D > BorderPixels (const Image< D > &img, const Adjacency &adj)
 Pixels belong to the border if they have at last one adjacent pixel with distinct intensity. More...
 
template<class D >
Image< int > ConnectedComponents (const Image< D > &input, const Adjacency &adj)
 Returns an image with each connected component labeled with a distinct label. Connectness is defined * according to given adjacency relation. Every non-zero intensity pixel is considered belonging to the object. Only * zere intensity pixels belong to the background. More...
 
Image< int > RemoveSmallComponents (const Image< int > &label, float fraction)
 The given fraction refers to the total number of pixels in the components, not to the number of * components itself. More...
 
template<class D >
Image< D > OrientedGeodesicStar (const Image< D > &image, const Vector< size_t > &obj_seeds, const Vector< size_t > &bkg_seeds, double alpha=0.0, double beta=0.5)
 Returns the label from oriented geodesic segmentation algorithm. Use positive alpha values for light object and dark background, and negative alpha values for dark object and light background. More...
 
template<class D >
Image< D > HighHysteresis (const Image< D > &img, const D lower, const D higher)
 Computes Hysteresis having first threshold in higher and propagating to connected pixels in lower. More...
 
template<class D >
void IntensityThreshold (Image< D > &img, const D Tmin, const D Tmax)
 Computes a threshold over img. Given a pixel p, img[ p ] = 0 if img[ p ] < Tmin or img[ p ] > Tmax, and img[ p ] = 1 otherwise. More...
 
template<class D >
Image< int > MinimumSpanningForest (const Image< D > &img, const Feature< D > feature, size_t regions)
 Segmentation by minimum spanning forest algorithm. More...
 
template<class D >
Matrix< Image< D > > Octants (const Image< D > &data)
 Easy way to create a matrix with the 3D image or matrix octants. Octants order: x, y, z. More...
 
template<class D >
Image< D > Octants (const Matrix< Image< D > > &data)
 Easy way to merge a matrix of image or matrice octants into a single image or matrix with the 3D. Octants order: x, y, z. More...
 
template<class D >
OtsuThreshold (const Image< D > &img)
 Compute otsu threshold of img. More...
 
template<class D >
Image< D > Otsu (const Image< D > &img)
 Limiarize image using the OtsuThreshold( img ) limiar. More...
 
template<class D >
Matrix< Image< D > > Quadrants (const Image< D > &data)
 Easy way to create a matrix with the 2D image or matrix quadrants. More...
 
template<class D >
Image< D > SurfaceBorderPixels (const Image< D > &img)
 Pixels belong to the border of a surface if they have less than 7 adjacent object pixels. More...
 
template<class D >
Image< int > Watershed (Image< D > &gradient, float radius=1.1f)
 Returns the label image from Watershed segmentation algorithm using local minima as the leaking points. More...
 
template<class D >
Image< int > Watershed (Image< D > &gradient, const Vector< bool > &seeds)
 Returns the label image from Watershed segmentation algorithm using seeds as the leaking points. More...
 
template<class D >
Image< int > Watershed (Image< D > &gradient, const Vector< size_t > &obj_seeds, const Vector< size_t > &bkg_seeds)
 Returns the label image from Watershed segmentation algorithm using seeds as the leaking points. More...
 

Detailed Description

Image segmentation methods.

Function Documentation

template<class D >
Image< D > Bial::Segmentation::Background ( const Image< D > &  img)

Segments the darker clusters of the image, supposedly belonging to the background.

Date
2013/Nov/29
Parameters
imgInput image.
Returns
Binary mask of the background.
Warning
none.
template<class D >
Image< D > Bial::Segmentation::Background ( const Image< D > &  img,
const Image< D > &  canny 
)

Segments the darker clusters of the image, supposedly belonging to the background.

Date
2013/Nov/29
Parameters
imgInput image.
cannyCanny edges. (Suggested hysteresis thresholds: 0.8, 0.9).
Returns
Binary mask of the background.
Warning
none.
template<class D >
Image< D > Bial::Segmentation::BorderPixels ( const Image< D > &  img,
const Adjacency adj 
)

Pixels belong to the border if they have at last one adjacent pixel with distinct intensity.

Date
2014/Jan/07
Parameters
imgInput image.
adjAn adjacency relation.
Returns
Image with border pixels only.
Warning
none.
template<class D >
Image< int > Bial::Segmentation::ConnectedComponents ( const Image< D > &  input,
const Adjacency adj 
)

Returns an image with each connected component labeled with a distinct label. Connectness is defined * according to given adjacency relation. Every non-zero intensity pixel is considered belonging to the object. Only * zere intensity pixels belong to the background.

Date
2016/Jun/27
Parameters
inputInput image.
adjAn adjacency relation.
Returns
Image with each connected component labeled with a distinct label.
Warning
none.
template<class D >
Image< D > Bial::Segmentation::HighHysteresis ( const Image< D > &  img,
const lower,
const higher 
)

Computes Hysteresis having first threshold in higher and propagating to connected pixels in lower.

Date
2013/Nov/26
Parameters
imgImage for thresholding.
lowerlower intensity threshold value.
higherhigher intensity threshold value.
Returns
None. lower can not be greater than higher. All valid pixels receive 1.
Warning
none.
template<class D >
void Bial::Segmentation::IntensityThreshold ( Image< D > &  img,
const Tmin,
const Tmax 
)

Computes a threshold over img. Given a pixel p, img[ p ] = 0 if img[ p ] < Tmin or img[ p ] > Tmax, and img[ p ] = 1 otherwise.

Date
2013/Sep/24
Parameters
imgImage for thresholding.
TminMinimum intensity.
TmaxMaximum intensity.
Returns
None.
Warning
Tmin must be lower or equal to Tmax.
template<class D >
Image< int > Bial::Segmentation::MinimumSpanningForest ( const Image< D > &  img,
const Feature< D >  feature,
size_t  regions 
)

Segmentation by minimum spanning forest algorithm.

Date
2013/Sep/27
Parameters
imgInput image to be segmented. Used to get image dimensions.
featureFeature vector.
regionsNumber of segmented regions.
Returns
Segmented image in the number of expected regions.
Warning
Number of regions must be greater than 0 and lower than the number of samples.
template<class D >
Matrix< Image< D > > Bial::Segmentation::Octants ( const Image< D > &  data)

Easy way to create a matrix with the 3D image or matrix octants. Octants order: x, y, z.

Date
2015/Jun/16
Parameters
dataA matrix or an image.
Returns
A matrix of matrices or images with its octants for inputs with 3 dimensions.
Warning
none.
template<class D >
Image< D > Bial::Segmentation::Octants ( const Matrix< Image< D > > &  data)

Easy way to merge a matrix of image or matrice octants into a single image or matrix with the 3D. Octants order: x, y, z.

Date
2015/Aug/05
Parameters
dataA matrix of matrices or images with octants with 3 dimensions to compose the output.
Returns
Merged octants in a single matrix or image.
Warning
none.
template<class D >
Image< D > Bial::Segmentation::OrientedGeodesicStar ( const Image< D > &  image,
const Vector< size_t > &  obj_seeds,
const Vector< size_t > &  bkg_seeds,
double  alpha = 0.0,
double  beta = 0.5 
)

Returns the label from oriented geodesic segmentation algorithm. Use positive alpha values for light object and dark background, and negative alpha values for dark object and light background.

Date
2013/Nov/05
Parameters
imageInput image.
obj_seedsObject seed coordinate vector.
bkg_seedsBackground seed coordinate vector.
alphaOriented edges strength. -1.0 to 1.0. Close to -1.0 (light to dark edges). Close to 0.0 (non-oriented edges). Close to 1.0 (dark to light edges).
betaGeodesic distance force. 0.0 (geodesic distance) to 4.0 (sum function).
Returns
Label image from oriented geodesic segmentation algorithm.
Warning
none.
template<class D >
Image< D > Bial::Segmentation::Otsu ( const Image< D > &  img)

Limiarize image using the OtsuThreshold( img ) limiar.

Date
2012/Nov/01
Parameters
imgImage for thresholding.
Returns
Limiarized image.
Warning
Support only binary limiarization. Color Images will be limiarized by color channel
template<class D >
D Bial::Segmentation::OtsuThreshold ( const Image< D > &  img)

Compute otsu threshold of img.

Date
2012/Sep/08
Parameters
imgImage for thresholding.
Returns
Otsu threshold of img.
Warning
Output value may be approximated in the case of floating point images.
template<class D >
Matrix< Image< D > > Bial::Segmentation::Quadrants ( const Image< D > &  data)

Easy way to create a matrix with the 2D image or matrix quadrants.

Date
2015/Jun/16
Parameters
dataA matrix or an image.
Returns
A matrix of matrices or images with its quadrants for inputs with 2 dimensions.
Warning
none.
Image< int > Bial::Segmentation::RemoveSmallComponents ( const Image< int > &  label,
float  fraction 
)

The given fraction refers to the total number of pixels in the components, not to the number of * components itself.

Date
2016/Jun/27
Parameters
inputInput labeled component image.
fractionThe fraction of components that should be removed.
Returns
Labeled component image containing only the largest compoenents, according to the given fraction.
Warning
none.
template<class D >
Image< D > Bial::Segmentation::SurfaceBorderPixels ( const Image< D > &  img)

Pixels belong to the border of a surface if they have less than 7 adjacent object pixels.

Date
2014/Jan/07
Parameters
imgInput 3D image.
Returns
Image with surface border pixels.
Warning
Used for 3D images.
template<class D >
Image< int > Bial::Segmentation::Watershed ( Image< D > &  gradient,
float  radius = 1.1f 
)

Returns the label image from Watershed segmentation algorithm using local minima as the leaking points.

Date
2013/Oct/08
Parameters
gradientGradient input image.
radiusRadius for local minima detection.
Returns
Label image from Watershed segmentation algorithm.
Warning
Gradient image is changed. It returns the cost map.
template<class D >
Image< int > Bial::Segmentation::Watershed ( Image< D > &  gradient,
const Vector< bool > &  seeds 
)

Returns the label image from Watershed segmentation algorithm using seeds as the leaking points.

Date
2013/Oct/08
Parameters
gradientGradient input image.
seedsSeed vector.
Returns
Label image from Watershed segmentation algorithm.
Warning
Gradient image is changed. It returns the cost map.
template<class D >
Image< int > Bial::Segmentation::Watershed ( Image< D > &  gradient,
const Vector< size_t > &  obj_seeds,
const Vector< size_t > &  bkg_seeds 
)

Returns the label image from Watershed segmentation algorithm using seeds as the leaking points.

Date
2013/Oct/08
Parameters
gradientGradient input image.
obj_seeds,bkg_seedsSeed vectors for object and back ground respectively.
Returns
Label image from Watershed segmentation algorithm.
Warning
Gradient image is changed. It returns the cost map.