Label image refinement
Similar to morphological operations on binary imagges, it is also possible to refine label images. This notebook shows how to do this.
See also
|
cle._ image
| shape | (70, 70) |
| dtype | uint32 |
| size | 19.1 kB |
| min | 0.0 | | max | 13.0 |
|
Eroding labels
When eroding labels, we need to be careful that objects might split into two. This could be intentional, e.g. to differentiate touching nuclei like in the example above.
|
cle._ image
| shape | (70, 70) |
| dtype | uint32 |
| size | 19.1 kB |
| min | 0.0 | | max | 9.0 |
|
|
cle._ image
| shape | (70, 70) |
| dtype | uint32 |
| size | 19.1 kB |
| min | 0.0 | | max | 10.0 |
|
Dilating labels
We can then dilate the labels again to come back to their original size approximately. This might also be useful in case segmented objects are too small in general.
|
cle._ image
| shape | (70, 70) |
| dtype | uint32 |
| size | 19.1 kB |
| min | 0.0 | | max | 10.0 |
|
Opening and closing labels
Opening and closing for label images is similar like for binary images. The only difference is that when labels touch, they cannot expand anymore.
Note that opening labels may make small labels disappear.
|
cle._ image
| shape | (70, 70) |
| dtype | uint32 |
| size | 19.1 kB |
| min | 0.0 | | max | 9.0 |
|
|
cle._ image
| shape | (70, 70) |
| dtype | uint32 |
| size | 19.1 kB |
| min | 0.0 | | max | 13.0 |
|
Exercise
Use the operations introduced above to make small objects disappear in this label image.
|
cle._ image
| shape | (254, 256) |
| dtype | uint32 |
| size | 254.0 kB |
| min | 0.0 | | max | 63.0 |
|