From cba903829719fac06e9ecfaa1f28c46bf684746f Mon Sep 17 00:00:00 2001 From: Ivan Ivanov Date: Tue, 24 Oct 2023 14:34:19 -0700 Subject: [PATCH] fix error getting stage position --- iohub/convert.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/iohub/convert.py b/iohub/convert.py index 164f98a8..fa875a09 100644 --- a/iohub/convert.py +++ b/iohub/convert.py @@ -310,7 +310,10 @@ def _get_pos_names(self): if self.p > 1: self.pos_names = [] for p in range(self.p): - name = self.reader.stage_positions[p].get("Label") or p + try: + name = self.reader.stage_positions[p]["Label"] + except (IndexError, KeyError): + name = p self.pos_names.append(name) else: self.pos_names = ["0"]