MouseLand / cellpose

a generalist algorithm for cellular segmentation with human-in-the-loop capabilities
https://www.cellpose.org/
BSD 3-Clause "New" or "Revised" License
1.24k stars 359 forks source link

fix mask_flows_to_seg to work for multiple inputs #932

Closed mrariden closed 1 month ago

mrariden commented 1 month ago

When using io.masks_flows_to_seg() the iteration over the arguments when the input is a list of images did not succeed and fails quietly. I adjusted the iteration to correctly iterate through the arguments.

Resolves:

904

894

Remaining issue: in CP2 the arguments for diams and file_names are switched in order compared to CP3. It shouldn't matter if the keywords are used but order-based calls to io.masks_flows_to_seg() will be wrong between the versions. The order cannot be switched without removing the default argument for diams, since there isn't a default for file_names.

Possible solution: set the default diams = None since it is used in the .npy est_diam key. Currently it is set to a default of 30, which may not be correct either.

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 66.66667% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 56.03%. Comparing base (cc4e62c) to head (21789ec). Report is 33 commits behind head on main.

Files Patch % Lines
cellpose/io.py 66.66% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #932 +/- ## ========================================== - Coverage 56.26% 56.03% -0.23% ========================================== Files 16 17 +1 Lines 3784 3876 +92 ========================================== + Hits 2129 2172 +43 - Misses 1655 1704 +49 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.