Skip to content

Commit

Permalink
improve test for int dtype skeletons
Browse files Browse the repository at this point in the history
  • Loading branch information
jni committed Nov 20, 2023
1 parent 6a76e1f commit 2b4dee3
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/skan/test/test_csr.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from collections import defaultdict
from itertools import product

import pytest
import numpy as np
Expand Down Expand Up @@ -316,8 +317,16 @@ def test_skeleton_path_image_no_keep_image():
assert np.max(pli) == s.n_paths


def test_skeletonlabel():
stats = csr.summarize(csr.Skeleton(skeletonlabel), separator='_')
@pytest.mark.parametrize(
'dtype', [
''.join([pre, 'int', suf])
for pre, suf in product(['u', ''], ['8', '16', '32', '64'])
]
)
def test_skeleton_integer_dtype(dtype):
stats = csr.summarize(
csr.Skeleton(skeletonlabel.astype(dtype)), separator='_'
)
assert stats['mean_pixel_value'].max() == skeletonlabel.max()
assert stats['mean_pixel_value'].max() > 1

Expand Down

0 comments on commit 2b4dee3

Please sign in to comment.