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

Is there a way outside of visual inspection to set threshold value for watershed segementation? #72

Open
buttf7 opened this issue May 31, 2022 · 1 comment
Labels
stale This issue or pull request waits for an update

Comments

@buttf7
Copy link

buttf7 commented May 31, 2022

Is this possible?

@Henley13
Copy link
Member

Henley13 commented Jun 4, 2022

Hi @buttf7,

I have nothing in mind. Threshold value is used to threshold the cell image and build a binary mask of the cells. Instead of using the function bigfish.segmentation.cell_watershed, you can use bigfish.segmentation.get_watershed_relief and bigfish.segmentation.apply_watershed, providing your own binary cell mask. Something like that:

# build relief
relief = get_watershed_relief(image, nuc_label, alpha)

# build cell mask
cell_mask = None

# segment cells
cell_label = apply_watershed(relief, nuc_label, cell_mask)

To get the cell mask, maybe you can try a more subtil Otsu thresholding or directly go for a deep learning method. we also provide a pretrained Unet model with bigfish.segmentation.unet_distance_edge_double and bigfish.segmentation.apply_unet_distance_double that does exactly that. The unet is used to predict a cell mask and the relief image on which we apply a watershed.

@Henley13 Henley13 added the stale This issue or pull request waits for an update label Aug 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale This issue or pull request waits for an update
Projects
None yet
Development

No branches or pull requests

2 participants