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.

from skimage.io import imread, imshow
import matplotlib.pyplot as plt
import pyclesperanto_prototype as cle
import napari_segment_blobs_and_things_with_membranes as nsbatwm

from skimage import data
import napari
import numpy as np
viewer = napari.Viewer(ndisplay=3)

To demonstrate the workflow, we’re using image data from scikit-image’s data module. More precisely, we’ll use the cells3d dataset. Upon inspection of the shape of the data, we see that it’s a 3D image stack with two channels:

input_image = data.cells3d()
(60, 2, 256, 256)
def make_all_layers_invisible(viewer):
    for layer in viewer.layers:
        layer.visible = False
viewer.add_image(input_image, name='cells 3D')