Exemple #1
0
    def test_write_ex_basic(self):
        ex_file = _resource_path("basic_vessel.ex")
        if os.path.exists(ex_file):
            os.remove(ex_file)

        xml_file = _resource_path("tracing_vessels_and_markers.xml")
        data = read_xml(xml_file)

        write_ex(ex_file, data)
        self.assertTrue(os.path.exists(ex_file))
Exemple #2
0
    def test_write_ex_basic_group(self):
        ex_file = _resource_path("basic_groups.ex")
        if os.path.exists(ex_file):
            os.remove(ex_file)

        xml_file = _resource_path("tree_with_anatomical_terms.xml")
        data = read_xml(xml_file)

        write_ex(ex_file, data, {'external_annotation': True})
        self.assertTrue(_is_line_in_file(ex_file, " Group name: Thorasic Sympathetic Trunk"))
Exemple #3
0
    def test_write_ex_with_annotation(self):
        ex_file = _resource_path("tree_with_annotation.ex")
        if os.path.exists(ex_file):
            os.remove(ex_file)

        xml_file = _resource_path("tree_with_anatomical_terms.xml")
        data = read_xml(xml_file)

        write_ex(ex_file, data)
        self.assertTrue(os.path.exists(ex_file))
Exemple #4
0
    def test_write_tree_with_markers(self):
        xml_file = _resource_path("tree_with_markers.xml")
        neurolucida_data = read_xml(xml_file)

        ex_file = _resource_path("tree_with_markers.ex")
        if os.path.exists(ex_file):
            os.remove(ex_file)

        write_ex(ex_file, neurolucida_data)
        self.assertTrue(os.path.exists(ex_file))
        self.assertTrue(_is_line_in_file(ex_file, " Group name: marker"))
Exemple #5
0
    def test_write_ex_branch(self):
        ex_file = _resource_path("multi_tree.ex")
        if os.path.exists(ex_file):
            os.remove(ex_file)

        tree = {'rgb': [0, 0, 0],
                'data': [MBFPoint(3, 3, 4, 2), [MBFPoint(2, 1, 5, 7)], [MBFPoint(2, 4, 8, 5.7)]]}
        data = MBFData()
        data.add_tree(tree)

        write_ex(ex_file, data)
        self.assertTrue(os.path.exists(ex_file))
Exemple #6
0
    def test_write_ex_basic(self):
        ex_file = _resource_path("basic_tree.ex")
        if os.path.exists(ex_file):
            os.remove(ex_file)

        tree = {'rgb': [0, 0, 0],
                'data': [MBFPoint(3, 3, 4, 2), MBFPoint(2, 1, 5, 7), MBFPoint(3, 1, 4.2, 7.1)]}
        data = MBFData()
        data.add_tree(tree)

        write_ex(ex_file, data)
        self.assertTrue(os.path.exists(ex_file))
Exemple #7
0
    def test_write_ex_basic(self):
        ex_file = _resource_path("basic_contour.ex")
        if os.path.exists(ex_file):
            os.remove(ex_file)

        data = MBFData()
        contour = {'colour': '#00ff00', 'rgb': [0, 1, 0], 'closed': True, 'name': 'Heart',
                   'data': [MBFPoint(3, 3, 4, 1), MBFPoint(2, 1, 5, 1),
                            MBFPoint(3, 1, 4.2, 1)]}
        data.add_contour(contour)

        write_ex(ex_file, data)
        self.assertTrue(os.path.exists(ex_file))