Skip to content

Commit

Permalink
Merge branch 'master' of github.com:seung-lab/kimimaro
Browse files Browse the repository at this point in the history
  • Loading branch information
william-silversmith committed Feb 23, 2025
2 parents 62fdc1f + 1ecdc10 commit 977b696
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build_wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ jobs:
uses: docker/setup-qemu-action@v1

- name: Build wheels
uses: pypa/cibuildwheel@v2.19.1
uses: pypa/cibuildwheel@v2.22.0
# to supply options, put them in 'env', like:
env:
CIBW_ARCHS_LINUX: ${{matrix.arch}}
CIBW_BEFORE_BUILD: pip install numpy setuptools wheel cython
CIBW_ARCHS_MACOS: "x86_64 arm64"

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install cython numpy setuptools wheel
pip install -r requirements.txt pytest
pip install -r requirements.txt -r requirements-dev.txt
pip install -e .
- name: Test with pytest
run: |
Expand Down
8 changes: 7 additions & 1 deletion automated_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
import kimimaro.skeletontricks
from kimimaro.utility import moving_average

@pytest.fixture
def connectomics_data():
import crackle
return crackle.load("benchmarks/connectomics.npy.ckl.gz")

def test_empty_image():
labels = np.zeros( (256, 256, 256), dtype=bool)
skels = kimimaro.skeletonize(labels, fix_borders=True)
Expand Down Expand Up @@ -502,7 +507,8 @@ def test_moving_average():
assert np.all(res == ans)
assert len(ans) == len(data)


def test_no_fix_branching(connectomics_data):
kimimaro.skeletonize(connectomics_data[:,:,100], fix_branching=False)



Expand Down
2 changes: 2 additions & 0 deletions benchmarks/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Benchmarks
==========

To open `connectomics.npy.ckl.gz` you must use [`crackle-codec`](https://github.com/seung-lab/crackle).

Except where noted, these benchmarks were executed on an 2.8 GHz Dual-Core Intel Core i7 with 1600 MHz DDR3 RAM. The data source used was `connectomics.npy` which can be found in this repository. `connectomics.npy` is a 32-bit 512x512x512 cutout of mouse visual cortex at 16nm x 16nm x 40nm resolution that contains 2124 connected components including a partial cell body and a large glia fragment.

Below, we compared the run time and peak memory usage of Kimimaro across many versions that contained performance significant updates. Due to the annoying length of each run, each value represents a single run, so there is some random perturbation around the true mean that can obscure the value of small improvements. Version 0.4.2 can be considered the first "feature complete" version that includes quality improvements like fix_branches, fix_borders, and a reasonable root selected for the cell body.
Expand Down
3 changes: 2 additions & 1 deletion benchmarks/benchmark.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import time
import numpy as np
import kimimaro
import crackle

labels = np.load("connectomics.npy")
labels = crackle.load("connectomics.npy.ckl.gz")

s = time.time()
skels = kimimaro.skeletonize(
Expand Down
Binary file added benchmarks/connectomics.npy.ckl.gz
Binary file not shown.
Binary file removed benchmarks/connectomics.npy.lzma
Binary file not shown.
2 changes: 1 addition & 1 deletion kimimaro/trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def trace(
# pointers from each voxel to its parent. Then we can rapidly
# compute multiple paths by simply hopping pointers using path_from_parents
if not fix_branching:
parents = dijkstra3d.parental_field(PDRF, root, voxel_graph)
parents = dijkstra3d.parental_field(PDRF, root, voxel_graph=voxel_graph)
del PDRF
else:
parents = PDRF
Expand Down
2 changes: 2 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pytest
crackle-codec

0 comments on commit 977b696

Please sign in to comment.