Note
Go to the end to download the full example code.
Phase Microscopy of Mammalian Cells#

/home/administrator/envs/cs-13-dev/lib/python3.13/site-packages/cellSAM/sam_inference.py:351: UserWarning: Low IOU threshold, ignoring mask.
warnings.warn("Low IOU threshold, ignoring mask.")
/home/administrator/repos/cellSAM/examples/plot_ep_micro.py:13: FutureWarning: `napari.view_image` is deprecated and will be removed in napari 0.7.0.
Use `viewer = napari.Viewer(); viewer.add_image(...)` instead.
nim = napari.view_image(img, name="Phase microscopy image");
import imageio.v3 as iio
import napari
from cellSAM import cellsam_pipeline
img = iio.imread("../sample_imgs/ep_micro.png")
mask = cellsam_pipeline(img, use_wsi=False)
nim = napari.view_image(img, name="Phase microscopy image");
nim.add_labels(mask, name="Cellsam segmentation");
if __name__ == "__main__":
napari.run()
Total running time of the script: (0 minutes 4.410 seconds)