def test_vessel_connection_repeated_point(self): reset_node_id() vessel = _create_repeated_vessel() connectivity = determine_vessel_connectivity(vessel) self.assertListEqual([1, 2], connectivity[0]) self.assertEqual(1, len(connectivity))
def test_vessel_connection_branched(self): reset_node_id() vessel = _create_advanced_vessel() connectivity = determine_vessel_connectivity(vessel) self.assertListEqual([1, 2], connectivity[0]) self.assertListEqual([2, 8], connectivity[6])
def test_determine_connectivity_closed_contour(self): reset_node_id() contour = {'colour': '#00ff00', 'closed': True, 'name': 'Heart', 'data': [MBFPoint(3, 3, 4, 1), MBFPoint(2, 1, 5, 1), MBFPoint(3, 1, 4.2, 1)]} self.assertListEqual([[1, 2], [2, 3], [3, 1]], determine_contour_connectivity(contour['data'], contour['closed']))
def test_vessel_connection_basic(self): reset_node_id() vessel = _create_basic_vessel() connectivity = determine_vessel_connectivity(vessel) self.assertListEqual([1, 2], connectivity[0]) self.assertListEqual([2, 3], connectivity[1]) self.assertListEqual([6, 7], connectivity[5]) self.assertListEqual([11, 12], connectivity[10]) self.assertListEqual([12, 13], connectivity[11])
def test_determine_connectivity_multiple_branch(self): reset_node_id() tree = [MBFPoint(3, 3, 4, 2), MBFPoint(3, 3, 4, 2), MBFPoint(3, 3, 4, 2), [MBFPoint(2, 1, 5, 7), MBFPoint(2, 1, 5, 7), MBFPoint(2, 1, 5, 7), [MBFPoint(2, 4, 8, 5.7), MBFPoint(2, 4, 8, 5.7), MBFPoint(2, 4, 8, 5.7), MBFPoint(2, 4, 8, 5.7)], [MBFPoint(2, 4, 8, 5.7), MBFPoint(2, 4, 8, 5.7), MBFPoint(2, 4, 8, 5.7)]], [MBFPoint(2, 4, 8, 5.7), MBFPoint(2, 4, 8, 5.7)]] self.assertListEqual([[1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 8], [8, 9], [9, 10], [6, 11], [11, 12], [12, 13], [3, 14], [14, 15]], determine_tree_connectivity(tree))
def test_determine_connectivity_branch(self): reset_node_id() tree = [MBFPoint(3, 3, 4, 2), [MBFPoint(2, 1, 5, 7)], [MBFPoint(2, 4, 8, 5.7)]] self.assertListEqual([[1, 2], [1, 3]], determine_tree_connectivity(tree))
def test_determine_connectivity_basic(self): reset_node_id() tree = [MBFPoint(3, 3, 4, 2), MBFPoint(2, 1, 5, 7), MBFPoint(3, 1, 4.2, 7.1)] self.assertListEqual([[1, 2], [2, 3]], determine_tree_connectivity(tree))