angelolab / ark-analysis

Integrated pipeline for multiplexed image analysis
https://ark-analysis.readthedocs.io/en/latest/
MIT License
69 stars 25 forks source link

Reducing time to merge in merge_masks.py w/i ez_segmenter #1119

Closed bryjcannon closed 4 months ago

bryjcannon commented 4 months ago

Is your feature request related to a problem? Please describe. merge_masks.py takes a long time to run in ez_segmenter, especially when running through large datasets (>1000 FoVs) with hundreds of cells / FoV.

Describe the solution you'd like Reduce merge time by limiting scope of potential cells-to-merge to the area surrounding the object to be merged. Also adding testing for this method.

Describe alternatives you've considered Pararellization of FoV's also considered but may need to be a separate undertaking.

Additional context Add any other context or screenshots about the feature request here.

bryjcannon commented 4 months ago

Tested on a brain run with multiple ez object masks. Pre-updated merge code: top (time to merge = 18+ hrs) Post-updated merge code: bottom (time to merge: 2+ min)

image image