From 50ba34f2541e3b34fcba847ba68a8c1e962f782b Mon Sep 17 00:00:00 2001 From: David Manthey Date: Mon, 21 Mar 2022 12:00:10 -0400 Subject: [PATCH] Improve parsing OME TIFF channel names. --- sources/ometiff/large_image_source_ometiff/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sources/ometiff/large_image_source_ometiff/__init__.py b/sources/ometiff/large_image_source_ometiff/__init__.py index 3b18b0c66..83c4e8bdc 100644 --- a/sources/ometiff/large_image_source_ometiff/__init__.py +++ b/sources/ometiff/large_image_source_ometiff/__init__.py @@ -268,6 +268,12 @@ def getMetadata(self): if len(set(channels)) != len(channels) and ( len(channels) <= 1 or len(channels) > len(result['frames'])): channels = [] + for k in {'C', 'Z', 'T'}: + if (str(len(result['frames'])) == str(self._omebase.get('Size%s' % k)) and + len(result['frames']) > 1 and + result['frames'][0].get('Index%s' % k) is None): + for idx in range(len(result['frames'])): + result['frames'][idx]['Index%s' % k] = idx # Standardize "TheX" to "IndexX" values reftbl = OrderedDict([ ('TheC', 'IndexC'), ('TheZ', 'IndexZ'), ('TheT', 'IndexT'),