large-image-source-ometiff 1.23.2.dev14__py3-none-any.whl → 1.23.3__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -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
- raise TileSourceError('Not a recognized OME Tiff')
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
- raise TileSourceError('Not an OME Tiff')
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
- raise TileSourceError(
141
- 'Untiled image is too large to access with the OME Tiff source')
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
- raise TileSourceError('OME Tiff references multiple files')
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
- raise TileSourceError(
249
- 'OME Tiff contains frames that contain multiple planes')
251
+ msg = 'OME Tiff contains frames that contain multiple planes'
252
+ raise TileSourceError(msg)
250
253
  except (KeyError, ValueError, IndexError, TypeError):
251
- raise TileSourceError('OME Tiff does not contain an expected record')
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
- raise TileSourceError('Frame does not exist')
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, numpy.ndarray):
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)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: large-image-source-ometiff
3
- Version: 1.23.2.dev14
3
+ Version: 1.23.3
4
4
  Summary: An OMETiff tilesource for large_image.
5
5
  Home-page: https://github.com/girder/large_image
6
6
  Author: Kitware, Inc.
@@ -18,11 +18,11 @@ Classifier: Programming Language :: Python :: 3.10
18
18
  Classifier: Programming Language :: Python :: 3.11
19
19
  Requires-Python: >=3.6
20
20
  License-File: LICENSE
21
- Requires-Dist: large-image (>=1.23.2.dev14)
22
- Requires-Dist: large-image-source-tiff (>=1.23.2.dev14)
21
+ Requires-Dist: large-image (>=1.23.3)
22
+ Requires-Dist: large-image-source-tiff (>=1.23.3)
23
23
  Requires-Dist: importlib-metadata (<5) ; python_version < "3.8"
24
24
  Provides-Extra: girder
25
- Requires-Dist: girder-large-image (>=1.23.2.dev14) ; extra == 'girder'
25
+ Requires-Dist: girder-large-image (>=1.23.3) ; extra == 'girder'
26
26
 
27
27
  An OMETiff tilesource for large_image.
28
28
 
@@ -0,0 +1,8 @@
1
+ large_image_source_ometiff/__init__.py,sha256=13KhKaapOLpAVqVsPaHsF1sS7jLz2IbA9Bir4kmBKrY,17556
2
+ large_image_source_ometiff/girder_source.py,sha256=QotYLsC_JY3pOixVOXZ_wwtHJABSuWw_f_8Q5pDnNWo,1047
3
+ large_image_source_ometiff-1.23.3.dist-info/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
4
+ large_image_source_ometiff-1.23.3.dist-info/METADATA,sha256=QnPC73gGJ2Z6VAhmacFI2hHyaQOIJ9WTR65BlwUNyyg,1136
5
+ large_image_source_ometiff-1.23.3.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
6
+ large_image_source_ometiff-1.23.3.dist-info/entry_points.txt,sha256=-xiaxFJTzRayHYwLkPsBXF0grk8j5nQy5cizSazP404,184
7
+ large_image_source_ometiff-1.23.3.dist-info/top_level.txt,sha256=Me0pziNZRmyYLdGAKu9zgDHHINn_7ayKLLYxTGXv5lo,27
8
+ large_image_source_ometiff-1.23.3.dist-info/RECORD,,
@@ -1,8 +0,0 @@
1
- large_image_source_ometiff/__init__.py,sha256=LcRtVtU15BeBJwMaIuhQySsbkpCLjIBL7J3SxjkSWwE,17429
2
- large_image_source_ometiff/girder_source.py,sha256=QotYLsC_JY3pOixVOXZ_wwtHJABSuWw_f_8Q5pDnNWo,1047
3
- large_image_source_ometiff-1.23.2.dev14.dist-info/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
4
- large_image_source_ometiff-1.23.2.dev14.dist-info/METADATA,sha256=imsLeze3AH5ncsso9-nbNwGW3Y3mlP5gTls114fVYAo,1160
5
- large_image_source_ometiff-1.23.2.dev14.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
6
- large_image_source_ometiff-1.23.2.dev14.dist-info/entry_points.txt,sha256=-xiaxFJTzRayHYwLkPsBXF0grk8j5nQy5cizSazP404,184
7
- large_image_source_ometiff-1.23.2.dev14.dist-info/top_level.txt,sha256=Me0pziNZRmyYLdGAKu9zgDHHINn_7ayKLLYxTGXv5lo,27
8
- large_image_source_ometiff-1.23.2.dev14.dist-info/RECORD,,