fractal-analytics-platform / fractal-tasks-core

Main tasks for the Fractal analytics platform
https://fractal-analytics-platform.github.io/fractal-tasks-core/
BSD 3-Clause "New" or "Revised" License
14 stars 6 forks source link

[ngio] Refactor masked_loading_wrapper logic to do relabeling in the masking step #787

Open jluethi opened 1 month ago

jluethi commented 1 month ago

I have revisited how we handle masking & relabeling to fix #785 . For the moment, I do the relabeling in segment_ROI. In ngio, we'll want to do this in the wrapper class that handles the masking (currently masked_loading_wrapper). The main reason:

Current approach doesn't 100% guarantee consecutive labels. Within the cellpose task, there could be labels that are taken into account for relabeling but are masked away afterwards. That's very unlikely to be an issue, because we set the background to 0 in the input image. But the mock testing ignores the input

jluethi commented 1 month ago

Also, it will be nicer if that's functionality that comes with the IO package, instead of everyone that writes a function that creates labels having to take care of it