We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4e0a789 commit 8054bb2Copy full SHA for 8054bb2
pybdv/metadata.py
@@ -795,6 +795,19 @@ def get_resolution(xml_path, setup_id):
795
raise ValueError("Could not find setup %i" % setup_id)
796
797
798
+def get_unit(xml_path, setup_id):
799
+ tree = ET.parse(xml_path)
800
+ root = tree.getroot()
801
+ seqdesc = root.find('SequenceDescription')
802
+ viewsets = seqdesc.find('ViewSetups')
803
+ vsetups = viewsets.findall('ViewSetup')
804
+ for vs in vsetups:
805
+ if vs.find('id').text == str(setup_id):
806
+ vox = vs.find('voxelSize')
807
+ return vox.find('unit').text
808
+ raise ValueError("Could not find setup %i" % setup_id)
809
+
810
811
def get_size(xml_path, setup_id):
812
tree = ET.parse(xml_path)
813
root = tree.getroot()
0 commit comments