large-image-source-ometiff 1.23.2.dev18__tar.gz → 1.23.3__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {large-image-source-ometiff-1.23.2.dev18 → large-image-source-ometiff-1.23.3}/PKG-INFO +1 -1
- {large-image-source-ometiff-1.23.2.dev18 → large-image-source-ometiff-1.23.3}/large_image_source_ometiff/__init__.py +16 -11
- {large-image-source-ometiff-1.23.2.dev18 → large-image-source-ometiff-1.23.3}/large_image_source_ometiff.egg-info/PKG-INFO +1 -1
- large-image-source-ometiff-1.23.3/large_image_source_ometiff.egg-info/requires.txt +8 -0
- {large-image-source-ometiff-1.23.2.dev18 → large-image-source-ometiff-1.23.3}/setup.py +4 -4
- large-image-source-ometiff-1.23.2.dev18/large_image_source_ometiff.egg-info/requires.txt +0 -8
- {large-image-source-ometiff-1.23.2.dev18 → large-image-source-ometiff-1.23.3}/LICENSE +0 -0
- {large-image-source-ometiff-1.23.2.dev18 → large-image-source-ometiff-1.23.3}/README.rst +0 -0
- {large-image-source-ometiff-1.23.2.dev18 → large-image-source-ometiff-1.23.3}/large_image_source_ometiff/girder_source.py +0 -0
- {large-image-source-ometiff-1.23.2.dev18 → large-image-source-ometiff-1.23.3}/large_image_source_ometiff.egg-info/SOURCES.txt +0 -0
- {large-image-source-ometiff-1.23.2.dev18 → large-image-source-ometiff-1.23.3}/large_image_source_ometiff.egg-info/dependency_links.txt +0 -0
- {large-image-source-ometiff-1.23.2.dev18 → large-image-source-ometiff-1.23.3}/large_image_source_ometiff.egg-info/entry_points.txt +0 -0
- {large-image-source-ometiff-1.23.2.dev18 → large-image-source-ometiff-1.23.3}/large_image_source_ometiff.egg-info/top_level.txt +0 -0
- {large-image-source-ometiff-1.23.2.dev18 → large-image-source-ometiff-1.23.3}/setup.cfg +0 -0
@@ -19,7 +19,7 @@ import math
|
|
19
19
|
import os
|
20
20
|
from collections import OrderedDict
|
21
21
|
|
22
|
-
import numpy
|
22
|
+
import numpy as np
|
23
23
|
import PIL.Image
|
24
24
|
from large_image_source_tiff import TiffFileTileSource
|
25
25
|
from large_image_source_tiff.exceptions import InvalidOperationTiffError, IOTiffError, TiffError
|
@@ -107,10 +107,12 @@ class OMETiffFileTileSource(TiffFileTileSource, metaclass=LruCacheMetaclass):
|
|
107
107
|
except TiffError:
|
108
108
|
if not os.path.isfile(self._largeImagePath):
|
109
109
|
raise TileSourceFileNotFoundError(self._largeImagePath) from None
|
110
|
-
|
110
|
+
msg = 'Not a recognized OME Tiff'
|
111
|
+
raise TileSourceError(msg)
|
111
112
|
info = getattr(base, '_description_record', None)
|
112
113
|
if not info or not info.get('OME'):
|
113
|
-
|
114
|
+
msg = 'Not an OME Tiff'
|
115
|
+
raise TileSourceError(msg)
|
114
116
|
self._omeinfo = info['OME']
|
115
117
|
self._checkForOMEZLoop(self._largeImagePath)
|
116
118
|
self._parseOMEInfo()
|
@@ -137,8 +139,8 @@ class OMETiffFileTileSource(TiffFileTileSource, metaclass=LruCacheMetaclass):
|
|
137
139
|
_maxChunk = min(base.imageWidth, base.tileWidth * self._skippedLevels ** 2) * \
|
138
140
|
min(base.imageHeight, base.tileHeight * self._skippedLevels ** 2)
|
139
141
|
if _maxChunk > self._maxUntiledChunk:
|
140
|
-
|
141
|
-
|
142
|
+
msg = 'Untiled image is too large to access with the OME Tiff source'
|
143
|
+
raise TileSourceError(msg)
|
142
144
|
self.tileWidth = base.tileWidth
|
143
145
|
self.tileHeight = base.tileHeight
|
144
146
|
self.levels = len(self._tiffDirectories)
|
@@ -240,15 +242,17 @@ class OMETiffFileTileSource(TiffFileTileSource, metaclass=LruCacheMetaclass):
|
|
240
242
|
self._omebase['TiffData'] = [self._omebase['TiffData']]
|
241
243
|
if len({entry.get('UUID', {}).get('FileName', '')
|
242
244
|
for entry in self._omebase['TiffData']}) > 1:
|
243
|
-
|
245
|
+
msg = 'OME Tiff references multiple files'
|
246
|
+
raise TileSourceError(msg)
|
244
247
|
if (len(self._omebase['TiffData']) != int(self._omebase['SizeC']) *
|
245
248
|
int(self._omebase['SizeT']) * int(self._omebase['SizeZ']) or
|
246
249
|
len(self._omebase['TiffData']) != len(
|
247
250
|
self._omebase.get('Plane', self._omebase['TiffData']))):
|
248
|
-
|
249
|
-
|
251
|
+
msg = 'OME Tiff contains frames that contain multiple planes'
|
252
|
+
raise TileSourceError(msg)
|
250
253
|
except (KeyError, ValueError, IndexError, TypeError):
|
251
|
-
|
254
|
+
msg = 'OME Tiff does not contain an expected record'
|
255
|
+
raise TileSourceError(msg)
|
252
256
|
|
253
257
|
def getMetadata(self):
|
254
258
|
"""
|
@@ -329,7 +333,8 @@ class OMETiffFileTileSource(TiffFileTileSource, metaclass=LruCacheMetaclass):
|
|
329
333
|
**kwargs)
|
330
334
|
frame = self._getFrame(**kwargs)
|
331
335
|
if frame < 0 or frame >= len(self._omebase['TiffData']):
|
332
|
-
|
336
|
+
msg = 'Frame does not exist'
|
337
|
+
raise TileSourceError(msg)
|
333
338
|
subdir = None
|
334
339
|
if self._omeLevels[z] is not None:
|
335
340
|
dirnum = int(self._omeLevels[z]['TiffData'][frame].get('IFD', frame))
|
@@ -353,7 +358,7 @@ class OMETiffFileTileSource(TiffFileTileSource, metaclass=LruCacheMetaclass):
|
|
353
358
|
format = 'JPEG'
|
354
359
|
if isinstance(tile, PIL.Image.Image):
|
355
360
|
format = TILE_FORMAT_PIL
|
356
|
-
if isinstance(tile,
|
361
|
+
if isinstance(tile, np.ndarray):
|
357
362
|
format = TILE_FORMAT_NUMPY
|
358
363
|
return self._outputTile(tile, format, x, y, z, pilImageAllowed,
|
359
364
|
numpyAllowed, **kwargs)
|
@@ -55,7 +55,7 @@ setup(
|
|
55
55
|
install_requires=[
|
56
56
|
f'large-image{limit_version}',
|
57
57
|
f'large-image-source-tiff{limit_version}',
|
58
|
-
'importlib-metadata<5 ; python_version < "3.8"'
|
58
|
+
'importlib-metadata<5 ; python_version < "3.8"',
|
59
59
|
],
|
60
60
|
extras_require={
|
61
61
|
'girder': f'girder-large-image{limit_version}',
|
@@ -66,10 +66,10 @@ setup(
|
|
66
66
|
python_requires='>=3.6',
|
67
67
|
entry_points={
|
68
68
|
'large_image.source': [
|
69
|
-
'ometiff = large_image_source_ometiff:OMETiffFileTileSource'
|
69
|
+
'ometiff = large_image_source_ometiff:OMETiffFileTileSource',
|
70
70
|
],
|
71
71
|
'girder_large_image.source': [
|
72
|
-
'ometiff = large_image_source_ometiff.girder_source:OMETiffGirderTileSource'
|
73
|
-
]
|
72
|
+
'ometiff = large_image_source_ometiff.girder_source:OMETiffGirderTileSource',
|
73
|
+
],
|
74
74
|
},
|
75
75
|
)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|