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.
Files changed (14) hide show
  1. {large-image-source-ometiff-1.23.2.dev18 → large-image-source-ometiff-1.23.3}/PKG-INFO +1 -1
  2. {large-image-source-ometiff-1.23.2.dev18 → large-image-source-ometiff-1.23.3}/large_image_source_ometiff/__init__.py +16 -11
  3. {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
  4. large-image-source-ometiff-1.23.3/large_image_source_ometiff.egg-info/requires.txt +8 -0
  5. {large-image-source-ometiff-1.23.2.dev18 → large-image-source-ometiff-1.23.3}/setup.py +4 -4
  6. large-image-source-ometiff-1.23.2.dev18/large_image_source_ometiff.egg-info/requires.txt +0 -8
  7. {large-image-source-ometiff-1.23.2.dev18 → large-image-source-ometiff-1.23.3}/LICENSE +0 -0
  8. {large-image-source-ometiff-1.23.2.dev18 → large-image-source-ometiff-1.23.3}/README.rst +0 -0
  9. {large-image-source-ometiff-1.23.2.dev18 → large-image-source-ometiff-1.23.3}/large_image_source_ometiff/girder_source.py +0 -0
  10. {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
  11. {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
  12. {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
  13. {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
  14. {large-image-source-ometiff-1.23.2.dev18 → large-image-source-ometiff-1.23.3}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: large-image-source-ometiff
3
- Version: 1.23.2.dev18
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.
@@ -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.dev18
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.
@@ -0,0 +1,8 @@
1
+ large-image>=1.23.3
2
+ large-image-source-tiff>=1.23.3
3
+
4
+ [:python_version < "3.8"]
5
+ importlib-metadata<5
6
+
7
+ [girder]
8
+ girder-large-image>=1.23.3
@@ -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
  )
@@ -1,8 +0,0 @@
1
- large-image>=1.23.2.dev18
2
- large-image-source-tiff>=1.23.2.dev18
3
-
4
- [:python_version < "3.8"]
5
- importlib-metadata<5
6
-
7
- [girder]
8
- girder-large-image>=1.23.2.dev18