Beispiel #1
0
def test_iter_segments_section():
    sec = core.Section([
        [1, 2, 3, 4],
        [5, 6, 7, 8],
        [8, 7, 6, 5],
        [4, 3, 2, 1],
    ])
    ref = list(core.iter_segments(sec))
    nt.eq_(ref, [([1, 2, 3, 4], [5, 6, 7, 8]), ([5, 6, 7, 8], [8, 7, 6, 5]),
                 ([8, 7, 6, 5], [4, 3, 2, 1])])
Beispiel #2
0
def test_segment_meander_angles_single_section():
    class Mock(object):
        pass

    feat = 'segment_meander_angles'

    sec = core.Section(
        np.array([[0, 0, 0], [1, 0, 0], [1, 1, 0], [2, 1, 0], [2, 2, 0]]))

    nrt = core.Neurite(sec)
    nrn = Mock()
    nrn.neurites = [nrt]
    nrn.soma = None
    pop = core.Population([nrn])

    ref = [math.pi / 2, math.pi / 2, math.pi / 2]

    nt.eq_(ref, fst_get(feat, nrt).tolist())
    nt.eq_(ref, fst_get(feat, nrn).tolist())
    nt.eq_(ref, fst_get(feat, pop).tolist())