Scenario
When computing IoU and IoMin between different times, the speed for generating contour masks is the bottle neck. According to our profiling, skimage's polygon implementation takes long. This is also validated by the fact that after reducing the contour coordinate numbers, our scripts for calculating IoU/IoMin mappings run much faster.
Solution
[ ] Instead of generating single-cell contour masks, we can directly retrieve masks from label mask datasets.
[x] replace Skimage implementation with PIL implementation
On CX-A data with 577 time points and "max cell pair count for map computation: 7,968,040" (a lot of pairs are skipped because of no overlapping bounding boxes)
With skimage Polygon implementation, it takes 3 hours and 44 minutes
With PIL implementation, The task takes 43 minutes.
On a dataset with 322 time points and higher density, 127,826 cells
PIL implementation takes 1.5 hours for calculating TD=1 IoU mappings.
Skimage Implementation takes overnight.
Scenario When computing IoU and IoMin between different times, the speed for generating contour masks is the bottle neck. According to our profiling, skimage's polygon implementation takes long. This is also validated by the fact that after reducing the contour coordinate numbers, our scripts for calculating IoU/IoMin mappings run much faster.
Solution
On CX-A data with 577 time points and "max cell pair count for map computation: 7,968,040" (a lot of pairs are skipped because of no overlapping bounding boxes) With skimage Polygon implementation, it takes 3 hours and 44 minutes With PIL implementation, The task takes 43 minutes.
On a dataset with 322 time points and higher density, 127,826 cells PIL implementation takes 1.5 hours for calculating TD=1 IoU mappings. Skimage Implementation takes overnight.