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:
- 1
Robinson, “Efficient morphological reconstruction: a downhill filter”, Pattern Recognition Letters 25 (2004) 1759-1767.
- 2
Vincent, L., “Morphological Grayscale Reconstruction in Image Analysis: Applications and Efficient Algorithms”, IEEE Transactions on Image Processing (1993)
- 3
Soille, P., “Morphological Image Analysis: Principles and Applications”, Chapter 6, 2nd edition (2003), ISBN 3540429883.