Beispiel #1
0
def test_trunk_section_length():
    t = Tree((0, 0, 0, 42))
    tt = t.add_child(Tree((10, 0, 0, 4)))
    tt.add_child(Tree((10, 15, 0, 4)))
    nt.assert_almost_equal(mtr.trunk_section_length(t), 25.0)
Beispiel #2
0
def test_trunk_radius_length_point_tree():
    t = Tree((0, 0, 0, 42))
    nt.assert_equal(mtr.trunk_section_length(t), 0.0)
Beispiel #3
0
 def get_trunk_section_lengths(self, neurite_type=TreeType.all):
     '''Get the trunk section lengths of a given type in a neuron'''
     tree_filter = tree_type_checker(neurite_type)
     return self._iterable_type(
         [trunk_section_length(t) for t in self.neurites if tree_filter(t)]
     )