Voronoi-Otsu-labeling
This workflow for image segmentation is a rather simple and yet powerful approach, e.g. for detecting and segmenting nuclei in fluorescence micropscopy images. A nuclei marker such as nuclei-GFP, DAPI or histone-RFP in combination with various microscopy techniques can be used to generate images of suitable kind.
To demonstrate the workflow, we’re using image data from the Broad Bio Image Challenge:
We used image set BBBC022v1 Gustafsdottir et al., PLOS ONE, 2013, available from the Broad Bioimage Benchmark Collection Ljosa et al., Nature Methods, 2012.
<matplotlib.image.AxesImage at 0x2bcac271eb0>
Applying the algorithm
Voronoi-Otsu-labeling is a command in clesperanto, which asks for two sigma parameters. The first sigma controls how close detected cells can be (spot_sigma
) and second controls how precise segmented objects are outlined (outline_sigma
).
|
nsbatwm made image
shape | (395, 695) |
dtype | int32 |
size | 1.0 MB |
min | 0 | max | 25 |
|
The algorithm is also implemented in clesperanto, a GPU-accelerated image processing library enabling fast 2D/3D image processing.
|
cle._ image
shape | (395, 695) |
dtype | uint32 |
size | 1.0 MB |
min | 0.0 | max | 25.0 |
|
How does it work?
The Voronoi-Otsu-Labeling workflow is a combination of Gaussian blur, spot detection, thresholding and binary watershed. The interested reader might want to see the open source code. The approach is similar to applying a seeded watershed to a binary image, e.g. in MorphoLibJ or scikit-image. However, the seeds are computed automatically and cannot be passed.
For demonstration purposes we do that only on the 2D cropped image shown above. If this algorithm is applied to 3D data, it is recommended to make it isotropic first.
|
cle._ image
shape | (200, 200) |
dtype | float32 |
size | 156.2 kB |
min | 142.0 | max | 1114.0 |
|
As a first step, we blur the image with a given sigma and detect maxima in the resulting image.
|
cle._ image
shape | (200, 200) |
dtype | float32 |
size | 156.2 kB |
min | 153.59329 | max | 780.29736 |
|
number of detected spots 30.0
|
cle._ image
shape | (200, 200) |
dtype | uint8 |
size | 39.1 kB |
min | 0.0 | max | 1.0 |
|
Furthermore, we start again from the cropped image and blur it again, with a different sigma. Afterwards, we threshold the image using Otsu’s thresholding method (Otsu et al 1979).
|
cle._ image
shape | (200, 200) |
dtype | float32 |
size | 156.2 kB |
min | 150.2991 | max | 1014.04297 |
|
|
cle._ image
shape | (200, 200) |
dtype | uint8 |
size | 39.1 kB |
min | 0.0 | max | 1.0 |
|
Afterwards, we take the binary spots image and the binary segmentation image and apply a binary_and
operation to exclude spots which were detected in the background area. Those likely corresponded to noise.
number of selected spots 12.0
|
cle._ image
shape | (200, 200) |
dtype | uint8 |
size | 39.1 kB |
min | 0.0 | max | 1.0 |
|
Next, we separate the image space between the selected spots using a Voronoi diagram which is limited to the positive pixels in the binary image.
|
cle._ image
shape | (200, 200) |
dtype | uint32 |
size | 156.2 kB |
min | 0.0 | max | 12.0 |
|