large-image-source-bioformats 1.30.7.dev10__py3-none-any.whl → 1.30.7.dev18__py3-none-any.whl

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.
@@ -321,8 +321,15 @@ class BioformatsFileTileSource(FileTileSource, metaclass=LruCacheMetaclass):
321
321
  if self.sizeX <= 0 or self.sizeY <= 0:
322
322
  msg = 'Bioformats tile size is invalid.'
323
323
  raise TileSourceError(msg)
324
+ if ('JPEG' in self._metadata['readerClassName'] and
325
+ (self._metadata['optimalTileWidth'] > 16384 or
326
+ self._metadata['optimalTileHeight'] > 16384)):
327
+ msg = 'Bioformats will be too inefficient to read this file.'
328
+ raise TileSourceError(msg)
324
329
  try:
330
+ self._lastGetTileException = 'raise'
325
331
  self.getTile(0, 0, self.levels - 1)
332
+ delattr(self, '_lastGetTileException')
326
333
  except Exception as exc:
327
334
  raise TileSourceError('Bioformats cannot read a tile: %r' % exc)
328
335
  self._populatedLevels = len([
@@ -370,6 +377,7 @@ class BioformatsFileTileSource(FileTileSource, metaclass=LruCacheMetaclass):
370
377
  'optimalTileWidth': rdr.getOptimalTileWidth(),
371
378
  'optimalTileHeight': rdr.getOptimalTileHeight(),
372
379
  'resolutionCount': rdr.getResolutionCount(),
380
+ 'readerClassName': rdr.get_class_name(),
373
381
  })
374
382
 
375
383
  def _getSeriesStarts(self, rdr): # noqa
@@ -613,7 +621,7 @@ class BioformatsFileTileSource(FileTileSource, metaclass=LruCacheMetaclass):
613
621
  return self._metadata
614
622
 
615
623
  @methodcache()
616
- def getTile(self, x, y, z, pilImageAllowed=False, numpyAllowed=False, **kwargs):
624
+ def getTile(self, x, y, z, pilImageAllowed=False, numpyAllowed=False, **kwargs): # noqa
617
625
  self._xyzInRange(x, y, z)
618
626
  ft = fc = fz = 0
619
627
  fseries = self._metadata['frameSeries'][0]
@@ -668,9 +676,14 @@ class BioformatsFileTileSource(FileTileSource, metaclass=LruCacheMetaclass):
668
676
  format = TILE_FORMAT_NUMPY
669
677
  except javabridge.JavaException as exc:
670
678
  es = javabridge.to_string(exc.throwable)
671
- raise TileSourceError('Failed to get Bioformat region (%s, %r).' % (es, (
672
- fc, fz, ft, fseries, self.sizeX, self.sizeY, offsetx,
673
- offsety, width, height)))
679
+ self.logger.exception('Failed to getTile (%r)', es)
680
+ if getattr(self, '_lastGetTileException', None) == 'raise':
681
+ raise TileSourceError('Failed to get Bioformat region (%s, %r).' % (es, (
682
+ fc, fz, ft, fseries, self.sizeX, self.sizeY, offsetx,
683
+ offsety, width, height)))
684
+ self._lastGetTileException = repr(es)
685
+ tile = np.zeros((1, 1))
686
+ format = TILE_FORMAT_NUMPY
674
687
  finally:
675
688
  if javabridge.get_env():
676
689
  javabridge.detach()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: large-image-source-bioformats
3
- Version: 1.30.7.dev10
3
+ Version: 1.30.7.dev18
4
4
  Summary: An bioformats tilesource for large_image.
5
5
  Home-page: https://github.com/girder/large_image
6
6
  Author: Kitware, Inc.
@@ -19,10 +19,10 @@ Classifier: Programming Language :: Python :: 3.13
19
19
  Requires-Python: >=3.8
20
20
  Description-Content-Type: text/x-rst
21
21
  License-File: LICENSE
22
- Requires-Dist: large-image>=1.30.7.dev10
22
+ Requires-Dist: large-image>=1.30.7.dev18
23
23
  Requires-Dist: python-bioformats>=1.5.2
24
24
  Provides-Extra: girder
25
- Requires-Dist: girder-large-image>=1.30.7.dev10; extra == "girder"
25
+ Requires-Dist: girder-large-image>=1.30.7.dev18; extra == "girder"
26
26
  Dynamic: author
27
27
  Dynamic: author-email
28
28
  Dynamic: classifier
@@ -0,0 +1,8 @@
1
+ large_image_source_bioformats/__init__.py,sha256=KGs5DY7YZrmaEhkvSYeQOdz3Wt-DDnHaIi4vfHAe07Q,33975
2
+ large_image_source_bioformats/girder_source.py,sha256=t0X1P0m4qMsRklpdxoPH-yqgHByMvQIzFJ4qRIUykVI,1355
3
+ large_image_source_bioformats-1.30.7.dev18.dist-info/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
4
+ large_image_source_bioformats-1.30.7.dev18.dist-info/METADATA,sha256=ChTGGM4U9Eg88FlhIO_pIKI9EZxc-LFCzG11vfGl_Bw,1377
5
+ large_image_source_bioformats-1.30.7.dev18.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
6
+ large_image_source_bioformats-1.30.7.dev18.dist-info/entry_points.txt,sha256=xgIbKr53QhQkyRFkr87fkagfPWweeqhHHekUEMrcpF8,202
7
+ large_image_source_bioformats-1.30.7.dev18.dist-info/top_level.txt,sha256=e0enjlcFXwPi638IhE71Rk5-eeriA7W3M3IsQ6yH3RI,30
8
+ large_image_source_bioformats-1.30.7.dev18.dist-info/RECORD,,
@@ -1,8 +0,0 @@
1
- large_image_source_bioformats/__init__.py,sha256=lJawSrn3ScKHffmtl7Rut_tgmVKJru3xbbmMn47c1p0,33201
2
- large_image_source_bioformats/girder_source.py,sha256=t0X1P0m4qMsRklpdxoPH-yqgHByMvQIzFJ4qRIUykVI,1355
3
- large_image_source_bioformats-1.30.7.dev10.dist-info/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
4
- large_image_source_bioformats-1.30.7.dev10.dist-info/METADATA,sha256=P3z_lom_tPQYEMFbs_btzvJnzpT2ayoOUjYcuvZriPk,1377
5
- large_image_source_bioformats-1.30.7.dev10.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
6
- large_image_source_bioformats-1.30.7.dev10.dist-info/entry_points.txt,sha256=xgIbKr53QhQkyRFkr87fkagfPWweeqhHHekUEMrcpF8,202
7
- large_image_source_bioformats-1.30.7.dev10.dist-info/top_level.txt,sha256=e0enjlcFXwPi638IhE71Rk5-eeriA7W3M3IsQ6yH3RI,30
8
- large_image_source_bioformats-1.30.7.dev10.dist-info/RECORD,,