From 926f61a8a4c53f064f79246bd1251eb4056902e2 Mon Sep 17 00:00:00 2001 From: Gregor Lichtner Date: Thu, 23 May 2019 16:11:40 +0200 Subject: [PATCH] fixed behavior when no events are available --- nd2reader/raw_metadata.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/nd2reader/raw_metadata.py b/nd2reader/raw_metadata.py index c95c566..4636928 100644 --- a/nd2reader/raw_metadata.py +++ b/nd2reader/raw_metadata.py @@ -393,9 +393,12 @@ class RawMetadata(object): if events is None or six.b('RLxExperimentRecord') not in events: return - events = events[six.b('RLxExperimentRecord')][six.b('pEvents')][six.b('')] + events = events[six.b('RLxExperimentRecord')][six.b('pEvents')] - for event in events: + if len(events) == 0: + return + + for event in events[six.b('')]: event_info = { 'index': event[six.b('I')], 'time': event[six.b('T')], @@ -406,7 +409,6 @@ class RawMetadata(object): self._metadata_parsed['events'].append(event_info) - @property def image_text_info(self): """Textual image information