large-image-source-multi 1.29.7.dev24__tar.gz → 1.29.7.dev38__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-multi-1.29.7.dev24/large_image_source_multi.egg-info → large-image-source-multi-1.29.7.dev38}/PKG-INFO +3 -4
- {large-image-source-multi-1.29.7.dev24 → large-image-source-multi-1.29.7.dev38}/large_image_source_multi/__init__.py +23 -67
- {large-image-source-multi-1.29.7.dev24 → large-image-source-multi-1.29.7.dev38/large_image_source_multi.egg-info}/PKG-INFO +3 -4
- large-image-source-multi-1.29.7.dev38/large_image_source_multi.egg-info/requires.txt +9 -0
- {large-image-source-multi-1.29.7.dev24 → large-image-source-multi-1.29.7.dev38}/setup.py +0 -1
- large-image-source-multi-1.29.7.dev24/large_image_source_multi.egg-info/requires.txt +0 -9
- {large-image-source-multi-1.29.7.dev24 → large-image-source-multi-1.29.7.dev38}/LICENSE +0 -0
- {large-image-source-multi-1.29.7.dev24 → large-image-source-multi-1.29.7.dev38}/README.rst +0 -0
- {large-image-source-multi-1.29.7.dev24 → large-image-source-multi-1.29.7.dev38}/docs/specification.rst +0 -0
- {large-image-source-multi-1.29.7.dev24 → large-image-source-multi-1.29.7.dev38}/large_image_source_multi/girder_source.py +0 -0
- {large-image-source-multi-1.29.7.dev24 → large-image-source-multi-1.29.7.dev38}/large_image_source_multi.egg-info/SOURCES.txt +0 -0
- {large-image-source-multi-1.29.7.dev24 → large-image-source-multi-1.29.7.dev38}/large_image_source_multi.egg-info/dependency_links.txt +0 -0
- {large-image-source-multi-1.29.7.dev24 → large-image-source-multi-1.29.7.dev38}/large_image_source_multi.egg-info/entry_points.txt +0 -0
- {large-image-source-multi-1.29.7.dev24 → large-image-source-multi-1.29.7.dev38}/large_image_source_multi.egg-info/top_level.txt +0 -0
- {large-image-source-multi-1.29.7.dev24 → large-image-source-multi-1.29.7.dev38}/pyproject.toml +0 -0
- {large-image-source-multi-1.29.7.dev24 → large-image-source-multi-1.29.7.dev38}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: large-image-source-multi
|
|
3
|
-
Version: 1.29.7.
|
|
3
|
+
Version: 1.29.7.dev38
|
|
4
4
|
Summary: A tilesource for large_image to composite other tile sources
|
|
5
5
|
Home-page: https://github.com/girder/large_image
|
|
6
6
|
Author: Kitware, Inc.
|
|
@@ -16,15 +16,14 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.11
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.12
|
|
18
18
|
Requires-Python: >=3.6
|
|
19
|
-
Description-Content-Type: text/x-rst
|
|
20
19
|
License-File: LICENSE
|
|
21
20
|
Requires-Dist: jsonschema
|
|
22
|
-
Requires-Dist: large-image>=1.29.7.
|
|
21
|
+
Requires-Dist: large-image>=1.29.7.dev38
|
|
23
22
|
Requires-Dist: pyyaml
|
|
24
23
|
Provides-Extra: all
|
|
25
24
|
Requires-Dist: scikit-image; extra == "all"
|
|
26
25
|
Provides-Extra: girder
|
|
27
|
-
Requires-Dist: girder-large-image>=1.29.7.
|
|
26
|
+
Requires-Dist: girder-large-image>=1.29.7.dev38; extra == "girder"
|
|
28
27
|
|
|
29
28
|
A tilesource for large_image to composite other tile sources
|
|
30
29
|
|
|
@@ -288,18 +288,6 @@ SourceEntrySchema = {
|
|
|
288
288
|
'type': 'array',
|
|
289
289
|
'items': {'type': 'integer'},
|
|
290
290
|
},
|
|
291
|
-
'sampleScale': {
|
|
292
|
-
'description':
|
|
293
|
-
'Each pixel sample values is divided by this scale after any '
|
|
294
|
-
'sampleOffset has been applied',
|
|
295
|
-
'type': 'number',
|
|
296
|
-
},
|
|
297
|
-
'sampleOffset': {
|
|
298
|
-
'description':
|
|
299
|
-
'This is added to each pixel sample value before any '
|
|
300
|
-
'sampleScale is applied',
|
|
301
|
-
'type': 'number',
|
|
302
|
-
},
|
|
303
291
|
'style': {'type': 'object'},
|
|
304
292
|
'params': {
|
|
305
293
|
'description':
|
|
@@ -818,7 +806,7 @@ class MultiFileTileSource(FileTileSource, metaclass=LruCacheMetaclass):
|
|
|
818
806
|
self._bands = {}
|
|
819
807
|
self._bands.update(tsMeta['bands'])
|
|
820
808
|
lastSource = source
|
|
821
|
-
self.
|
|
809
|
+
self._bandcount = 1 if self._info.get('singleBand') else (
|
|
822
810
|
len(self._bands) if hasattr(self, '_bands') else (bandCount or None))
|
|
823
811
|
bbox = self._sourceBoundingBox(source, tsMeta['sizeX'], tsMeta['sizeY'])
|
|
824
812
|
computedWidth = max(computedWidth, int(math.ceil(bbox['right'])))
|
|
@@ -887,20 +875,6 @@ class MultiFileTileSource(FileTileSource, metaclass=LruCacheMetaclass):
|
|
|
887
875
|
if params is None:
|
|
888
876
|
params = source.get('params', {})
|
|
889
877
|
ts = openFunc(source['path'], **params)
|
|
890
|
-
if (self._dtype and np.dtype(ts.dtype).kind == 'f' and self._dtype.kind != 'f' and
|
|
891
|
-
'sampleScale' not in source and 'sampleOffset' not in source):
|
|
892
|
-
minval = maxval = 0
|
|
893
|
-
for f in range(ts.frames):
|
|
894
|
-
ftile = ts.getTile(x=0, y=0, z=0, frame=f, numpyAllowed='always')
|
|
895
|
-
minval = min(minval, np.amin(ftile))
|
|
896
|
-
maxval = max(maxval, np.amax(ftile))
|
|
897
|
-
if minval >= 0 and maxval <= 1:
|
|
898
|
-
source['sampleScale'] = None
|
|
899
|
-
elif minval >= 0:
|
|
900
|
-
source['sampleScale'] = 2 ** math.ceil(math.log2(maxval))
|
|
901
|
-
else:
|
|
902
|
-
source['sampleScale'] = 2 ** math.ceil(math.log2(max(-minval, maxval)) + 1)
|
|
903
|
-
source['sampleOffset'] = source['sampleScale'] / 2
|
|
904
878
|
source['sourceName'] = ts.name
|
|
905
879
|
with self._lastOpenSourceLock:
|
|
906
880
|
self._lastOpenSource = {
|
|
@@ -1028,8 +1002,8 @@ class MultiFileTileSource(FileTileSource, metaclass=LruCacheMetaclass):
|
|
|
1028
1002
|
"""
|
|
1029
1003
|
Determine where the target tile's corners are located on the source.
|
|
1030
1004
|
Fetch that so that we have at least sqrt(2) more resolution, then use
|
|
1031
|
-
scikit-image warp to transform it. scikit-image does a better
|
|
1032
|
-
|
|
1005
|
+
scikit-image warp to transform it. scikit-image does a better job than
|
|
1006
|
+
scipy.ndimage.affine_transform.
|
|
1033
1007
|
|
|
1034
1008
|
:param ts: the source of the image to transform.
|
|
1035
1009
|
:param transform: a 3x3 affine 2d matrix for transforming the source
|
|
@@ -1118,35 +1092,28 @@ class MultiFileTileSource(FileTileSource, metaclass=LruCacheMetaclass):
|
|
|
1118
1092
|
x, y = int(math.floor(x)), int(math.floor(y))
|
|
1119
1093
|
# Recompute where the source corners will land
|
|
1120
1094
|
destcorners = (np.dot(transform, regioncorners.T).T).tolist()
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
max(max(math.ceil(c[0]) for c in destcorners), srcImage.shape[1]),
|
|
1124
|
-
]
|
|
1125
|
-
if max(0, -x) or max(0, -y):
|
|
1126
|
-
transform[0][2] -= max(0, -x)
|
|
1127
|
-
transform[1][2] -= max(0, -y)
|
|
1128
|
-
destShape[0] -= max(0, -y)
|
|
1129
|
-
destShape[1] -= max(0, -x)
|
|
1130
|
-
x += max(0, -x)
|
|
1131
|
-
y += max(0, -y)
|
|
1132
|
-
destShape = [min(destShape[0], outh - y), min(destShape[1], outw - x)]
|
|
1133
|
-
if destShape[0] <= 0 or destShape[1] <= 0:
|
|
1134
|
-
return None, None, None
|
|
1095
|
+
destsize = (max(math.ceil(c[0]) for c in destcorners),
|
|
1096
|
+
max(math.ceil(c[1]) for c in destcorners))
|
|
1135
1097
|
# Add an alpha band if needed
|
|
1136
1098
|
if srcImage.shape[2] in {1, 3}:
|
|
1137
1099
|
_, srcImage = _makeSameChannelDepth(np.zeros((1, 1, srcImage.shape[2] + 1)), srcImage)
|
|
1138
|
-
#
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1100
|
+
# Add enough space to warp the source image in place
|
|
1101
|
+
srcImage = np.pad(srcImage, (
|
|
1102
|
+
(0, max(0, destsize[1] - srcImage.shape[0])),
|
|
1103
|
+
(0, max(0, destsize[0] - srcImage.shape[1])),
|
|
1104
|
+
(0, 0)), mode='constant')
|
|
1142
1105
|
destImage = skimage.transform.warp(
|
|
1143
|
-
# Although using np.float32 could reduce memory use, it doesn't
|
|
1144
|
-
# provide any speed improvement
|
|
1145
1106
|
srcImage.astype(float),
|
|
1146
|
-
skimage.transform.AffineTransform(np.linalg.inv(
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
)
|
|
1107
|
+
skimage.transform.AffineTransform(np.linalg.inv(
|
|
1108
|
+
transform))).astype(srcImage.dtype)
|
|
1109
|
+
# Trim to target size and location
|
|
1110
|
+
destImage = destImage[max(0, -y):, max(0, -x):, :]
|
|
1111
|
+
x += max(0, -x)
|
|
1112
|
+
y += max(0, -y)
|
|
1113
|
+
if x >= outw or y >= outh:
|
|
1114
|
+
return None, None, None
|
|
1115
|
+
destImage = destImage[:min(destImage.shape[0], outh - y),
|
|
1116
|
+
:min(destImage.shape[1], outw - x), :]
|
|
1150
1117
|
return destImage, x, y
|
|
1151
1118
|
|
|
1152
1119
|
def _addSourceToTile(self, tile, sourceEntry, corners, scale):
|
|
@@ -1223,20 +1190,9 @@ class MultiFileTileSource(FileTileSource, metaclass=LruCacheMetaclass):
|
|
|
1223
1190
|
ts, transform, corners, scale, sourceEntry.get('frame', 0),
|
|
1224
1191
|
source.get('position', {}).get('crop'))
|
|
1225
1192
|
if sourceTile is not None and all(dim > 0 for dim in sourceTile.shape):
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
sourceTile = sourceTile.astype(float)
|
|
1230
|
-
if source.get('sampleOffset'):
|
|
1231
|
-
sourceTile[:, :, :-1] += source['sampleOffset']
|
|
1232
|
-
if source.get('sampleScale') and source.get('sampleScale') != 1:
|
|
1233
|
-
sourceTile[:, :, :-1] /= source['sampleScale']
|
|
1234
|
-
if sourceTile.dtype != targetDtype:
|
|
1235
|
-
if changeDtype:
|
|
1236
|
-
sourceTile = (
|
|
1237
|
-
sourceTile.astype(float) * fullAlphaValue(targetDtype) /
|
|
1238
|
-
fullAlphaValue(sourceTile))
|
|
1239
|
-
sourceTile = sourceTile.astype(targetDtype)
|
|
1193
|
+
sourceTile = sourceTile.astype(
|
|
1194
|
+
ts.dtype if not self._info.get('dtype') else
|
|
1195
|
+
np.dtype(self._info['dtype']))
|
|
1240
1196
|
tile = self._mergeTiles(tile, sourceTile, x, y)
|
|
1241
1197
|
return tile
|
|
1242
1198
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: large-image-source-multi
|
|
3
|
-
Version: 1.29.7.
|
|
3
|
+
Version: 1.29.7.dev38
|
|
4
4
|
Summary: A tilesource for large_image to composite other tile sources
|
|
5
5
|
Home-page: https://github.com/girder/large_image
|
|
6
6
|
Author: Kitware, Inc.
|
|
@@ -16,15 +16,14 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.11
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.12
|
|
18
18
|
Requires-Python: >=3.6
|
|
19
|
-
Description-Content-Type: text/x-rst
|
|
20
19
|
License-File: LICENSE
|
|
21
20
|
Requires-Dist: jsonschema
|
|
22
|
-
Requires-Dist: large-image>=1.29.7.
|
|
21
|
+
Requires-Dist: large-image>=1.29.7.dev38
|
|
23
22
|
Requires-Dist: pyyaml
|
|
24
23
|
Provides-Extra: all
|
|
25
24
|
Requires-Dist: scikit-image; extra == "all"
|
|
26
25
|
Provides-Extra: girder
|
|
27
|
-
Requires-Dist: girder-large-image>=1.29.7.
|
|
26
|
+
Requires-Dist: girder-large-image>=1.29.7.dev38; extra == "girder"
|
|
28
27
|
|
|
29
28
|
A tilesource for large_image to composite other tile sources
|
|
30
29
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{large-image-source-multi-1.29.7.dev24 → large-image-source-multi-1.29.7.dev38}/pyproject.toml
RENAMED
|
File without changes
|
|
File without changes
|