seung-lab / connected-components-3d

Connected components on discrete and continuous multilabel 3D & 2D images. Handles 26, 18, and 6 connected variants; periodic boundaries (4, 8, & 6)
GNU Lesser General Public License v3.0
367 stars 43 forks source link

perf: save time and memory by not copying to numpy array #19

Closed william-silversmith closed 5 years ago

william-silversmith commented 5 years ago

Instead, create the inital memory segment as a numpy array and simply return it when finished.

Addressed #16

william-silversmith commented 5 years ago

Connectomics data 512x512x512 uint32 input

image

(black) this PR (blue) the PR + max_labels / 4 (red) scipy

image

(black) this PR (blue) the PR + max_labels / 4 (red) scipy (green) cc3d 1.2.1 (teal) cc3d 1.2.0