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] calibrate diameter with command line #1050

Open
jazberna1 opened this issue Nov 13, 2024 · 0 comments
Open

[FEATURE] calibrate diameter with command line #1050

jazberna1 opened this issue Nov 13, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@jazberna1
Copy link

Is your feature request related to a problem? Please describe.
This is a feature request I believe:
I would like to be able to run cellpose on the command line so that the diameter was estimated as in the GUI with the calibrate buttom. Otherwsie I have to load and image in the GUI, calibrate it, and then run all my images (from the same dataset) with the diameter from that single image I used for the calibration.

Describe the solution you'd like
To have a --calibrate boolean option that calibrates the image when enabled

Describe alternatives you've considered
According to the documentation I thought that setting the --diameter 0 would force the estimation of the diameter

--diameter
cell diameter, if 0 will use the diameter of the training labels used in the model, or with built-in model will estimate diameter for each image

However setting --diameter 0 actually produces an error when running cellpose. This is the full traceback

Traceback (most recent call last):
  File "C:\Users\malieva\miniconda3\envs\cellpose\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\malieva\miniconda3\envs\cellpose\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\malieva\miniconda3\envs\cellpose\lib\site-packages\cellpose\__main__.py", line 358, in <module>
    main()
  File "C:\Users\malieva\miniconda3\envs\cellpose\lib\site-packages\cellpose\__main__.py", line 205, in main
    out = model.eval(
  File "C:\Users\malieva\miniconda3\envs\cellpose\lib\site-packages\cellpose\models.py", line 187, in eval
    diams, _ = self.sz.eval(x, channels=channels, channel_axis=channel_axis,
  File "C:\Users\malieva\miniconda3\envs\cellpose\lib\site-packages\cellpose\models.py", line 773, in eval
    diam_style = self.diam_mean if (diam_style == 0 or
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

Thanks
Jorge

@jazberna1 jazberna1 added the enhancement New feature or request label Nov 13, 2024
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

1 participant