MAINT Refactor threshold img to reduce complexity ( 6629)
MAINT Refactor threshold img to reduce complexity ( 6629): a task in life-science-SWE1.0 (Harbor dataset). Title: MAINT Refactor threshold img to reduce complexity
The task
**Title:** [MAINT] Refactor threshold_img to reduce complexity
Part of scalingX/life-science-SWE1.0.