large-image-source-bioformats 1.23.3.dev60__tar.gz → 1.23.3.dev65__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (13) hide show
  1. {large-image-source-bioformats-1.23.3.dev60 → large-image-source-bioformats-1.23.3.dev65}/PKG-INFO +1 -1
  2. {large-image-source-bioformats-1.23.3.dev60 → large-image-source-bioformats-1.23.3.dev65}/large_image_source_bioformats/__init__.py +18 -15
  3. {large-image-source-bioformats-1.23.3.dev60 → large-image-source-bioformats-1.23.3.dev65}/large_image_source_bioformats.egg-info/PKG-INFO +1 -1
  4. {large-image-source-bioformats-1.23.3.dev60 → large-image-source-bioformats-1.23.3.dev65}/large_image_source_bioformats.egg-info/requires.txt +2 -2
  5. {large-image-source-bioformats-1.23.3.dev60 → large-image-source-bioformats-1.23.3.dev65}/setup.py +3 -3
  6. {large-image-source-bioformats-1.23.3.dev60 → large-image-source-bioformats-1.23.3.dev65}/LICENSE +0 -0
  7. {large-image-source-bioformats-1.23.3.dev60 → large-image-source-bioformats-1.23.3.dev65}/README.rst +0 -0
  8. {large-image-source-bioformats-1.23.3.dev60 → large-image-source-bioformats-1.23.3.dev65}/large_image_source_bioformats/girder_source.py +0 -0
  9. {large-image-source-bioformats-1.23.3.dev60 → large-image-source-bioformats-1.23.3.dev65}/large_image_source_bioformats.egg-info/SOURCES.txt +0 -0
  10. {large-image-source-bioformats-1.23.3.dev60 → large-image-source-bioformats-1.23.3.dev65}/large_image_source_bioformats.egg-info/dependency_links.txt +0 -0
  11. {large-image-source-bioformats-1.23.3.dev60 → large-image-source-bioformats-1.23.3.dev65}/large_image_source_bioformats.egg-info/entry_points.txt +0 -0
  12. {large-image-source-bioformats-1.23.3.dev60 → large-image-source-bioformats-1.23.3.dev65}/large_image_source_bioformats.egg-info/top_level.txt +0 -0
  13. {large-image-source-bioformats-1.23.3.dev60 → large-image-source-bioformats-1.23.3.dev65}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: large-image-source-bioformats
3
- Version: 1.23.3.dev60
3
+ Version: 1.23.3.dev65
4
4
  Summary: An bioformats tilesource for large_image.
5
5
  Home-page: https://github.com/girder/large_image
6
6
  Author: Kitware, Inc.
@@ -31,7 +31,7 @@ import threading
31
31
  import types
32
32
  import weakref
33
33
 
34
- import numpy
34
+ import numpy as np
35
35
 
36
36
  import large_image.tilesource.base
37
37
  from large_image import config
@@ -185,8 +185,8 @@ class BioformatsFileTileSource(FileTileSource, metaclass=LruCacheMetaclass):
185
185
  self._ignoreSourceNames('bioformats', largeImagePath, r'\.png$')
186
186
 
187
187
  if not _startJavabridge(self.logger):
188
- raise TileSourceError(
189
- 'File cannot be opened by bioformats reader because javabridge failed to start')
188
+ msg = 'File cannot be opened by bioformats reader because javabridge failed to start'
189
+ raise TileSourceError(msg)
190
190
 
191
191
  self._tileLock = threading.RLock()
192
192
 
@@ -197,7 +197,7 @@ class BioformatsFileTileSource(FileTileSource, metaclass=LruCacheMetaclass):
197
197
  except (AttributeError, OSError) as exc:
198
198
  if not os.path.isfile(largeImagePath):
199
199
  raise TileSourceFileNotFoundError(largeImagePath) from None
200
- self.logger.debug('File cannot be opened via Bioformats. (%r)' % exc)
200
+ self.logger.debug('File cannot be opened via Bioformats. (%r)', exc)
201
201
  raise TileSourceError('File cannot be opened via Bioformats (%r)' % exc)
202
202
  _openImages.append(weakref.ref(self))
203
203
 
@@ -246,22 +246,24 @@ class BioformatsFileTileSource(FileTileSource, metaclass=LruCacheMetaclass):
246
246
  self._computeMagnification()
247
247
  except javabridge.JavaException as exc:
248
248
  es = javabridge.to_string(exc.throwable)
249
- self.logger.debug('File cannot be opened via Bioformats. (%s)' % es)
249
+ self.logger.debug('File cannot be opened via Bioformats. (%s)', es)
250
250
  raise TileSourceError('File cannot be opened via Bioformats. (%s)' % es)
251
251
  except (AttributeError, UnicodeDecodeError):
252
252
  raise
253
253
  self.logger.exception('The bioformats reader threw an unhandled exception.')
254
- raise TileSourceError('The bioformats reader threw an unhandled exception.')
254
+ msg = 'The bioformats reader threw an unhandled exception.'
255
+ raise TileSourceError(msg)
255
256
  finally:
