large-image-source-bioformats 1.26.3.dev22__tar.gz → 1.26.3.dev24__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.
- {large-image-source-bioformats-1.26.3.dev22 → large-image-source-bioformats-1.26.3.dev24}/PKG-INFO +1 -1
- {large-image-source-bioformats-1.26.3.dev22 → large-image-source-bioformats-1.26.3.dev24}/large_image_source_bioformats/__init__.py +48 -31
- {large-image-source-bioformats-1.26.3.dev22 → large-image-source-bioformats-1.26.3.dev24}/large_image_source_bioformats.egg-info/PKG-INFO +1 -1
- large-image-source-bioformats-1.26.3.dev24/large_image_source_bioformats.egg-info/requires.txt +5 -0
- large-image-source-bioformats-1.26.3.dev22/large_image_source_bioformats.egg-info/requires.txt +0 -5
- {large-image-source-bioformats-1.26.3.dev22 → large-image-source-bioformats-1.26.3.dev24}/LICENSE +0 -0
- {large-image-source-bioformats-1.26.3.dev22 → large-image-source-bioformats-1.26.3.dev24}/README.rst +0 -0
- {large-image-source-bioformats-1.26.3.dev22 → large-image-source-bioformats-1.26.3.dev24}/large_image_source_bioformats/girder_source.py +0 -0
- {large-image-source-bioformats-1.26.3.dev22 → large-image-source-bioformats-1.26.3.dev24}/large_image_source_bioformats.egg-info/SOURCES.txt +0 -0
- {large-image-source-bioformats-1.26.3.dev22 → large-image-source-bioformats-1.26.3.dev24}/large_image_source_bioformats.egg-info/dependency_links.txt +0 -0
- {large-image-source-bioformats-1.26.3.dev22 → large-image-source-bioformats-1.26.3.dev24}/large_image_source_bioformats.egg-info/entry_points.txt +0 -0
- {large-image-source-bioformats-1.26.3.dev22 → large-image-source-bioformats-1.26.3.dev24}/large_image_source_bioformats.egg-info/top_level.txt +0 -0
- {large-image-source-bioformats-1.26.3.dev22 → large-image-source-bioformats-1.26.3.dev24}/pyproject.toml +0 -0
- {large-image-source-bioformats-1.26.3.dev22 → large-image-source-bioformats-1.26.3.dev24}/setup.cfg +0 -0
- {large-image-source-bioformats-1.26.3.dev22 → large-image-source-bioformats-1.26.3.dev24}/setup.py +0 -0
|
@@ -55,6 +55,7 @@ bioformats = None
|
|
|
55
55
|
javabridge = None
|
|
56
56
|
|
|
57
57
|
_javabridgeStarted = None
|
|
58
|
+
_javabridgeStartLock = threading.Lock()
|
|
58
59
|
_bioformatsVersion = None
|
|
59
60
|
_openImages = []
|
|
60
61
|
|
|
@@ -90,7 +91,7 @@ def _monitor_thread():
|
|
|
90
91
|
|
|
91
92
|
|
|
92
93
|
def _reduceLogging():
|
|
93
|
-
# As of
|
|
94
|
+
# As of python-bioformats 4.0.0, org.apache.log4j isn't in the bundled
|
|
94
95
|
# jar file, so setting log levels just produces needless warnings.
|
|
95
96
|
# bioformats.log4j.basic_config()
|
|
96
97
|
# javabridge.JClassWrapper('loci.common.Log4jTools').setRootLevel(
|
|
@@ -115,37 +116,38 @@ def _reduceLogging():
|
|
|
115
116
|
def _startJavabridge(logger):
|
|
116
117
|
global _javabridgeStarted, _bioformatsVersion
|
|
117
118
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
119
|
+
with _javabridgeStartLock:
|
|
120
|
+
if _javabridgeStarted is None:
|
|
121
|
+
# Only import these when first asked. They are slow to import.
|
|
122
|
+
global bioformats
|
|
123
|
+
global javabridge
|
|
124
|
+
if bioformats is None:
|
|
125
|
+
import bioformats
|
|
126
|
+
try:
|
|
127
|
+
_bioformatsVersion = zipfile.ZipFile(
|
|
128
|
+
pathlib.Path(bioformats.__file__).parent /
|
|
129
|
+
'jars/bioformats_package.jar',
|
|
130
|
+
).open('META-INF/MANIFEST.MF').read(8192).split(
|
|
131
|
+
b'Implementation-Version: ')[1].split()[0].decode()
|
|
132
|
+
logger.info('Bioformats.jar version: %s', _bioformatsVersion)
|
|
133
|
+
except Exception:
|
|
134
|
+
pass
|
|
135
|
+
if javabridge is None:
|
|
136
|
+
import javabridge
|
|
135
137
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
138
|
+
# We need something to wake up at exit and shut things down
|
|
139
|
+
monitor = threading.Thread(target=_monitor_thread)
|
|
140
|
+
monitor.daemon = True
|
|
141
|
+
monitor.start()
|
|
142
|
+
try:
|
|
143
|
+
javabridge.start_vm(class_path=bioformats.JARS, run_headless=True)
|
|
144
|
+
_reduceLogging()
|
|
145
|
+
atexit.register(_stopJavabridge)
|
|
146
|
+
logger.info('Started JVM for Bioformats tile source.')
|
|
147
|
+
_javabridgeStarted = True
|
|
148
|
+
except RuntimeError:
|
|
149
|
+
logger.exception('Cannot start JVM for Bioformats tile source.')
|
|
150
|
+
_javabridgeStarted = False
|
|
149
151
|
return _javabridgeStarted
|
|
150
152
|
|
|
151
153
|
|
|
@@ -157,6 +159,21 @@ def _stopJavabridge(*args, **kwargs):
|
|
|
157
159
|
_javabridgeStarted = None
|
|
158
160
|
|
|
159
161
|
|
|
162
|
+
def _getBioformatsVersion():
|
|
163
|
+
"""
|
|
164
|
+
Get the version of the jar file.
|
|
165
|
+
|
|
166
|
+
:returns: the version string if it is in the expected format, None
|
|
167
|
+
otherwise.
|
|
168
|
+
"""
|
|
169
|
+
if _bioformatsVersion is None:
|
|
170
|
+
from large_image import config
|
|
171
|
+
|
|
172
|
+
logger = config.getLogger()
|
|
173
|
+
_startJavabridge(logger)
|
|
174
|
+
return _bioformatsVersion
|
|
175
|
+
|
|
176
|
+
|
|
160
177
|
class BioformatsFileTileSource(FileTileSource, metaclass=LruCacheMetaclass):
|
|
161
178
|
"""
|
|
162
179
|
Provides tile access to via Bioformats.
|
{large-image-source-bioformats-1.26.3.dev22 → large-image-source-bioformats-1.26.3.dev24}/LICENSE
RENAMED
|
File without changes
|
{large-image-source-bioformats-1.26.3.dev22 → large-image-source-bioformats-1.26.3.dev24}/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.26.3.dev22 → large-image-source-bioformats-1.26.3.dev24}/setup.cfg
RENAMED
|
File without changes
|
{large-image-source-bioformats-1.26.3.dev22 → large-image-source-bioformats-1.26.3.dev24}/setup.py
RENAMED
|
File without changes
|