基于膜的细胞分割的种子分水岭方法#
在本节中,我们将使用种子分水岭方法进行细胞分割。当给定基于膜标记物图像的细胞分割时,这种方法非常常见。因此,我们使用napari插件napari-segment-blobs-and-things-with-membranes。在底层,这个插件使用了scikit-image的函数。
另请参见
from napari_segment_blobs_and_things_with_membranes import voronoi_otsu_labeling, \
seeded_watershed, \
local_minima_seeded_watershed
from skimage.io import imread
from skimage.filters import gaussian
from skimage import data
from pyclesperanto_prototype import imshow
我们从scikit-image加载Cells3d示例图像,这是一个显示细胞核和膜的双通道图像。
cells = data.cells3d()
cells.shape
(60, 2, 256, 256)
nuclei_channel = cells[30, 1]
imshow(nuclei_channel)
membrane_channel = cells[30, 0]
imshow(membrane_channel, max_display_intensity=6000)
用于细胞核分割的Voronoi-Otsu标记#
首先,我们使用Voronoi-Otsu-Labeling算法开始细胞核分割。
labeled_nuclei = voronoi_otsu_labeling(nuclei_channel, spot_sigma=10, outline_sigma=2)
labeled_nuclei
|
|
nsbatwm made image
|
种子分水岭#
我们可以使用标记的细胞核图像作为开始点,来淹没膜图像中的低强度区域。这让我们能够确定细胞分割。
labeled_cells = seeded_watershed(membrane_channel, labeled_nuclei)
labeled_cells
|
|
nsbatwm made image
|
如果细胞的轮廓不是100%准确,在分割细胞之前对膜图像进行一些模糊处理可能会有意义。
blurred = gaussian(membrane_channel, sigma=3)
labeled_cells = seeded_watershed(blurred, labeled_nuclei)
labeled_cells
|
|
nsbatwm made image
|
使用自动种子检测的种子分水岭#
如果我们没有对单独的细胞核通道进行成像,只有膜通道可用于分割,我们可以使用膜图像来搜索局部最小值(暗区)。
labeles_cells2 = local_minima_seeded_watershed(membrane_channel)
labeles_cells2
|
|
nsbatwm made image
|
这个函数还有一些参数可以用来微调分割。参数outline_sigma允许控制高斯模糊滤波器,可以像上面所示微调分割细胞的轮廓。
labeles_cells3 = local_minima_seeded_watershed(
membrane_channel,
outline_sigma=3)
labeles_cells3
|
|
nsbatwm made image
|
如果有多个细胞粘在一起,指定spot_sigma可能会有意义。这个参数允许配置细胞的接近程度/大小。
labeles_cells4 = local_minima_seeded_watershed(
membrane_channel,
spot_sigma=9,
outline_sigma=3)
labeles_cells4
|
|
nsbatwm made image
|
练习#
加载以下数据集,并找到使用种子分水岭方法处理它的好参数。这个示例图像数据是由德累斯顿MPI-CBG的Nadler实验室的Sascha M. Kuhn提供的。
image_slice = imread("../../data/membrane_2d_timelapse.tif")[2]
imshow(image_slice)