Sample image
Sample images: skimage_segmentation - Google Drive
I followed the segmentation strategies outlined in Segment human cells (in mitosis) — skimage v0.19.0.dev0 docs
My segmentation function:
# find thresholds
from skimage.segmentation import watershed, expand_labels
from skimage.color import label2rgb
from skimage import data
from skimage import data
from skimage import color, morphology
print('find cells and expand cells')
# white top hat filtering on images
selem = morphology.disk(20)
res = morphology.white_tophat(dapi, selem)
thresholds = filters.threshold_multiotsu(res, classes=3)
regions = np.digitize(res, bins=thresholds)
# find objects over threshold
cells = res > thresholds[0]
dividing = res > thresholds[1]
labeled_cells = measure.label(cells)
labeled_dividing = measure.label(dividing)
naive_mi = labeled_dividing.max() / labeled_cells.max()
distance = ndi.distance_transform_edt(cells)
local_max_coords = feature.peak_local_max(distance, min_distance=7)
local_max_mask = np.zeros(distance.shape, dtype=bool)
local_max_mask[tuple(local_max_coords.T)] = True
# find markers
markers = measure.label(local_max_mask)
# run watershed segementation
segmented_cells = segmentation.watershed(-distance, markers, mask=cells)
seg1 = measure.label(segmented_cells)
# expand segemented cells
expanded = expand_labels(seg1, distance=10)
expanded_rgb = color.label2rgb(expanded, bg_label=0)
Background and challenges
I’m in the process of segmenting nuclei in mouse spinal coords and I’m realising that I’m under-segmenting cells in the denser nuclei areas. The sample images can be found in the link above. The images include examples from denser areas and less dense areas.
I added a top-hat filtering to the analysis prior to the steps outlined in the tutorial.
Is there any additional things I should consider or any other ideas on how to better segment the dense areas? @jni