Skip to content

Commit

Permalink
First test matrix_tool
Browse files Browse the repository at this point in the history
  • Loading branch information
EmmaRenauld committed Dec 12, 2024
1 parent 53feba9 commit 568bfd6
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
4 changes: 2 additions & 2 deletions scilpy/connectivity/tests/test_connectivity.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ def test_compute_triu_connectivity_from_labels():
tractogram, labels)
assert np.array_equal(output.shape, [8, 8])
expected_out = np.zeros((8, 8))
expected_out[1, 3] = 1
expected_out[4, 6] = 2
expected_out[1, 3] = 1 # This is labels (4, 6)
expected_out[4, 6] = 2 # This is labels (7, 9)
assert np.array_equal(output, expected_out)


Expand Down
23 changes: 21 additions & 2 deletions scilpy/connectivity/tests/test_matrix_tools.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# -*- coding: utf-8 -*-
import numpy as np

from scilpy.connectivity.matrix_tools import apply_reordering


def test_compute_olo():
Expand All @@ -10,8 +13,24 @@ def test_apply_olo():


def test_apply_reordering():
pass

conn_matrix = np.asarray([[1, 2, 3, 4],
[5, 6, 7, 8],
[9, 10, 11, 12],
[13, 14, 15, 16]])
output = apply_reordering(conn_matrix, [[0, 1, 3, 2],
[1, 2, 3, 0]])
# First changing rows 2 and 3
expected_out = np.asarray([[1, 2, 3, 4],
[5, 6, 7, 8],
[13, 14, 15, 16],
[9, 10, 11, 12]])
# Permuting columns
expected_out = np.asarray([[2, 3, 4, 1],
[6, 7, 8, 5],
[14, 15, 16, 13],
[10, 11, 12, 9]])
assert np.array_equal(output, expected_out)


def test_evaluate_graph_measures():
pass
Expand Down

0 comments on commit 568bfd6

Please sign in to comment.