256
257
  if javabridge.get_env():
257
258
  javabridge.detach()
258
259
 
259
260
  if self.levels < 1:
260
- raise TileSourceError(
261
- 'Bioformats image must have at least one level.')
261
+ msg = 'Bioformats image must have at least one level.'
262
+ raise TileSourceError(msg)
262
263
 
263
264
  if self.sizeX <= 0 or self.sizeY <= 0:
264
- raise TileSourceError('Bioformats tile size is invalid.')
265
+ msg = 'Bioformats tile size is invalid.'
266
+ raise TileSourceError(msg)
265
267
  try:
266
268
  self.getTile(0, 0, self.levels - 1)
267
269
  except Exception as exc:
@@ -553,7 +555,7 @@ class BioformatsFileTileSource(FileTileSource, metaclass=LruCacheMetaclass):
553
555
  x * fac + tx, y * fac + ty, z, pilImageAllowed=False,
554
556
  numpyAllowed=True, **kwargs)
555
557
  if result is None:
556
- result = numpy.zeros((
558
+ result = np.zeros((
557
559
  ty * fac + tile.shape[0],
558
560
  tx * fac + tile.shape[1],
559
561
  tile.shape[2]), dtype=tile.dtype)
@@ -577,7 +579,8 @@ class BioformatsFileTileSource(FileTileSource, metaclass=LruCacheMetaclass):
577
579
  fxy = (frame // self._metadata['sizeC'] //
578
580
  self._metadata['sizeZ'] // self._metadata['sizeT'])
579
581
  if frame < 0 or fxy > self._metadata['sizeXY']:
580
- raise TileSourceError('Frame does not exist')
582
+ msg = 'Frame does not exist'
583
+ raise TileSourceError(msg)
581
584
  fseries = self._metadata['frameSeries'][fxy]
582
585
  seriesLevel = self.levels - 1 - z
583
586
  scale = 1
@@ -613,7 +616,7 @@ class BioformatsFileTileSource(FileTileSource, metaclass=LruCacheMetaclass):
613
616
  c=fc, z=fz, t=ft, series=fseries['series'][seriesLevel],
614
617
  rescale=False, # return internal data types
615
618
  XYWH=(0, 0, 1, 1))
616
- tile = numpy.zeros(tuple([0, 0] + list(tile.shape[2:])), dtype=tile.dtype)
619
+ tile = np.zeros(tuple([0, 0] + list(tile.shape[2:])), dtype=tile.dtype)
617
620
  format = TILE_FORMAT_NUMPY
618
621
  except javabridge.JavaException as exc:
619
622
  es = javabridge.to_string(exc.throwable)
@@ -627,13 +630,13 @@ class BioformatsFileTileSource(FileTileSource, metaclass=LruCacheMetaclass):
627
630
  tile = tile[::scale, ::scale]
628
631
  if tile.shape[:2] != (finalHeight, finalWidth):
629
632
  fillValue = 0
630
- if tile.dtype == numpy.uint16:
633
+ if tile.dtype == np.uint16:
631
634
  fillValue = 65535
632
- elif tile.dtype == numpy.uint8:
635
+ elif tile.dtype == np.uint8:
633
636
  fillValue = 255
634
637
  elif tile.dtype.kind == 'f':
635
638
  fillValue = 1
636
- retile = numpy.full(
639
+ retile = np.full(
637
640
  tuple([finalHeight, finalWidth] + list(tile.shape[2:])),
638
641
  fillValue,
639
642
  dtype=tile.dtype)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: large-image-source-bioformats
3
- Version: 1.23.3.dev60
3
+ Version: 1.23.3.dev65
4
4
  Summary: An bioformats tilesource for large_image.
5
5
  Home-page: https://github.com/girder/large_image
6
6
  Author: Kitware, Inc.
@@ -1,8 +1,8 @@
1
- large-image>=1.23.3.dev60
1
+ large-image>=1.23.3.dev65
2
2
  python-bioformats>=1.5.2
3
3
 
4
4
  [:python_version < "3.8"]
5
5
  importlib-metadata<5
6
6
 
7
7
  [girder]
8
- girder-large-image>=1.23.3.dev60
8
+ girder-large-image>=1.23.3.dev65
@@ -66,10 +66,10 @@ setup(
66
66
  python_requires='>=3.6',
67
67
  entry_points={
68
68
  'large_image.source': [
69
- 'bioformats = large_image_source_bioformats:BioformatsFileTileSource'
69
+ 'bioformats = large_image_source_bioformats:BioformatsFileTileSource',
70
70
  ],
71
71
  'girder_large_image.source': [
72
- 'bioformats = large_image_source_bioformats.girder_source:BioformatsGirderTileSource'
73
- ]
72
+ 'bioformats = large_image_source_bioformats.girder_source:BioformatsGirderTileSource',
73
+ ],
74
74
  },
75
75
  )