MaximaDetection

Collection of routines to detect maxima in scalar images.

Used for finding cells or intensity peaks.

extended_max(source, h_max=0, shape=5)[source]

Calculates extended h-maxima of an image

Arguments

sourcearray

Input image.

h_maxfloat or None)

H parameter of h-max transform. If None, calculate local maxima only.

shapeint, tuple or None

Shape of the volume to search for maxima.

Returns

maximaarray

Extended maxima of the image.

Note

Extended maxima are the local maxima of the h-max transform.

find_center_of_maxima(source, maxima=None, label=None, verbose=False)[source]

Find center of detected maxima weighted by intensity

Arguments

sourcearray

Intensity image data.

maximaarray or None

Binary array indicating the maxima. I label is not None this can be None.

labelarray or None

Labeled image of the shapes of the maxima. If None, determined from maxima.

verbosebool

Print progress info.

Returns

coordinatesarray

Coordinates of the n centers of maxima as (n,d)-array.

find_maxima(source, h_max=None, shape=5, threshold=None, verbose=None)[source]

Find local and extended maxima in an image.

Arguments

sourcearray

The source data.

h_maxfloat or None

H parameter for the initial h-Max transform. If None, do not perform a h-max transform.

shapeint or tuple

Shape for the structure element for the local maxima filter.

thresholdfloat or None

If float, include only maxima larger than this threshold.

verbosebool

Print progress info.

Returns

maximaarray

Binary image with True pixel at extended maxima.

Notes

This routine performs a h-max transfrom, followed by a local maxima search and thresholding of the maxima.

h_max_transform(source, h_max)[source]

H-maximum transform of an array.

Arguments

sourcearray

Input image.

h_maxfloat or None

H parameter of h-max transform, if None return source.

Returns

transformedarray

H-max transformed image if h is not None.

local_max(source, shape=5)[source]

Calculates local maxima of an image

Arguments

sourcearray

Input image.

shapeint, tuple or None

Shape of the volume to search for maxima.

Returns

local_maxarray

Mask that is True at local maxima.