Beispiel #1
0
    def test_get_remote_bifurcation_angles(self):
        ref_remote_bifangles = []
        for t in self.neuron.neurites:
            ref_remote_bifangles.extend(a for a in i_remote_bifurcation_angle(t))

        remote_bifangles = self.neuron.get_remote_bifurcation_angles()
        nt.assert_equal(len(remote_bifangles), 40)
        nt.assert_true(np.all(remote_bifangles == ref_remote_bifangles))
        remote_bifangles = self.neuron.get_remote_bifurcation_angles(TreeType.all)
        nt.assert_equal(len(remote_bifangles), 40)
        nt.assert_true(np.all(remote_bifangles == ref_remote_bifangles))
Beispiel #2
0
    def test_get_remote_bifurcation_angles(self):
        ref_remote_bifangles = []
        for t in self.neuron.neurites:
            ref_remote_bifangles.extend(a
                                        for a in i_remote_bifurcation_angle(t))

        remote_bifangles = self.neuron.get_remote_bifurcation_angles()
        nt.assert_equal(len(remote_bifangles), 40)
        nt.assert_true(np.all(remote_bifangles == ref_remote_bifangles))
        remote_bifangles = self.neuron.get_remote_bifurcation_angles(
            TreeType.all)
        nt.assert_equal(len(remote_bifangles), 40)
        nt.assert_true(np.all(remote_bifangles == ref_remote_bifangles))
Beispiel #3
0
def test_i_remote_bifurcation_angles():
    T = BRANCHING_TREE

    # (fork point, end point, end point) tuples calculated by hand
    # from BRANCHING_TREE
    refs = (((0, 4, 0), (0, 5, 0), (15, 15, 0)),
            ((0, 5, 0), (4, 5, 0), (0, 5, 3)),
            ((0, 5, 3), (0, 6, 3), (0, 6, 4)))

    ref_angles = tuple(angle_3points(p[0], p[1], p[2]) / math.pi for p in refs)
    ref = (0.2985898, 0.5, 0.25)  # ref angles in pi radians
    # sanity check
    for i, b in enumerate(ref_angles):
        nt.assert_almost_equal(b, ref[i])

    for i, b in enumerate(i_remote_bifurcation_angle(T)):
        nt.assert_almost_equal(b / math.pi, ref_angles[i])
        nt.assert_almost_equal(b / math.pi, ref[i])