large-image-source-bioformats 1.32.4.dev6__tar.gz → 1.32.4.dev8__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.
Potentially problematic release.
This version of large-image-source-bioformats might be problematic. Click here for more details.
- {large_image_source_bioformats-1.32.4.dev6 → large_image_source_bioformats-1.32.4.dev8}/PKG-INFO +3 -3
- {large_image_source_bioformats-1.32.4.dev6 → large_image_source_bioformats-1.32.4.dev8}/large_image_source_bioformats/__init__.py +57 -50
- {large_image_source_bioformats-1.32.4.dev6 → large_image_source_bioformats-1.32.4.dev8}/large_image_source_bioformats.egg-info/PKG-INFO +3 -3
- large_image_source_bioformats-1.32.4.dev8/large_image_source_bioformats.egg-info/requires.txt +5 -0
- large_image_source_bioformats-1.32.4.dev6/large_image_source_bioformats.egg-info/requires.txt +0 -5
- {large_image_source_bioformats-1.32.4.dev6 → large_image_source_bioformats-1.32.4.dev8}/LICENSE +0 -0
- {large_image_source_bioformats-1.32.4.dev6 → large_image_source_bioformats-1.32.4.dev8}/README.rst +0 -0
- {large_image_source_bioformats-1.32.4.dev6 → large_image_source_bioformats-1.32.4.dev8}/large_image_source_bioformats/girder_source.py +0 -0
- {large_image_source_bioformats-1.32.4.dev6 → large_image_source_bioformats-1.32.4.dev8}/large_image_source_bioformats.egg-info/SOURCES.txt +0 -0
- {large_image_source_bioformats-1.32.4.dev6 → large_image_source_bioformats-1.32.4.dev8}/large_image_source_bioformats.egg-info/dependency_links.txt +0 -0
- {large_image_source_bioformats-1.32.4.dev6 → large_image_source_bioformats-1.32.4.dev8}/large_image_source_bioformats.egg-info/entry_points.txt +0 -0
- {large_image_source_bioformats-1.32.4.dev6 → large_image_source_bioformats-1.32.4.dev8}/large_image_source_bioformats.egg-info/top_level.txt +0 -0
- {large_image_source_bioformats-1.32.4.dev6 → large_image_source_bioformats-1.32.4.dev8}/pyproject.toml +0 -0
- {large_image_source_bioformats-1.32.4.dev6 → large_image_source_bioformats-1.32.4.dev8}/setup.cfg +0 -0
- {large_image_source_bioformats-1.32.4.dev6 → large_image_source_bioformats-1.32.4.dev8}/setup.py +0 -0
{large_image_source_bioformats-1.32.4.dev6 → large_image_source_bioformats-1.32.4.dev8}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: large-image-source-bioformats
|
|
3
|
-
Version: 1.32.4.
|
|
3
|
+
Version: 1.32.4.dev8
|
|
4
4
|
Summary: An bioformats tilesource for large_image.
|
|
5
5
|
Home-page: https://github.com/girder/large_image
|
|
6
6
|
Author: Kitware, Inc.
|
|
@@ -18,10 +18,10 @@ Classifier: Programming Language :: Python :: 3.13
|
|
|
18
18
|
Requires-Python: >=3.8
|
|
19
19
|
Description-Content-Type: text/x-rst
|
|
20
20
|
License-File: LICENSE
|
|
21
|
-
Requires-Dist: large-image>=1.32.4.
|
|
21
|
+
Requires-Dist: large-image>=1.32.4.dev8
|
|
22
22
|
Requires-Dist: python-bioformats>=1.5.2
|
|
23
23
|
Provides-Extra: girder
|
|
24
|
-
Requires-Dist: girder-large-image>=1.32.4.
|
|
24
|
+
Requires-Dist: girder-large-image>=1.32.4.dev8; extra == "girder"
|
|
25
25
|
Dynamic: author
|
|
26
26
|
Dynamic: author-email
|
|
27
27
|
Dynamic: classifier
|
|
@@ -57,6 +57,7 @@ javabridge = None
|
|
|
57
57
|
|
|
58
58
|
_javabridgeStarted = None
|
|
59
59
|
_javabridgeStartLock = threading.Lock()
|
|
60
|
+
_javabridgeAttachLock = threading.Lock()
|
|
60
61
|
_bioformatsVersion = None
|
|
61
62
|
_openImages = []
|
|
62
63
|
|
|
@@ -72,7 +73,8 @@ def _monitor_thread():
|
|
|
72
73
|
main_thread.join()
|
|
73
74
|
if len(_openImages):
|
|
74
75
|
try:
|
|
75
|
-
|
|
76
|
+
with _javabridgeAttachLock:
|
|
77
|
+
javabridge.attach()
|
|
76
78
|
while len(_openImages):
|
|
77
79
|
source = _openImages.pop()
|
|
78
80
|
source = source()
|
|
@@ -87,8 +89,9 @@ def _monitor_thread():
|
|
|
87
89
|
except Exception:
|
|
88
90
|
pass
|
|
89
91
|
finally:
|
|
90
|
-
|
|
91
|
-
javabridge.
|
|
92
|
+
with _javabridgeAttachLock:
|
|
93
|
+
if javabridge.get_env():
|
|
94
|
+
javabridge.detach()
|
|
92
95
|
_stopJavabridge()
|
|
93
96
|
|
|
94
97
|
|
|
@@ -231,10 +234,9 @@ class BioformatsFileTileSource(FileTileSource, metaclass=LruCacheMetaclass):
|
|
|
231
234
|
raise TileSourceError(msg)
|
|
232
235
|
self.addKnownExtensions()
|
|
233
236
|
|
|
234
|
-
self._tileLock = threading.RLock()
|
|
235
|
-
|
|
236
237
|
try:
|
|
237
|
-
|
|
238
|
+
with _javabridgeAttachLock:
|
|
239
|
+
javabridge.attach()
|
|
238
240
|
try:
|
|
239
241
|
self._bioimage = bioformats.ImageReader(largeImagePath, perform_init=False)
|
|
240
242
|
try:
|
|
@@ -313,8 +315,9 @@ class BioformatsFileTileSource(FileTileSource, metaclass=LruCacheMetaclass):
|
|
|
313
315
|
msg = 'The bioformats reader threw an unhandled exception.'
|
|
314
316
|
raise TileSourceError(msg)
|
|
315
317
|
finally:
|
|
316
|
-
|
|
317
|
-
javabridge.
|
|
318
|
+
with _javabridgeAttachLock:
|
|
319
|
+
if javabridge.get_env():
|
|
320
|
+
javabridge.detach()
|
|
318
321
|
|
|
319
322
|
if self.levels < 1:
|
|
320
323
|
msg = 'Bioformats image must have at least one level.'
|
|
@@ -340,15 +343,17 @@ class BioformatsFileTileSource(FileTileSource, metaclass=LruCacheMetaclass):
|
|
|
340
343
|
def __del__(self):
|
|
341
344
|
if getattr(self, '_bioimage', None) is not None:
|
|
342
345
|
try:
|
|
343
|
-
|
|
346
|
+
with _javabridgeAttachLock:
|
|
347
|
+
javabridge.attach()
|
|
344
348
|
self._bioimage.close()
|
|
345
349
|
del self._bioimage
|
|
346
350
|
_openImages.remove(weakref.ref(self))
|
|
347
351
|
except Exception:
|
|
348
352
|
pass
|
|
349
353
|
finally:
|
|
350
|
-
|
|
351
|
-
javabridge.
|
|
354
|
+
with _javabridgeAttachLock:
|
|
355
|
+
if javabridge.get_env():
|
|
356
|
+
javabridge.detach()
|
|
352
357
|
|
|
353
358
|
def _metadataForCurrentSeries(self, rdr):
|
|
354
359
|
self._metadata = getattr(self, '_metadata', {})
|
|
@@ -664,33 +669,34 @@ class BioformatsFileTileSource(FileTileSource, metaclass=LruCacheMetaclass):
|
|
|
664
669
|
tile = large_image.tilesource.base._imageToNumpy(tile)[0]
|
|
665
670
|
format = TILE_FORMAT_NUMPY
|
|
666
671
|
else:
|
|
667
|
-
with
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
672
|
+
with _javabridgeAttachLock:
|
|
673
|
+
javabridge.attach()
|
|
674
|
+
try:
|
|
675
|
+
if width > 0 and height > 0:
|
|
676
|
+
tile = self._bioimage.read(
|
|
677
|
+
c=fc, z=fz, t=ft, series=fseries['series'][seriesLevel],
|
|
678
|
+
rescale=False, # return internal data types
|
|
679
|
+
XYWH=(offsetx, offsety, width, height))
|
|
680
|
+
else:
|
|
681
|
+
# We need the same dtype, so read 1x1 at 0x0
|
|
682
|
+
tile = self._bioimage.read(
|
|
683
|
+
c=fc, z=fz, t=ft, series=fseries['series'][seriesLevel],
|
|
684
|
+
rescale=False, # return internal data types
|
|
685
|
+
XYWH=(0, 0, 1, 1))
|
|
686
|
+
tile = np.zeros(tuple([0, 0] + list(tile.shape[2:])), dtype=tile.dtype)
|
|
687
|
+
format = TILE_FORMAT_NUMPY
|
|
688
|
+
except javabridge.JavaException as exc:
|
|
689
|
+
es = javabridge.to_string(exc.throwable)
|
|
690
|
+
self.logger.exception('Failed to getTile (%r)', es)
|
|
691
|
+
if getattr(self, '_lastGetTileException', None) == 'raise':
|
|
692
|
+
raise TileSourceError('Failed to get Bioformat region (%s, %r).' % (es, (
|
|
693
|
+
fc, fz, ft, fseries, self.sizeX, self.sizeY, offsetx,
|
|
694
|
+
offsety, width, height)))
|
|
695
|
+
self._lastGetTileException = repr(es)
|
|
696
|
+
tile = np.zeros((1, 1))
|
|
697
|
+
format = TILE_FORMAT_NUMPY
|
|
698
|
+
finally:
|
|
699
|
+
with _javabridgeAttachLock:
|
|
694
700
|
if javabridge.get_env():
|
|
695
701
|
javabridge.detach()
|
|
696
702
|
if scale > 1:
|
|
@@ -733,18 +739,19 @@ class BioformatsFileTileSource(FileTileSource, metaclass=LruCacheMetaclass):
|
|
|
733
739
|
if info is None:
|
|
734
740
|
return None
|
|
735
741
|
series = info['seriesNum']
|
|
736
|
-
with
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
742
|
+
with _javabridgeAttachLock:
|
|
743
|
+
javabridge.attach()
|
|
744
|
+
try:
|
|
745
|
+
image = self._bioimage.read(
|
|
746
|
+
series=series,
|
|
747
|
+
rescale=False, # return internal data types
|
|
748
|
+
XYWH=(0, 0, info['sizeX'], info['sizeY']))
|
|
749
|
+
except javabridge.JavaException as exc:
|
|
750
|
+
es = javabridge.to_string(exc.throwable)
|
|
751
|
+
raise TileSourceError('Failed to get Bioformat series (%s, %r).' % (es, (
|
|
752
|
+
series, info['sizeX'], info['sizeY'])))
|
|
753
|
+
finally:
|
|
754
|
+
with _javabridgeAttachLock:
|
|
748
755
|
if javabridge.get_env():
|
|
749
756
|
javabridge.detach()
|
|
750
757
|
return large_image.tilesource.base._imageToPIL(image)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: large-image-source-bioformats
|
|
3
|
-
Version: 1.32.4.
|
|
3
|
+
Version: 1.32.4.dev8
|
|
4
4
|
Summary: An bioformats tilesource for large_image.
|
|
5
5
|
Home-page: https://github.com/girder/large_image
|
|
6
6
|
Author: Kitware, Inc.
|
|
@@ -18,10 +18,10 @@ Classifier: Programming Language :: Python :: 3.13
|
|
|
18
18
|
Requires-Python: >=3.8
|
|
19
19
|
Description-Content-Type: text/x-rst
|
|
20
20
|
License-File: LICENSE
|
|
21
|
-
Requires-Dist: large-image>=1.32.4.
|
|
21
|
+
Requires-Dist: large-image>=1.32.4.dev8
|
|
22
22
|
Requires-Dist: python-bioformats>=1.5.2
|
|
23
23
|
Provides-Extra: girder
|
|
24
|
-
Requires-Dist: girder-large-image>=1.32.4.
|
|
24
|
+
Requires-Dist: girder-large-image>=1.32.4.dev8; extra == "girder"
|
|
25
25
|
Dynamic: author
|
|
26
26
|
Dynamic: author-email
|
|
27
27
|
Dynamic: classifier
|
{large_image_source_bioformats-1.32.4.dev6 → large_image_source_bioformats-1.32.4.dev8}/LICENSE
RENAMED
|
File without changes
|
{large_image_source_bioformats-1.32.4.dev6 → large_image_source_bioformats-1.32.4.dev8}/README.rst
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{large_image_source_bioformats-1.32.4.dev6 → large_image_source_bioformats-1.32.4.dev8}/setup.cfg
RENAMED
|
File without changes
|
{large_image_source_bioformats-1.32.4.dev6 → large_image_source_bioformats-1.32.4.dev8}/setup.py
RENAMED
|
File without changes
|