Skip to content
Snippets Groups Projects
Commit a79091e1 authored by Constantin Pape's avatar Constantin Pape
Browse files

Add xml functionality

parent 693f7a25
No related branches found
No related tags found
No related merge requests found
from .copy_helper import copy_tables, copy_segmentation, copy_static_files
from .folders import make_folder_structure
from .xml_utils import get_h5_path_from_xml, copy_xml_with_abspath
from .xml_utils import get_h5_path_from_xml, copy_xml_with_abspath, write_simple_xml
......@@ -56,3 +56,23 @@ def copy_xml_with_abspath(xml_in, xml_out):
indent_xml(et_root)
tree = ET.ElementTree(et_root)
tree.write(xml_out)
def write_simple_xml(xml_path, h5_path, path_type='absolute'):
# write top-level data
root = ET.Element('SpimData')
root.set('version', '0.2')
bp = ET.SubElement(root, 'BasePath')
bp.set('type', 'relative')
bp.text = '.'
seqdesc = ET.SubElement(root, 'SequenceDescription')
imgload = ET.SubElement(seqdesc, 'ImageLoader')
imgload.set('format', 'bdv.hdf5')
el = ET.SubElement(imgload, 'hdf5')
el.set('type', path_type)
el.text = h5_path
indent_xml(root)
tree = ET.ElementTree(root)
tree.write(xml_path)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment