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

[Feature] Cell Boundary Expansion in DAPI Stained Fluorescence Images #130

Open
guoyang-github opened this issue Sep 26, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@guoyang-github
Copy link

Hi,
Firstly, I want to express my gratitude for developing such a useful tool for efficient cell segmentation.
However, I've encountered a limitation in the current version of SOPA. The tool does an excellent job of segmenting cell nuclei for DAPI image, but it lacks the functionality to expand the segmented nuclei boundaries to simulate the cell membrane. This feature is crucial for representing the entire cell, not just the nucleus.
I would like to propose the addition of a new feature that allows users to expand the segmented cell nuclei by a specified distance to estimate the cell membrane boundary.
Here's a suggested outline for the functionality:
1. A option to select the distance by which the cell boundary should be expanded,
2. The ability to apply this expansion uniformly to all segmented nuclei, and ensure no overlap between adjacent cells,
3. An option to visualize the expanded boundaries in a separate layer for better analysis.

Thank you for considering this feature request.

@quentinblampey
Copy link
Collaborator

quentinblampey commented Sep 26, 2024

Hello @guoyang-github,
This feature actually already exists: there is a parameter called expand_radius_ratio in the aggregation. This way, it will expand the cell before counting the transcripts or averaging the channel intensities.

If you want to visualize this radius expansion, you can also update directly your SpatialData object. In this example, I expand the radius of the 'cellpose_boundaries' by 10 pixels:

sdata['cellpose_boundaries'].geometry = sdata['cellpose_boundaries'].buffer(10)

Let me know if you need more details or if you have additional questions!

@guoyang-github
Copy link
Author

Hello @quentinblampey ,
Thanks for your response.
I noticed that the method mentioned above can expand the cell boundaries, but this may result in overlapping of the cell boundaries, which would prevent the accurate assignment of transcripts to individual cells.
I think a more suitable approach would be to expand the nucleus boundaries by a specified distance or until they encounter another cell boundary.

Thanks,

@quentinblampey
Copy link
Collaborator

Yes, true, this would be better. I note this as a feature request, and I'll work on this!

@quentinblampey quentinblampey added the enhancement New feature or request label Sep 27, 2024
@quentinblampey
Copy link
Collaborator

Hi @guoyang-github, it should be added soon: all I need is shapely==2.1.0 to be released, which will add a new feature which I need

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

No branches or pull requests

2 participants