GreyReconstruction#

This morphological reconstruction routine was adapted from CellProfiler.

Authors#

Original author: Lee Kamentsky, Massachusetts Institute of Technology Modifed by Christoph Kirst for ClearMap integration.

grey_reconstruct(source, mask=None, sink=None, method=None, shape=3, verbose=False)[source]#

Calculates the grey reconstruction of the image

Arguments

sourcearray

The source image data.

method‘dilation’ or ‘erosion’ or None

The mehtjod to use, if None return original image.

shapein or tuple

Shape of the strucuturing element for the grey reconstruction.

verboseboo;

If True, print progress info.

Returns

reconstructed: array

Grey reconstructed image.

Note

The reconstruction is done slice by slice along the z-axis.

reconstruct(seed, mask=None, method='dilation', selem=None, offset=None)[source]#

Performs a morphological reconstruction of an image.

Arguments

seedarray

Seed image to be dilated or eroded.

maskarray

Maximum (dilation) / minimum (erosion) allowed

method{‘dilation’|’erosion’}

The method to use.

selemarray

Structuring element.

offsetarray or None

The offset of the structuring element, None is centered.

Returns

reconstructedarray

Result of morphological reconstruction.

Note

Reconstruction uses a seed image, which specifies the values to dilate and a mask image that gives the maximum allowed dilated value at each pixel.

The algorithm is taken from [1]. Applications for greyscale reconstruction are discussed in [2] and [3].

Effectively operates on 2d images.

Reference: