large-image-source-bioformats 1.27.5.dev6__tar.gz → 1.30.7.dev12__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.27.5.dev6 → large_image_source_bioformats-1.30.7.dev12}/PKG-INFO +7 -2
- {large-image-source-bioformats-1.27.5.dev6 → large_image_source_bioformats-1.30.7.dev12}/README.rst +20 -40
- {large-image-source-bioformats-1.27.5.dev6 → large_image_source_bioformats-1.30.7.dev12}/large_image_source_bioformats/__init__.py +83 -14
- {large-image-source-bioformats-1.27.5.dev6 → large_image_source_bioformats-1.30.7.dev12}/large_image_source_bioformats.egg-info/PKG-INFO +7 -2
- large_image_source_bioformats-1.30.7.dev12/large_image_source_bioformats.egg-info/requires.txt +5 -0
- {large-image-source-bioformats-1.27.5.dev6 → large_image_source_bioformats-1.30.7.dev12}/setup.py +3 -2
- large-image-source-bioformats-1.27.5.dev6/large_image_source_bioformats.egg-info/requires.txt +0 -5
- {large-image-source-bioformats-1.27.5.dev6 → large_image_source_bioformats-1.30.7.dev12}/LICENSE +0 -0
- {large-image-source-bioformats-1.27.5.dev6 → large_image_source_bioformats-1.30.7.dev12}/large_image_source_bioformats/girder_source.py +0 -0
- {large-image-source-bioformats-1.27.5.dev6 → large_image_source_bioformats-1.30.7.dev12}/large_image_source_bioformats.egg-info/SOURCES.txt +0 -0
- {large-image-source-bioformats-1.27.5.dev6 → large_image_source_bioformats-1.30.7.dev12}/large_image_source_bioformats.egg-info/dependency_links.txt +0 -0
- {large-image-source-bioformats-1.27.5.dev6 → large_image_source_bioformats-1.30.7.dev12}/large_image_source_bioformats.egg-info/entry_points.txt +0 -0
- {large-image-source-bioformats-1.27.5.dev6 → large_image_source_bioformats-1.30.7.dev12}/large_image_source_bioformats.egg-info/top_level.txt +0 -0
- {large-image-source-bioformats-1.27.5.dev6 → large_image_source_bioformats-1.30.7.dev12}/pyproject.toml +0 -0
- {large-image-source-bioformats-1.27.5.dev6 → large_image_source_bioformats-1.30.7.dev12}/setup.cfg +0 -0
{large-image-source-bioformats-1.27.5.dev6 → large_image_source_bioformats-1.30.7.dev12}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: large-image-source-bioformats
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.30.7.dev12
|
|
4
4
|
Summary: An bioformats tilesource for large_image.
|
|
5
5
|
Home-page: https://github.com/girder/large_image
|
|
6
6
|
Author: Kitware, Inc.
|
|
@@ -15,9 +15,14 @@ Classifier: Programming Language :: Python :: 3.9
|
|
|
15
15
|
Classifier: Programming Language :: Python :: 3.10
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.11
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
19
|
Requires-Python: >=3.8
|
|
19
|
-
|
|
20
|
+
Description-Content-Type: text/x-rst
|
|
20
21
|
License-File: LICENSE
|
|
22
|
+
Requires-Dist: large-image>=1.30.7.dev12
|
|
23
|
+
Requires-Dist: python-bioformats>=1.5.2
|
|
24
|
+
Provides-Extra: girder
|
|
25
|
+
Requires-Dist: girder-large-image>=1.30.7.dev12; extra == "girder"
|
|
21
26
|
|
|
22
27
|
An bioformats tilesource for large_image.
|
|
23
28
|
|
{large-image-source-bioformats-1.27.5.dev6 → large_image_source_bioformats-1.30.7.dev12}/README.rst
RENAMED
|
@@ -15,7 +15,7 @@ Large Image
|
|
|
15
15
|
:target: https://codecov.io/github/girder/large_image?branch=master
|
|
16
16
|
:alt: codecov.io
|
|
17
17
|
|
|
18
|
-
.. |doi-badge| image:: https://img.shields.io/badge/DOI-10.5281%2Fzenodo.4723355-blue
|
|
18
|
+
.. |doi-badge| image:: https://img.shields.io/badge/DOI-10.5281%2Fzenodo.4723355-blue.svg
|
|
19
19
|
:target: https://zenodo.org/badge/latestdoi/45569214
|
|
20
20
|
|
|
21
21
|
.. |pypi-badge| image:: https://img.shields.io/pypi/v/large-image.svg?logo=python&logoColor=white
|
|
@@ -39,7 +39,7 @@ Highlights
|
|
|
39
39
|
Installation
|
|
40
40
|
------------
|
|
41
41
|
|
|
42
|
-
In addition to installing the ``large-image`` package, you'll need at least one tile source (a ``large-image-source-xxx`` package). You can install everything from the main project with one of these commands:
|
|
42
|
+
In addition to installing the base ``large-image`` package, you'll need at least one tile source which corresponds to your target file format(s) (a ``large-image-source-xxx`` package). You can install everything from the main project with one of these commands:
|
|
43
43
|
|
|
44
44
|
Pip
|
|
45
45
|
~~~
|
|
@@ -52,7 +52,7 @@ Install all tile sources on linux::
|
|
|
52
52
|
|
|
53
53
|
pip install large-image[all] --find-links https://girder.github.io/large_image_wheels
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
When using large-image with an instance of `Girder`_, install all tile sources and all Girder plugins on linux::
|
|
56
56
|
|
|
57
57
|
pip install large-image[all] girder-large-image-annotation[tasks] --find-links https://girder.github.io/large_image_wheels
|
|
58
58
|
|
|
@@ -60,8 +60,9 @@ Install all tile sources and all Girder plugins on linux::
|
|
|
60
60
|
Conda
|
|
61
61
|
~~~~~
|
|
62
62
|
|
|
63
|
-
Conda makes dependency management a bit easier if not on Linux.
|
|
63
|
+
Conda makes dependency management a bit easier if not on Linux. The base module, converter module, and two of the source modules are available on conda-forge. You can install the following::
|
|
64
64
|
|
|
65
|
+
conda install -c conda-forge large-image
|
|
65
66
|
conda install -c conda-forge large-image-source-gdal
|
|
66
67
|
conda install -c conda-forge large-image-source-tiff
|
|
67
68
|
conda install -c conda-forge large-image-converter
|
|
@@ -118,7 +119,7 @@ Large Image consists of several Python modules designed to work together. These
|
|
|
118
119
|
|
|
119
120
|
- ``large-image-source-deepzoom``: A tile source for reading Deepzoom tiles.
|
|
120
121
|
|
|
121
|
-
- ``large-image-source-dicom``: A tile source for reading DICOM WSI
|
|
122
|
+
- ``large-image-source-dicom``: A tile source for reading DICOM Whole Slide Images (WSI).
|
|
122
123
|
|
|
123
124
|
- ``large-image-source-gdal``: A tile source for reading geotiff files via GDAL. This handles source data with more complex transforms than the mapnik tile source.
|
|
124
125
|
|
|
@@ -128,62 +129,41 @@ Large Image consists of several Python modules designed to work together. These
|
|
|
128
129
|
|
|
129
130
|
- ``large-image-source-nd2``: A tile source for reading nd2 (NIS Element) images.
|
|
130
131
|
|
|
131
|
-
- ``large-image-source-ometiff``: A tile source using the tiff library that can handle
|
|
132
|
+
- ``large-image-source-ometiff``: A tile source using the tiff library that can handle most multi-frame OMETiff files that are compliant with the specification.
|
|
132
133
|
|
|
133
134
|
- ``large-image-source-openjpeg``: A tile source using the Glymur library to read jp2 (JPEG 2000) files.
|
|
134
135
|
|
|
135
136
|
- ``large-image-source-openslide``: A tile source using the OpenSlide library. This works with svs, ndpi, Mirax, tiff, vms, and other file formats.
|
|
136
137
|
|
|
137
|
-
- ``large-image-source-pil``: A tile source for small images via the Python Imaging Library (Pillow).
|
|
138
|
+
- ``large-image-source-pil``: A tile source for small images via the Python Imaging Library (Pillow). By default, the maximum size is 4096, but the maximum size can be configured.
|
|
138
139
|
|
|
139
140
|
- ``large-image-source-tiff``: A tile source for reading pyramidal tiff files in common compression formats.
|
|
140
141
|
|
|
141
142
|
- ``large-image-source-tifffile``: A tile source using the tifffile library that can handle a wide variety of tiff-like files.
|
|
142
143
|
|
|
143
|
-
- ``large-image-source-vips``: A tile source for reading any files handled by libvips. This also can be used for writing tiled images from numpy arrays.
|
|
144
|
+
- ``large-image-source-vips``: A tile source for reading any files handled by libvips. This also can be used for writing tiled images from numpy arrays (up to 4 dimensions).
|
|
144
145
|
|
|
145
|
-
- ``large-image-source-zarr``: A tile source using the zarr library that can handle OME-Zarr (OME-NGFF) files as well as some other zarr files.
|
|
146
|
+
- ``large-image-source-zarr``: A tile source using the zarr library that can handle OME-Zarr (OME-NGFF) files as well as some other zarr files. This can also be used for writing N-dimensional tiled images from numpy arrays. Written images can be saved as any supported format.
|
|
146
147
|
|
|
147
148
|
- ``large-image-source-test``: A tile source that generates test tiles, including a simple fractal pattern. Useful for testing extreme zoom levels.
|
|
148
149
|
|
|
149
|
-
- ``large-image-source-dummy``: A tile source that does nothing.
|
|
150
|
+
- ``large-image-source-dummy``: A tile source that does nothing. This is an absolutely minimal implementation of a tile source used for testing. If you want to create a custom tile source, start with this implementation.
|
|
150
151
|
|
|
151
|
-
Most tile sources can be used with girder-large-image. You can specific an extras_require of ``girder`` to include ``girder-large-image`` with the source.
|
|
152
152
|
|
|
153
|
-
|
|
153
|
+
As a `Girder`_ plugin, ``large-image`` adds end points to access all of the image formats it can read both to get metadata and to act as a tile server.
|
|
154
|
+
In the Girder UI, ``large-image`` shows images on item pages, and can show thumbnails in item lists when browsing folders.
|
|
155
|
+
There is also cache management to balance memory use and speed of response in Girder when ``large-image`` is used as a tile server.
|
|
154
156
|
|
|
155
|
-
|
|
156
|
-
You can specify extras_require of ``tasks`` to install a Girder Worker task that can convert otherwise unreadable images to pyramidal tiff files.
|
|
157
|
+
Most tile sources can be used with Girder Large Image. You can specify an extras_require of ``girder`` to install the following packages:
|
|
157
158
|
|
|
158
|
-
- ``girder-large-image
|
|
159
|
+
- ``girder-large-image``: Large Image as a Girder 3.x plugin.
|
|
160
|
+
You can install ``large-image[tasks]`` to install a Girder Worker task that can convert otherwise unreadable images to pyramidal tiff files.
|
|
161
|
+
|
|
162
|
+
- ``girder-large-image-annotation``: Adds models to the Girder database for supporting annotating large images. These annotations can be rendered on images. Annotations can include polygons, points, image overlays, and other types. Each annotation can have a label and metadata.
|
|
159
163
|
|
|
160
164
|
- ``large-image-tasks``: A utility for running the converter via Girder Worker.
|
|
161
165
|
You can specify an extras_require of ``girder`` to include modules needed to work with the Girder remote worker or ``worker`` to include modules needed on the remote side of the Girder remote worker. If neither is specified, some conversion tasks can be run using Girder local jobs.
|
|
162
166
|
|
|
163
167
|
|
|
164
|
-
Developer Installation
|
|
165
|
-
----------------------
|
|
166
|
-
|
|
167
|
-
To install all packages from source, clone the repository::
|
|
168
|
-
|
|
169
|
-
git clone https://github.com/girder/large_image.git
|
|
170
|
-
cd large_image
|
|
171
|
-
|
|
172
|
-
Install all packages and dependencies::
|
|
173
|
-
|
|
174
|
-
pip install -e . -r requirements-dev.txt
|
|
175
|
-
|
|
176
|
-
If you aren't developing with Girder 3, you can skip installing those components. Use ``requirements-dev-core.txt`` instead of ``requirements-dev.txt``::
|
|
177
|
-
|
|
178
|
-
pip install -e . -r requirements-dev-core.txt
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
Tile source prerequisites
|
|
182
|
-
=========================
|
|
183
|
-
|
|
184
|
-
Many tile sources have complex prerequisites. These can be installed directly using your system's package manager or from some prebuilt Python wheels for Linux. The prebuilt wheels are not official packages, but they can be used by instructing pip to use them by preference::
|
|
185
|
-
|
|
186
|
-
pip install -e . -r requirements-dev.txt --find-links https://girder.github.io/large_image_wheels
|
|
187
|
-
|
|
188
168
|
|
|
189
|
-
.. _Girder: https://
|
|
169
|
+
.. _Girder: https://girder.readthedocs.io/en/latest/
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
# IFormatReader.html for interface details.
|
|
24
24
|
|
|
25
25
|
import atexit
|
|
26
|
+
import builtins
|
|
26
27
|
import logging
|
|
27
28
|
import math
|
|
28
29
|
import os
|
|
@@ -61,8 +62,7 @@ _openImages = []
|
|
|
61
62
|
|
|
62
63
|
|
|
63
64
|
# Default to ignoring files with no extension and some specific extensions.
|
|
64
|
-
config.ConfigValues['source_bioformats_ignored_names'] =
|
|
65
|
-
r'(^[^.]*|\.(jpg|jpeg|jpe|png|tif|tiff|ndpi|nd2|ome|nc|json|isyntax|mrxs|zarr(\.db|\.zip)))$'
|
|
65
|
+
config.ConfigValues['source_bioformats_ignored_names'] = r'(^[^.]*|\.(jpg|jpeg|jpe|png|tif|tiff|ndpi|nd2|ome|nc|json|geojson|fits|isyntax|mrxs|zip|zarr(\.db|\.zip)))$' # noqa
|
|
66
66
|
|
|
67
67
|
|
|
68
68
|
def _monitor_thread():
|
|
@@ -82,7 +82,7 @@ def _monitor_thread():
|
|
|
82
82
|
source._bioimage = None
|
|
83
83
|
except Exception:
|
|
84
84
|
pass
|
|
85
|
-
except
|
|
85
|
+
except Exception:
|
|
86
86
|
pass
|
|
87
87
|
finally:
|
|
88
88
|
if javabridge.get_env():
|
|
@@ -106,7 +106,7 @@ def _reduceLogging():
|
|
|
106
106
|
'org/slf4j/LoggerFactory', 'getLogger',
|
|
107
107
|
'(Ljava/lang/String;)Lorg/slf4j/Logger;', rootLoggerName)
|
|
108
108
|
logLevel = javabridge.get_static_field(
|
|
109
|
-
'ch/qos/logback/classic/Level', '
|
|
109
|
+
'ch/qos/logback/classic/Level', 'OFF', 'Lch/qos/logback/classic/Level;')
|
|
110
110
|
javabridge.call(rootLogger, 'setLevel', '(Lch/qos/logback/classic/Level;)V', logLevel)
|
|
111
111
|
except Exception:
|
|
112
112
|
pass
|
|
@@ -184,6 +184,7 @@ class BioformatsFileTileSource(FileTileSource, metaclass=LruCacheMetaclass):
|
|
|
184
184
|
extensions = {
|
|
185
185
|
None: SourcePriority.FALLBACK,
|
|
186
186
|
'czi': SourcePriority.PREFERRED,
|
|
187
|
+
'ets': SourcePriority.LOW, # part of vsi
|
|
187
188
|
'lif': SourcePriority.MEDIUM,
|
|
188
189
|
'vsi': SourcePriority.PREFERRED,
|
|
189
190
|
}
|
|
@@ -212,16 +213,42 @@ class BioformatsFileTileSource(FileTileSource, metaclass=LruCacheMetaclass):
|
|
|
212
213
|
largeImagePath = str(self._getLargeImagePath())
|
|
213
214
|
config._ignoreSourceNames('bioformats', largeImagePath)
|
|
214
215
|
|
|
216
|
+
header = b''
|
|
217
|
+
if os.path.isfile(largeImagePath):
|
|
218
|
+
try:
|
|
219
|
+
header = builtins.open(largeImagePath, 'rb').read(5)
|
|
220
|
+
except Exception:
|
|
221
|
+
msg = 'File cannot be opened via Bioformats'
|
|
222
|
+
raise TileSourceError(msg)
|
|
223
|
+
# Never allow pdfs; they crash the JVM
|
|
224
|
+
if header[:5] == b'%PDF-':
|
|
225
|
+
msg = 'File cannot be opened via Bioformats'
|
|
226
|
+
raise TileSourceError(msg)
|
|
215
227
|
if not _startJavabridge(self.logger):
|
|
216
228
|
msg = 'File cannot be opened by bioformats reader because javabridge failed to start'
|
|
217
229
|
raise TileSourceError(msg)
|
|
230
|
+
self.addKnownExtensions()
|
|
218
231
|
|
|
219
232
|
self._tileLock = threading.RLock()
|
|
220
233
|
|
|
221
234
|
try:
|
|
222
235
|
javabridge.attach()
|
|
223
236
|
try:
|
|
224
|
-
self._bioimage = bioformats.ImageReader(largeImagePath)
|
|
237
|
+
self._bioimage = bioformats.ImageReader(largeImagePath, perform_init=False)
|
|
238
|
+
try:
|
|
239
|
+
# So this as a separate step so, if it fails, we can ask to
|
|
240
|
+
# open something that does not exist and bioformats will
|
|
241
|
+
# release some file handles.
|
|
242
|
+
self._bioimage.init_reader()
|
|
243
|
+
except Exception as exc:
|
|
244
|
+
try:
|
|
245
|
+
# Ask to open a file that should never exist
|
|
246
|
+
self._bioimage.rdr.setId('__\0__')
|
|
247
|
+
except Exception:
|
|
248
|
+
pass
|
|
249
|
+
self._bioimage.close()
|
|
250
|
+
self._bioimage = None
|
|
251
|
+
raise exc
|
|
225
252
|
except (AttributeError, OSError) as exc:
|
|
226
253
|
if not os.path.isfile(largeImagePath):
|
|
227
254
|
raise TileSourceFileNotFoundError(largeImagePath) from None
|
|
@@ -294,8 +321,15 @@ class BioformatsFileTileSource(FileTileSource, metaclass=LruCacheMetaclass):
|
|
|
294
321
|
if self.sizeX <= 0 or self.sizeY <= 0:
|
|
295
322
|
msg = 'Bioformats tile size is invalid.'
|
|
296
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)
|
|
297
329
|
try:
|
|
330
|
+
self._lastGetTileException = 'raise'
|
|
298
331
|
self.getTile(0, 0, self.levels - 1)
|
|
332
|
+
delattr(self, '_lastGetTileException')
|
|
299
333
|
except Exception as exc:
|
|
300
334
|
raise TileSourceError('Bioformats cannot read a tile: %r' % exc)
|
|
301
335
|
self._populatedLevels = len([
|
|
@@ -343,6 +377,7 @@ class BioformatsFileTileSource(FileTileSource, metaclass=LruCacheMetaclass):
|
|
|
343
377
|
'optimalTileWidth': rdr.getOptimalTileWidth(),
|
|
344
378
|
'optimalTileHeight': rdr.getOptimalTileHeight(),
|
|
345
379
|
'resolutionCount': rdr.getResolutionCount(),
|
|
380
|
+
'readerClassName': rdr.get_class_name(),
|
|
346
381
|
})
|
|
347
382
|
|
|
348
383
|
def _getSeriesStarts(self, rdr): # noqa
|
|
@@ -482,13 +517,15 @@ class BioformatsFileTileSource(FileTileSource, metaclass=LruCacheMetaclass):
|
|
|
482
517
|
|
|
483
518
|
def _computeMagnification(self):
|
|
484
519
|
self._magnification = {}
|
|
485
|
-
metadata = self._metadata
|
|
520
|
+
metadata = self._metadata.get('seriesMetadata', {}).copy()
|
|
521
|
+
metadata.update(self._metadata['metadata'])
|
|
486
522
|
valuekeys = {
|
|
487
523
|
'x': [('Scaling|Distance|Value #1', 1e3)],
|
|
488
524
|
'y': [('Scaling|Distance|Value #2', 1e3)],
|
|
489
525
|
}
|
|
490
526
|
tuplekeys = [
|
|
491
527
|
('Physical pixel size', 1e-3),
|
|
528
|
+
('0028,0030 Pixel Spacing', 1),
|
|
492
529
|
]
|
|
493
530
|
magkeys = [
|
|
494
531
|
'Information|Instrument|Objective|NominalMagnification #1',
|
|
@@ -501,11 +538,11 @@ class BioformatsFileTileSource(FileTileSource, metaclass=LruCacheMetaclass):
|
|
|
501
538
|
if 'mm_x' not in self._magnification and 'mm_y' not in self._magnification:
|
|
502
539
|
for key, units in tuplekeys:
|
|
503
540
|
if metadata.get(key):
|
|
504
|
-
found = re.match(r'
|
|
541
|
+
found = re.match(r'^[^0-9.]*(\d*\.?\d+)[^0-9.]+(\d*\.?\d+)\D*$', metadata[key])
|
|
505
542
|
if found:
|
|
506
543
|
try:
|
|
507
544
|
self._magnification['mm_x'], self._magnification['mm_y'] = (
|
|
508
|
-
float(found.groups()[0]) * units, float(found.groups()[
|
|
545
|
+
float(found.groups()[0]) * units, float(found.groups()[1]) * units)
|
|
509
546
|
except Exception:
|
|
510
547
|
pass
|
|
511
548
|
for key in magkeys:
|
|
@@ -584,7 +621,7 @@ class BioformatsFileTileSource(FileTileSource, metaclass=LruCacheMetaclass):
|
|
|
584
621
|
return self._metadata
|
|
585
622
|
|
|
586
623
|
@methodcache()
|
|
587
|
-
def getTile(self, x, y, z, pilImageAllowed=False, numpyAllowed=False, **kwargs):
|
|
624
|
+
def getTile(self, x, y, z, pilImageAllowed=False, numpyAllowed=False, **kwargs): # noqa
|
|
588
625
|
self._xyzInRange(x, y, z)
|
|
589
626
|
ft = fc = fz = 0
|
|
590
627
|
fseries = self._metadata['frameSeries'][0]
|
|
@@ -617,7 +654,7 @@ class BioformatsFileTileSource(FileTileSource, metaclass=LruCacheMetaclass):
|
|
|
617
654
|
height = min(height, sizeYAtScale - offsety)
|
|
618
655
|
|
|
619
656
|
if scale >= 2 ** self._maxSkippedLevels:
|
|
620
|
-
tile = self._getTileFromEmptyLevel(x, y, z, **kwargs)
|
|
657
|
+
tile, _format = self._getTileFromEmptyLevel(x, y, z, **kwargs)
|
|
621
658
|
tile = large_image.tilesource.base._imageToNumpy(tile)[0]
|
|
622
659
|
format = TILE_FORMAT_NUMPY
|
|
623
660
|
else:
|
|
@@ -639,9 +676,14 @@ class BioformatsFileTileSource(FileTileSource, metaclass=LruCacheMetaclass):
|
|
|
639
676
|
format = TILE_FORMAT_NUMPY
|
|
640
677
|
except javabridge.JavaException as exc:
|
|
641
678
|
es = javabridge.to_string(exc.throwable)
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
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
|
|
645
687
|
finally:
|
|
646
688
|
if javabridge.get_env():
|
|
647
689
|
javabridge.detach()
|
|
@@ -651,6 +693,8 @@ class BioformatsFileTileSource(FileTileSource, metaclass=LruCacheMetaclass):
|
|
|
651
693
|
fillValue = 0
|
|
652
694
|
if tile.dtype == np.uint16:
|
|
653
695
|
fillValue = 65535
|
|
696
|
+
elif tile.dtype == np.int16:
|
|
697
|
+
fillValue = 32767
|
|
654
698
|
elif tile.dtype == np.uint8:
|
|
655
699
|
fillValue = 255
|
|
656
700
|
elif tile.dtype.kind == 'f':
|
|
@@ -681,7 +725,7 @@ class BioformatsFileTileSource(FileTileSource, metaclass=LruCacheMetaclass):
|
|
|
681
725
|
"""
|
|
682
726
|
info = self._metadata['seriesAssociatedImages'].get(imageKey)
|
|
683
727
|
if info is None:
|
|
684
|
-
return
|
|
728
|
+
return None
|
|
685
729
|
series = info['seriesNum']
|
|
686
730
|
with self._tileLock:
|
|
687
731
|
try:
|
|
@@ -699,6 +743,31 @@ class BioformatsFileTileSource(FileTileSource, metaclass=LruCacheMetaclass):
|
|
|
699
743
|
javabridge.detach()
|
|
700
744
|
return large_image.tilesource.base._imageToPIL(image)
|
|
701
745
|
|
|
746
|
+
@classmethod
|
|
747
|
+
def addKnownExtensions(cls):
|
|
748
|
+
# This starts javabridge/bioformats if needed
|
|
749
|
+
_getBioformatsVersion()
|
|
750
|
+
if not hasattr(cls, '_addedExtensions'):
|
|
751
|
+
cls._addedExtensions = True
|
|
752
|
+
cls.extensions = cls.extensions.copy()
|
|
753
|
+
for dotext in bioformats.READABLE_FORMATS:
|
|
754
|
+
ext = dotext.strip('.')
|
|
755
|
+
if ext not in cls.extensions:
|
|
756
|
+
cls.extensions[ext] = SourcePriority.IMPLICIT
|
|
757
|
+
# The python modules doesn't list all the extensions that can be
|
|
758
|
+
# read, so supplement from the jar
|
|
759
|
+
readerlist = zipfile.ZipFile(
|
|
760
|
+
pathlib.Path(bioformats.__file__).parent /
|
|
761
|
+
'jars/bioformats_package.jar',
|
|
762
|
+
).open('loci/formats/readers.txt').read(100000).decode().split('\n')
|
|
763
|
+
pattern = re.compile(r'^loci\.formats\.in\..* # (?:.*?\b(\w{2,})\b(?:,|\s|$))')
|
|
764
|
+
for line in readerlist:
|
|
765
|
+
for ext in set(pattern.findall(line)) - {
|
|
766
|
+
'pattern', 'urlreader', 'screen', 'zip', 'zarr', 'db',
|
|
767
|
+
'fake', 'no'}:
|
|
768
|
+
if ext not in cls.extensions:
|
|
769
|
+
cls.extensions[ext] = SourcePriority.IMPLICIT
|
|
770
|
+
|
|
702
771
|
|
|
703
772
|
def open(*args, **kwargs):
|
|
704
773
|
"""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: large-image-source-bioformats
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.30.7.dev12
|
|
4
4
|
Summary: An bioformats tilesource for large_image.
|
|
5
5
|
Home-page: https://github.com/girder/large_image
|
|
6
6
|
Author: Kitware, Inc.
|
|
@@ -15,9 +15,14 @@ Classifier: Programming Language :: Python :: 3.9
|
|
|
15
15
|
Classifier: Programming Language :: Python :: 3.10
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.11
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
19
|
Requires-Python: >=3.8
|
|
19
|
-
|
|
20
|
+
Description-Content-Type: text/x-rst
|
|
20
21
|
License-File: LICENSE
|
|
22
|
+
Requires-Dist: large-image>=1.30.7.dev12
|
|
23
|
+
Requires-Dist: python-bioformats>=1.5.2
|
|
24
|
+
Provides-Extra: girder
|
|
25
|
+
Requires-Dist: girder-large-image>=1.30.7.dev12; extra == "girder"
|
|
21
26
|
|
|
22
27
|
An bioformats tilesource for large_image.
|
|
23
28
|
|
{large-image-source-bioformats-1.27.5.dev6 → large_image_source_bioformats-1.30.7.dev12}/setup.py
RENAMED
|
@@ -19,8 +19,7 @@ def prerelease_local_scheme(version):
|
|
|
19
19
|
|
|
20
20
|
if os.getenv('CIRCLE_BRANCH') in ('master', ):
|
|
21
21
|
return ''
|
|
22
|
-
|
|
23
|
-
return get_local_node_and_date(version)
|
|
22
|
+
return get_local_node_and_date(version)
|
|
24
23
|
|
|
25
24
|
|
|
26
25
|
try:
|
|
@@ -37,6 +36,7 @@ setup(
|
|
|
37
36
|
'fallback_version': '0.0.0'},
|
|
38
37
|
description=description,
|
|
39
38
|
long_description=long_description,
|
|
39
|
+
long_description_content_type='text/x-rst',
|
|
40
40
|
license='Apache Software License 2.0',
|
|
41
41
|
author='Kitware, Inc.',
|
|
42
42
|
author_email='kitware@kitware.com',
|
|
@@ -49,6 +49,7 @@ setup(
|
|
|
49
49
|
'Programming Language :: Python :: 3.10',
|
|
50
50
|
'Programming Language :: Python :: 3.11',
|
|
51
51
|
'Programming Language :: Python :: 3.12',
|
|
52
|
+
'Programming Language :: Python :: 3.13',
|
|
52
53
|
],
|
|
53
54
|
install_requires=[
|
|
54
55
|
f'large-image{limit_version}',
|
{large-image-source-bioformats-1.27.5.dev6 → large_image_source_bioformats-1.30.7.dev12}/LICENSE
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.27.5.dev6 → large_image_source_bioformats-1.30.7.dev12}/setup.cfg
RENAMED
|
File without changes
|