Skip to content

Commit

Permalink
Test compress_sft
Browse files Browse the repository at this point in the history
  • Loading branch information
EmmaRenauld committed Sep 11, 2024
1 parent 51462e5 commit bbd9033
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions scilpy/tractograms/tests/test_streamline_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,19 @@ def test_get_streamlines_as_linspaces():


def test_compress_sft():
# toDo
pass
sft = load_tractogram(in_long_sft, in_ref)
compressed = compress_sft(sft, tol_error=0.01)
assert len(sft) == len(compressed)

for s, sc in zip(sft.streamlines, compressed.streamlines):
# All streamlines should be shorter once compressed
assert len(sc) <= len(s)

# Streamlines' endpoints should not be changed
assert np.allclose(s[0], sc[0])
assert np.allclose(s[-1], sc[-1])

# Not testing more than that, as it uses Dipy's method, tested by Dipy


def test_cut_invalid_streamlines():
Expand Down

0 comments on commit bbd9033

Please sign in to comment.