sopa.segmentation.tissue
sopa.segmentation.tissue.hsv_otsu(sdata, image_key=None, level=-1, blur_k=5, open_k=5, close_k=5, drop_threshold=0.01)
Perform WSI tissue segmentation. The resulting ROIs are saved as shapes.
Info
This segmentation method first transforms the image from RBG color space to HSV and then
on the basis of the saturation channel, it performs the rest of the steps.
As a preprocessing step, a median blurring is applied with an element of size blur_k
before the otsu. Then a morphological opening and closing are applied as a prostprocessing
step with square elements of size open_k
and close_k
. Lastly, the connected components
with size less than drop_threshold * number_of_pixel_of_the_image
are removed, and the
rest are converted into polygons.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
sdata |
SpatialData
|
A |
required |
image_key |
str | None
|
Optional key of the H&E image |
None
|
level |
int
|
Level of the multiscale image on which the segmentation will be performed |
-1
|
blur_k |
int
|
The kernel size of the median bluring operation |
5
|
open_k |
int
|
The kernel size of the morphological openning operation |
5
|
close_k |
int
|
The kernel size of the morphological closing operation |
5
|
drop_threshold |
int
|
Segments that cover less area than |
0.01
|
Returns:
Type | Description |
---|---|
bool
|
|