diff --git a/sources/ometiff/large_image_source_ometiff/__init__.py b/sources/ometiff/large_image_source_ometiff/__init__.py index f65add8c5..f7900ae91 100644 --- a/sources/ometiff/large_image_source_ometiff/__init__.py +++ b/sources/ometiff/large_image_source_ometiff/__init__.py @@ -206,6 +206,9 @@ def _parseOMEInfo(self): # noqa int(self._omebase['TiffData'][0].get('PlaneCount', 0)) == 1): planes = copy.deepcopy(self._omebase.get( 'Plane', self._omebase.get('Channel'))) + if isinstance(planes, dict): + planes = [planes] + self._omebase['SizeC'] = 1 for idx, plane in enumerate(planes): plane['IndexC'] = idx self._omebase['TiffData'] = planes @@ -227,7 +230,7 @@ def _parseOMEInfo(self): # noqa self._omebase.get('Plane', self._omebase['TiffData']))): raise TileSourceError( 'OME Tiff contains frames that contain multiple planes') - except (KeyError, ValueError, IndexError): + except (KeyError, ValueError, IndexError, TypeError): raise TileSourceError('OME Tiff does not contain an expected record') def getMetadata(self):