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

[BUG] min_size argument unused #772

Closed
SimonBon opened this issue Aug 25, 2023 · 3 comments
Closed

[BUG] min_size argument unused #772

SimonBon opened this issue Aug 25, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@SimonBon
Copy link
Contributor

Hello everyone,

I use Cellpose to segment images of DAPI stained single cells and, sometimes we have some artefacts in the images which made me want to use the min_size argument of the .eval function of CellposeModel. After trying out some values and plotting the results I realised that changing the value did not filter out the small segmentation masks.

What I do is I have a grayscale image that I pass to the eval function using the following line:

masks, _, _ = model.eval(img[...,2], diameter=60, min_size=2000)

If I go into the function that I assume to be responsible to remove small segmentations I see the following after using the following print statement (print(npix, min_size)):

...
1983 15
2371 15
3218 15
2663 15
1762 15
3247 15
1649 15
...

I the working solution for me right know is to pass the min_size argument for function dynamics.compute_masks on line 652 in module cellpose.models

without fix:
Pasted Graphic 3

with fix:
Pasted Graphic 2

Thanks for your help!

@SimonBon SimonBon added the bug Something isn't working label Aug 25, 2023
@SimonBon SimonBon changed the title [BUG] [BUG] min_size argument unused Aug 25, 2023
@ashishUthama
Copy link

Also see #280

@mrariden
Copy link
Collaborator

@SimonBon thanks for identifying and testing a solution. Do you want to make a PR with the changes so you'll get credit in the release notes?

@SimonBon
Copy link
Contributor Author

@mrariden done so, see #773. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants