large-image-source-openslide 1.28.3.dev46__py3-none-any.whl → 1.29.0__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.
- large_image_source_openslide/__init__.py +27 -0
- {large_image_source_openslide-1.28.3.dev46.dist-info → large_image_source_openslide-1.29.0.dist-info}/METADATA +3 -3
- large_image_source_openslide-1.29.0.dist-info/RECORD +8 -0
- large_image_source_openslide-1.28.3.dev46.dist-info/RECORD +0 -8
- {large_image_source_openslide-1.28.3.dev46.dist-info → large_image_source_openslide-1.29.0.dist-info}/LICENSE +0 -0
- {large_image_source_openslide-1.28.3.dev46.dist-info → large_image_source_openslide-1.29.0.dist-info}/WHEEL +0 -0
- {large_image_source_openslide-1.28.3.dev46.dist-info → large_image_source_openslide-1.29.0.dist-info}/entry_points.txt +0 -0
- {large_image_source_openslide-1.28.3.dev46.dist-info → large_image_source_openslide-1.29.0.dist-info}/top_level.txt +0 -0
@@ -154,6 +154,30 @@ class OpenslideFileTileSource(FileTileSource, metaclass=LruCacheMetaclass):
|
|
154
154
|
'svslevel': bestlevel,
|
155
155
|
'scale': scale,
|
156
156
|
})
|
157
|
+
self._bounds = None
|
158
|
+
try:
|
159
|
+
bounds = {
|
160
|
+
'x': int(self._openslide.properties[openslide.PROPERTY_NAME_BOUNDS_X]),
|
161
|
+
'y': int(self._openslide.properties[openslide.PROPERTY_NAME_BOUNDS_Y]),
|
162
|
+
'width': int(self._openslide.properties[openslide.PROPERTY_NAME_BOUNDS_WIDTH]),
|
163
|
+
'height': int(self._openslide.properties[openslide.PROPERTY_NAME_BOUNDS_HEIGHT]),
|
164
|
+
}
|
165
|
+
if (
|
166
|
+
bounds['x'] >= 0 and bounds['width'] > 0 and
|
167
|
+
bounds['x'] + bounds['width'] <= self.sizeX and
|
168
|
+
bounds['y'] >= 0 and bounds['height'] > 0 and
|
169
|
+
bounds['y'] + bounds['height'] <= self.sizeY and
|
170
|
+
(bounds['width'] < self.sizeX or bounds['height'] < self.sizeY)
|
171
|
+
):
|
172
|
+
self._bounds = bounds
|
173
|
+
self.sizeX, self.sizeY = bounds['width'], bounds['height']
|
174
|
+
prevlevels = self.levels
|
175
|
+
self.levels = int(math.ceil(max(
|
176
|
+
math.log(float(self.sizeX) / self.tileWidth),
|
177
|
+
math.log(float(self.sizeY) / self.tileHeight)) / math.log(2))) + 1
|
178
|
+
self._svslevels = self._svslevels[prevlevels - self.levels:]
|
179
|
+
except Exception:
|
180
|
+
pass
|
157
181
|
self._populatedLevels = len({l['svslevel'] for l in self._svslevels})
|
158
182
|
|
159
183
|
def _getTileSize(self):
|
@@ -292,6 +316,9 @@ class OpenslideFileTileSource(FileTileSource, metaclass=LruCacheMetaclass):
|
|
292
316
|
scale = 2 ** (self.levels - 1 - z)
|
293
317
|
offsetx = x * self.tileWidth * scale
|
294
318
|
offsety = y * self.tileHeight * scale
|
319
|
+
if self._bounds is not None:
|
320
|
+
offsetx += self._bounds['x'] // svslevel['scale']
|
321
|
+
offsety += self._bounds['y'] // svslevel['scale']
|
295
322
|
# We ask to read an area that will cover the tile at the z level. The
|
296
323
|
# scale we computed in the __init__ process for this svs level tells
|
297
324
|
# how much larger a region we need to read.
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: large-image-source-openslide
|
3
|
-
Version: 1.
|
3
|
+
Version: 1.29.0
|
4
4
|
Summary: An Openslide tilesource for large_image.
|
5
5
|
Home-page: https://github.com/girder/large_image
|
6
6
|
Author: Kitware, Inc.
|
@@ -17,11 +17,11 @@ Classifier: Programming Language :: Python :: 3.11
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.12
|
18
18
|
Requires-Python: >=3.8
|
19
19
|
License-File: LICENSE
|
20
|
-
Requires-Dist: large-image >=1.
|
20
|
+
Requires-Dist: large-image >=1.29.0
|
21
21
|
Requires-Dist: openslide-python >=1.1.0
|
22
22
|
Requires-Dist: tifftools >=1.2.0
|
23
23
|
Provides-Extra: girder
|
24
|
-
Requires-Dist: girder-large-image >=1.
|
24
|
+
Requires-Dist: girder-large-image >=1.29.0 ; extra == 'girder'
|
25
25
|
|
26
26
|
An Openslide tilesource for large_image.
|
27
27
|
|
@@ -0,0 +1,8 @@
|
|
1
|
+
large_image_source_openslide/__init__.py,sha256=wDHAbKTIr0isHryi1TIZUPeASzkmpa36Yim6Uu3_uzQ,19961
|
2
|
+
large_image_source_openslide/girder_source.py,sha256=ntLgOinO7xcO85wFbjx6XEBmTgEtx5cuPZ_K6wXZzqA,1199
|
3
|
+
large_image_source_openslide-1.29.0.dist-info/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
|
4
|
+
large_image_source_openslide-1.29.0.dist-info/METADATA,sha256=ytHq4BWBtg2ZgQI5XPX6WOJBVENc9F6-c_bz6i3P36Y,1048
|
5
|
+
large_image_source_openslide-1.29.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
6
|
+
large_image_source_openslide-1.29.0.dist-info/entry_points.txt,sha256=4Z5cf63yeesvHxiR9W1dY3rfz5_V4Ck2xYhPUp4A1qA,196
|
7
|
+
large_image_source_openslide-1.29.0.dist-info/top_level.txt,sha256=wqaQQDWQl9a_l9s6n07tTxfjeEXePtHBhz1np6aUwQE,29
|
8
|
+
large_image_source_openslide-1.29.0.dist-info/RECORD,,
|
@@ -1,8 +0,0 @@
|
|
1
|
-
large_image_source_openslide/__init__.py,sha256=jus5yoUvyPHefCSHFvlFYJYx83KMlK-V7OViVyH9vAw,18512
|
2
|
-
large_image_source_openslide/girder_source.py,sha256=ntLgOinO7xcO85wFbjx6XEBmTgEtx5cuPZ_K6wXZzqA,1199
|
3
|
-
large_image_source_openslide-1.28.3.dev46.dist-info/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
|
4
|
-
large_image_source_openslide-1.28.3.dev46.dist-info/METADATA,sha256=8IH3737a2NjRNeYx2ek2YnPVODJbwYjKTq1ln8zTaGc,1066
|
5
|
-
large_image_source_openslide-1.28.3.dev46.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
6
|
-
large_image_source_openslide-1.28.3.dev46.dist-info/entry_points.txt,sha256=4Z5cf63yeesvHxiR9W1dY3rfz5_V4Ck2xYhPUp4A1qA,196
|
7
|
-
large_image_source_openslide-1.28.3.dev46.dist-info/top_level.txt,sha256=wqaQQDWQl9a_l9s6n07tTxfjeEXePtHBhz1np6aUwQE,29
|
8
|
-
large_image_source_openslide-1.28.3.dev46.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|