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

Python based (no gui) way of estimating diameters #1073

Open
mat10d opened this issue Dec 6, 2024 · 0 comments
Open

Python based (no gui) way of estimating diameters #1073

mat10d opened this issue Dec 6, 2024 · 0 comments

Comments

@mat10d
Copy link

mat10d commented Dec 6, 2024

I would like to replicate the diameter calibration outside of the GUI, for the pretrained models provided. I am running:

def estimate_cell_diameters(data, channels=[2,3], gpu=False):
    """Estimate diameter directly using Cellpose model's size estimator"""
    model = Cellpose(model_type="cyto3", gpu=gpu)
    diams, _ = model.sz.eval(data, channels=channels)
    return np.maximum(5.0, diams)

This is based on the calibrate size function in the GUI, found here. Is this a reliable way of getting optimal diameters in a purely python way?

Furthermore, every time I run this function, I get different calibrated diameters. Is this expected?

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