seung-lab / kimimaro

Skeletonize densely labeled 3D image segmentations with TEASAR. (Medial Axis Transform)
GNU General Public License v3.0
136 stars 23 forks source link

perf: speed up join close components #90

Closed peterlionelnewman closed 4 months ago

peterlionelnewman commented 4 months ago

only need to compute the upper triangle of this nested loop:

line 110

    radii_matrix = np.full( (N, N), np.inf, dtype=np.float32 )
    index_matrix = np.full( (N, N, 2), -1, dtype=np.uint32 )

    for i in range(N):
      for j in range(i + 1, N):  # compute upper triangle only
william-silversmith commented 4 months ago

Good catch! Thank you for the PR!