/usr/lib/python2.7/dist-packages/dipy/tracking/tests/test_learning.py is in python-dipy 0.10.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | ''' Testing track_metrics module '''
import numpy as np
from nose.tools import assert_true, assert_false, assert_equal, assert_almost_equal
from numpy.testing import assert_array_equal, assert_array_almost_equal
from dipy.tracking import metrics as tm
from dipy.tracking import distances as td
from dipy.tracking import learning as tl
def test_det_corr_tracks():
A=np.array([[0,0,0],[1,1,1],[2,2,2]])
B=np.array([[1,0,0],[2,0,0],[3,0,0]])
C=np.array([[0,0,-1],[0,0,-2],[0,0,-3]])
bundle1=[A,B,C]
bundle2=[B,A]
indices=[0,1]
print(A)
print(B)
print(C)
arr=tl.detect_corresponding_tracks(indices,bundle1,bundle2)
print(arr)
assert_array_equal(arr,np.array([[0, 1],[1, 0]]))
indices2=[0,1]
arr2=tl.detect_corresponding_tracks_plus(indices,bundle1,indices2,bundle2)
print(arr2)
assert_array_equal(arr,arr2)
|