From 4a6a15686c8f1a7e85b8c0fb49acb89a6390f286 Mon Sep 17 00:00:00 2001 From: Wim Pomp Date: Wed, 29 Jan 2025 17:16:20 +0100 Subject: [PATCH] - slightly more robust czi metadata reading --- ndbioimage/readers/cziread.py | 6 +++--- pyproject.toml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ndbioimage/readers/cziread.py b/ndbioimage/readers/cziread.py index c97eef2..c345d7b 100644 --- a/ndbioimage/readers/cziread.py +++ b/ndbioimage/readers/cziread.py @@ -349,7 +349,7 @@ class OmeParse: model.Objective(id=f'Objective:Tubelens:{idx}', model=tube_lens, nominal_magnification=nominal_magnification)) elif self.version in ('1.1', '1.2'): - for tubelens in self.instrument.find('TubeLenses'): + for tubelens in self.def_list(self.instrument.find('TubeLenses')): try: nominal_magnification = float(re.findall(r'\d+(?:[,.]\d*)?', tubelens.attrib['Name'])[0].replace(',', '.')) @@ -384,8 +384,8 @@ class OmeParse: model.Laser( id=f"LightSource:{light_source.attrib['Id']}", power=float(self.text(light_source.find('Power'))), - wavelength=float(light_source.attrib['Id'][-3:]))) - except AttributeError: + wavelength=float(light_source.attrib['Id'][-3:]))) # TODO: follow Id reference + except (AttributeError, ValueError): pass def get_filters(self) -> None: diff --git a/pyproject.toml b/pyproject.toml index 64ddff5..3937234 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "ndbioimage" -version = "2025.1.1" +version = "2025.1.2" description = "Bio image reading, metadata and some affine registration." authors = ["W. Pomp "] license = "GPLv3"