Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segment cells #38

Open
haesleinhuepf opened this issue Oct 10, 2024 · 5 comments
Open

Segment cells #38

haesleinhuepf opened this issue Oct 10, 2024 · 5 comments

Comments

@haesleinhuepf
Copy link
Owner

I would like to segment cells in an image with membrane staining. Can I do this with nsbatwm?

git-bob comment

Copy link

This message was generated by git-bob (version: 0.6.6, model: gpt-4o-2024-08-06, Run details), an experimental AI-based assistant. It can make mistakes and has limitations. Check its messages carefully.

Yes, you can use the nsbatwm library to segment cells in an image with membrane staining. You can apply the seeded watershed segmentation method, which is well-suited for this task. Here is an example of how you might use it:

import napari_segment_blobs_and_things_with_membranes as nsbatwm

# Assuming 'membrane_image' is your input image with membrane staining
# and 'nuclei_labels' is a labeled image of nuclei

segmented_cells = nsbatwm.seeded_watershed(membrane_image, nuclei_labels)

This function uses the labeled nuclei as seeds to segment the cells based on the membrane staining in the image. Adjust your input variables accordingly.

@haesleinhuepf
Copy link
Owner Author

What if I didn't have a label image for the nuclei?

git-bob comment

Copy link

This message was generated by git-bob (version: 0.6.6, model: gpt-4o-2024-08-06, Run details), an experimental AI-based assistant. It can make mistakes and has limitations. Check its messages carefully.

If you don't have a labeled image for the nuclei, you can first create one using the Voronoi-Otsu labeling, which is suitable for detecting blob-like structures such as nuclei. Here's how you might do that:

import napari_segment_blobs_and_things_with_membranes as nsbatwm

### Assuming 'nuclei_image' is your input image of nuclei

nuclei_labels = nsbatwm.voronoi_otsu_labeling(nuclei_image, spot_sigma=4, outline_sigma=1)

### Now you can proceed with the seeded watershed segmentation

segmented_cells = nsbatwm.seeded_watershed(membrane_image, nuclei_labels)

@haesleinhuepf
Copy link
Owner Author

I also don't have an image showing the nuclei. I only have one image showing the membranes. What function can process it to segment cells?

git-bob comment

Copy link

This message was generated by git-bob (version: 0.6.6, model: gpt-4o-2024-08-06, Run details), an experimental AI-based assistant. It can make mistakes and has limitations. Check its messages carefully.

import napari_segment_blobs_and_things_with_membranes as nsbatwm

##### When you only have an image showing membranes, you can use local minima as seeds
##### for watershed segmentation. Here's how you can process it:

segmented_cells = nsbatwm.local_minima_seeded_watershed(membrane_image, spot_sigma=10, outline_sigma=2)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant