large-image-source-tifffile 1.30.2.dev52__py3-none-any.whl → 1.30.3__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.

Potentially problematic release.


This version of large-image-source-tifffile might be problematic. Click here for more details.

@@ -292,68 +292,19 @@ class TifffileFileTileSource(FileTileSource, metaclass=LruCacheMetaclass):
292
292
  except Exception:
293
293
  pass
294
294
 
295
- def _handle_scn(self): # noqa
296
- """
297
- For SCN files, parse the xml and possibly adjust how associated images
298
- are labelled.
299
- """
295
+ def _handle_indica(self):
300
296
  import xml.etree.ElementTree
301
297
 
302
298
  import large_image.tilesource.utilities
303
299
 
304
- root = xml.etree.ElementTree.fromstring(self._tf.pages[0].description)
305
- self._xml = large_image.tilesource.utilities.etreeToDict(root)
306
- for collection in et_findall(root, 'collection'):
307
- sizeX = collection.attrib.get('sizeX')
308
- sizeY = collection.attrib.get('sizeY')
309
- for supplementalImage in et_findall(collection, 'supplementalImage'):
310
- name = supplementalImage.attrib.get('type', '').lower()
311
- ifd = supplementalImage.attrib.get('ifd', '')
312
- oldname = 'image_%s' % ifd
313
- if (name and ifd and oldname in self._associatedImages and
314
- name not in self._associatedImages):
315
- self._associatedImages[name] = self._associatedImages[oldname]
316
- self._associatedImages.pop(oldname, None)
317
- for image in et_findall(collection, 'image'):
318
- name = image.attrib.get('name', 'Unknown')
319
- for view in et_findall(image, 'view'):
320
- if (sizeX and view.attrib.get('sizeX') == sizeX and
321
- sizeY and view.attrib.get('sizeY') == sizeY and
322
- not int(view.attrib.get('offsetX')) and
323
- not int(view.attrib.get('offsetY')) and
324
- name.lower() in self._associatedImages and
325
- 'macro' not in self._associatedImages):
326
- self._associatedImages['macro'] = self._associatedImages[name.lower()]
327
- self._associatedImages.pop(name.lower(), None)
328
- if name != self._baseSeries.name:
329
- continue
330
- for scanSettings in et_findall(image, 'scanSettings'):
331
- for objectiveSettings in et_findall(scanSettings, 'objectiveSettings'):
332
- for objective in et_findall(objectiveSettings, 'objective'):
333
- if not hasattr(self, '_magnification') and float(objective.text) > 0:
334
- self._magnification = float(objective.text)
335
- for channelSettings in et_findall(scanSettings, 'channelSettings'):
336
- channels = {}
337
- for channel in et_findall(channelSettings, 'channel'):
338
- channels[int(channel.attrib.get('index', 0))] = (
339
- large_image.tilesource.utilities.etreeToDict(channel)['channel'])
340
- self._channelInfo = channels
341
- try:
342
- self._channels = [
343
- channels.get(idx)['name'].split('|')[0]
344
- for idx in range(len(channels))]
345
- except Exception:
346
- pass
347
-
348
- def _handle_svs(self):
349
- """
350
- For SVS files, parse the magnification and pixel size.
351
- """
352
300
  try:
353
- meta = self._tf.pages[0].description
354
- self._magnification = float(meta.split('AppMag = ')[1].split('|')[0].strip())
355
- self._mm_x = self._mm_y = float(
356
- meta.split('|MPP = ', 1)[1].split('|')[0].strip()) * 0.001
301
+ root = xml.etree.ElementTree.fromstring(self._tf.pages[0].description)
302
+ self._xml = large_image.tilesource.utilities.etreeToDict(root)
303
+ self._channels = [c['name'] for c in
304
+ self._xml['indica']['image']['channels']['channel']]
305
+ if len(self._basis) == 1 and 'I' in self._basis:
306
+ self._basis['C'] = self._basis.pop('I')
307
+ self._associatedImages.clear()
357
308
  except Exception:
358
309
  pass
359
310
 
@@ -414,6 +365,71 @@ class TifffileFileTileSource(FileTileSource, metaclass=LruCacheMetaclass):
414
365
  except Exception:
415
366
  pass
416
367
 
368
+ def _handle_scn(self): # noqa
369
+ """
370
+ For SCN files, parse the xml and possibly adjust how associated images
371
+ are labelled.
372
+ """
373
+ import xml.etree.ElementTree
374
+
375
+ import large_image.tilesource.utilities
376
+
377
+ root = xml.etree.ElementTree.fromstring(self._tf.pages[0].description)
378
+ self._xml = large_image.tilesource.utilities.etreeToDict(root)
379
+ for collection in et_findall(root, 'collection'):
380
+ sizeX = collection.attrib.get('sizeX')
381
+ sizeY = collection.attrib.get('sizeY')
382
+ for supplementalImage in et_findall(collection, 'supplementalImage'):
383
+ name = supplementalImage.attrib.get('type', '').lower()
384
+ ifd = supplementalImage.attrib.get('ifd', '')
385
+ oldname = 'image_%s' % ifd
386
+ if (name and ifd and oldname in self._associatedImages and
387
+ name not in self._associatedImages):
388
+ self._associatedImages[name] = self._associatedImages[oldname]
389
+ self._associatedImages.pop(oldname, None)
390
+ for image in et_findall(collection, 'image'):
391
+ name = image.attrib.get('name', 'Unknown')
392
+ for view in et_findall(image, 'view'):
393
+ if (sizeX and view.attrib.get('sizeX') == sizeX and
394
+ sizeY and view.attrib.get('sizeY') == sizeY and
395
+ not int(view.attrib.get('offsetX')) and
396
+ not int(view.attrib.get('offsetY')) and
397
+ name.lower() in self._associatedImages and
398
+ 'macro' not in self._associatedImages):
399
+ self._associatedImages['macro'] = self._associatedImages[name.lower()]
400
+ self._associatedImages.pop(name.lower(), None)
401
+ if name != self._baseSeries.name:
402
+ continue
403
+ for scanSettings in et_findall(image, 'scanSettings'):
404
+ for objectiveSettings in et_findall(scanSettings, 'objectiveSettings'):
405
+ for objective in et_findall(objectiveSettings, 'objective'):
406
+ if not hasattr(self, '_magnification') and float(objective.text) > 0:
407
+ self._magnification = float(objective.text)
408
+ for channelSettings in et_findall(scanSettings, 'channelSettings'):
409
+ channels = {}
410
+ for channel in et_findall(channelSettings, 'channel'):
411
+ channels[int(channel.attrib.get('index', 0))] = (
412
+ large_image.tilesource.utilities.etreeToDict(channel)['channel'])
413
+ self._channelInfo = channels
414
+ try:
415
+ self._channels = [
416
+ channels.get(idx)['name'].split('|')[0]
417
+ for idx in range(len(channels))]
418
+ except Exception:
419
+ pass
420
+
421
+ def _handle_svs(self):
422
+ """
423
+ For SVS files, parse the magnification and pixel size.
424
+ """
425
+ try:
426
+ meta = self._tf.pages[0].description
427
+ self._magnification = float(meta.split('AppMag = ')[1].split('|')[0].strip())
428
+ self._mm_x = self._mm_y = float(
429
+ meta.split('|MPP = ', 1)[1].split('|')[0].strip()) * 0.001
430
+ except Exception:
431
+ pass
432
+
417
433
  def getNativeMagnification(self):
418
434
  """
419
435
  Get the magnification at a particular level.
@@ -623,6 +639,8 @@ class TifffileFileTileSource(FileTileSource, metaclass=LruCacheMetaclass):
623
639
  sel.append(slice(series.shape[aidx]))
624
640
  baxis += 'S'
625
641
  else:
642
+ if axis not in self._basis and axis == 'I':
643
+ axis = 'C'
626
644
  sel.append((frame // self._basis[axis][0]) % self._basis[axis][2])
627
645
  tile = bza[tuple(sel)]
628
646
  # rotate
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: large-image-source-tifffile
3
- Version: 1.30.2.dev52
3
+ Version: 1.30.3
4
4
  Summary: A tifffile tilesource for large_image.
5
5
  Home-page: https://github.com/girder/large_image
6
6
  Author: Kitware, Inc.
@@ -19,12 +19,12 @@ Classifier: Programming Language :: Python :: 3.13
19
19
  Requires-Python: >=3.8
20
20
  Description-Content-Type: text/x-rst
21
21
  License-File: LICENSE
22
- Requires-Dist: large-image >=1.30.2.dev52
22
+ Requires-Dist: large-image>=1.30.3
23
23
  Requires-Dist: dask[array]
24
24
  Requires-Dist: tifffile[all]
25
25
  Requires-Dist: zarr
26
26
  Provides-Extra: girder
27
- Requires-Dist: girder-large-image >=1.30.2.dev52 ; extra == 'girder'
27
+ Requires-Dist: girder-large-image>=1.30.3; extra == "girder"
28
28
 
29
29
  A tifffile tilesource for large_image.
30
30
 
@@ -0,0 +1,8 @@
1
+ large_image_source_tifffile/__init__.py,sha256=DKDo0CHba44iLEi9B_Rr59iodoRaPFOdyYC8yfKFMx8,28136
2
+ large_image_source_tifffile/girder_source.py,sha256=8YsxpSK_UzbAcpjn6fIMlgKye2FchkB8_HTSQV0FpRA,1064
3
+ large_image_source_tifffile-1.30.3.dist-info/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
4
+ large_image_source_tifffile-1.30.3.dist-info/METADATA,sha256=O1qT-jo5t1g0wkTZNrNMfZiC-BhI2C63OMeMxwXeQxs,1131
5
+ large_image_source_tifffile-1.30.3.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
6
+ large_image_source_tifffile-1.30.3.dist-info/entry_points.txt,sha256=aILCN5f7-Zj8-WRXcABxCQvqJv9VLTvqRhZ_7HEyokc,190
7
+ large_image_source_tifffile-1.30.3.dist-info/top_level.txt,sha256=feOAsix2Rzy6mjy2Ua-N0-L6tlKsgvLdRhO6Hd8_ZFs,28
8
+ large_image_source_tifffile-1.30.3.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.2.0)
2
+ Generator: setuptools (75.6.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,8 +0,0 @@
1
- large_image_source_tifffile/__init__.py,sha256=4j4Ovb1V1xvbAKBFdm1Tbj5RvvgjRGmo_ABv4kjG2hc,27413
2
- large_image_source_tifffile/girder_source.py,sha256=8YsxpSK_UzbAcpjn6fIMlgKye2FchkB8_HTSQV0FpRA,1064
3
- large_image_source_tifffile-1.30.2.dev52.dist-info/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
4
- large_image_source_tifffile-1.30.2.dev52.dist-info/METADATA,sha256=AIWcxw0ixK5WFYAMQi4ImP3YsahmRD808tue6B65vtg,1152
5
- large_image_source_tifffile-1.30.2.dev52.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
6
- large_image_source_tifffile-1.30.2.dev52.dist-info/entry_points.txt,sha256=aILCN5f7-Zj8-WRXcABxCQvqJv9VLTvqRhZ_7HEyokc,190
7
- large_image_source_tifffile-1.30.2.dev52.dist-info/top_level.txt,sha256=feOAsix2Rzy6mjy2Ua-N0-L6tlKsgvLdRhO6Hd8_ZFs,28
8
- large_image_source_tifffile-1.30.2.dev52.dist-info/RECORD,,