seung-lab / euclidean-distance-transform-3d

Euclidean distance & signed distance transform for multi-label 3D anisotropic images using marching parabolas.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Binary Performance Enhancement

william-silversmith opened this issue · comments

This would be importing a feature to binary processing that multi-label processing already has.

For binary images that contain significant volumes of black pixels, we can skip processing the black areas rather than putting them through the more expensive parabolic code.

For the multi-label code, processing a totally black volume fell from 9.5 sec to 3 seconds without affecting the performance of other cases.

Did a partial job of this. Skips runs of black at the front, but doesn't deal with interstitial black or black at the end.

Gave this a try, it made the code more complex but in the cases I tried, only made a minor improvement. I imagine it would be valuable in pathological cases, but I didn't give those a try.