Open haesleinhuepf opened 3 weeks ago
This message was generated by git-bob (version: 0.12.1dev, model: claude-3-5-sonnet-20241022, log), an experimental AI-based assistant. It can make mistakes and has limitations. Check its messages carefully.
Hi! 👋
For segmenting cells in membrane-stained microscopy images like this, I recommend trying these approaches:
scikit-image
's watershed segmentation with markers from cell centers would work well here. Here's a quick example notebook:import numpy as np
from skimage import io, filters, segmentation, feature
import matplotlib.pyplot as plt
%matplotlib inline
# Load and preprocess image
img = io.imread('membranes.tif')
smooth = filters.gaussian(img, sigma=1)
# Detect seeds/markers
distance = feature.peak_local_max(
-smooth,
min_distance=20,
indices=False
)
markers = segmentation.label(distance)
# Watershed segmentation
labels = segmentation.watershed(
smooth,
markers=markers,
watershed_line=True
)
# Visualize results
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(12,6))
ax1.imshow(img)
ax2.imshow(labels, cmap='nipy_spectral')
plt.show()
Let me know if you'd like me to elaborate on any of these approaches!
Best regards, git-bob
What algorithms / Python packages would be suited for segmenting cells in this kind of microscopy image?
git-bob answer