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

Fix Cellpose segmentation with masking ROI tables & relabeling #786

Merged
merged 5 commits into from
Jul 16, 2024

Conversation

jluethi
Copy link
Collaborator

@jluethi jluethi commented Jul 12, 2024

Checklist before merging

  • I added an appropriate entry to CHANGELOG.md

@jluethi
Copy link
Collaborator Author

jluethi commented Jul 12, 2024

My new relabeling approach is more robust and should be fine for all real-world cellpose use-cases. But we'll want to offer an abstracted version of this in ngio later, see issue here to track this: #787

Copy link

github-actions bot commented Jul 12, 2024

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  fractal_tasks_core
  masked_loading.py
  fractal_tasks_core/tasks
  cellpose_segmentation.py 184
Project Total  

This report was generated by python-coverage-comment-action

@jluethi jluethi marked this pull request as ready for review July 12, 2024 13:00
@jluethi jluethi changed the title [WIP] Fix Cellpose segmentation with masking ROI tables & relabeling Fix Cellpose segmentation with masking ROI tables & relabeling Jul 12, 2024
Copy link
Collaborator

@lorenzocerrone lorenzocerrone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, it looks good to me.

I don't like that num_labels_tot is a shared global state. To avoid returning the current number of labels, I would have wrapped segment_ROI in a small class.

I think this is totally fine for now, this code will be heavily refactored soon anyway when we have ngio for this task.

@jluethi
Copy link
Collaborator Author

jluethi commented Jul 16, 2024

Thanks for reviewing it!

I don't like that num_labels_tot is a shared global state. To avoid returning the current number of labels, I would have wrapped segment_ROI in a small class.

I think this is totally fine for now, this code will be heavily refactored soon anyway when we have ngio for this task.

Agreed, that will be something to improve on with the ngio refactor. But I'll go with this for the time being :)

@jluethi jluethi merged commit 558997c into main Jul 16, 2024
19 checks passed
@jluethi jluethi deleted the 785_cellpose_masking_bug branch July 16, 2024 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants