tiamat-python 0.1.17__tar.gz → 0.1.19__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.
Files changed (51) hide show
  1. {tiamat_python-0.1.17/tiamat_python.egg-info → tiamat_python-0.1.19}/PKG-INFO +1 -1
  2. {tiamat_python-0.1.17 → tiamat_python-0.1.19}/tiamat/readers/zarr.py +21 -7
  3. {tiamat_python-0.1.17 → tiamat_python-0.1.19/tiamat_python.egg-info}/PKG-INFO +1 -1
  4. {tiamat_python-0.1.17 → tiamat_python-0.1.19}/LICENSE +0 -0
  5. {tiamat_python-0.1.17 → tiamat_python-0.1.19}/README.md +0 -0
  6. {tiamat_python-0.1.17 → tiamat_python-0.1.19}/README.rst +0 -0
  7. {tiamat_python-0.1.17 → tiamat_python-0.1.19}/pyproject.toml +0 -0
  8. {tiamat_python-0.1.17 → tiamat_python-0.1.19}/setup.cfg +0 -0
  9. {tiamat_python-0.1.17 → tiamat_python-0.1.19}/setup.py +0 -0
  10. {tiamat_python-0.1.17 → tiamat_python-0.1.19}/tests/test_metadata.py +0 -0
  11. {tiamat_python-0.1.17 → tiamat_python-0.1.19}/tests/test_package.py +0 -0
  12. {tiamat_python-0.1.17 → tiamat_python-0.1.19}/tests/test_pipeline.py +0 -0
  13. {tiamat_python-0.1.17 → tiamat_python-0.1.19}/tiamat/__init__.py +0 -0
  14. {tiamat_python-0.1.17 → tiamat_python-0.1.19}/tiamat/array.py +0 -0
  15. {tiamat_python-0.1.17 → tiamat_python-0.1.19}/tiamat/cache.py +0 -0
  16. {tiamat_python-0.1.17 → tiamat_python-0.1.19}/tiamat/cli.py +0 -0
  17. {tiamat_python-0.1.17 → tiamat_python-0.1.19}/tiamat/constants.py +0 -0
  18. {tiamat_python-0.1.17 → tiamat_python-0.1.19}/tiamat/errors.py +0 -0
  19. {tiamat_python-0.1.17 → tiamat_python-0.1.19}/tiamat/io.py +0 -0
  20. {tiamat_python-0.1.17 → tiamat_python-0.1.19}/tiamat/metadata/__init__.py +0 -0
  21. {tiamat_python-0.1.17 → tiamat_python-0.1.19}/tiamat/metadata/dimensions.py +0 -0
  22. {tiamat_python-0.1.17 → tiamat_python-0.1.19}/tiamat/metadata/metadata.py +0 -0
  23. {tiamat_python-0.1.17 → tiamat_python-0.1.19}/tiamat/pipeline.py +0 -0
  24. {tiamat_python-0.1.17 → tiamat_python-0.1.19}/tiamat/readers/__init__.py +0 -0
  25. {tiamat_python-0.1.17 → tiamat_python-0.1.19}/tiamat/readers/factory.py +0 -0
  26. {tiamat_python-0.1.17 → tiamat_python-0.1.19}/tiamat/readers/generic.py +0 -0
  27. {tiamat_python-0.1.17 → tiamat_python-0.1.19}/tiamat/readers/memory.py +0 -0
  28. {tiamat_python-0.1.17 → tiamat_python-0.1.19}/tiamat/readers/nifti.py +0 -0
  29. {tiamat_python-0.1.17 → tiamat_python-0.1.19}/tiamat/readers/pipeline.py +0 -0
  30. {tiamat_python-0.1.17 → tiamat_python-0.1.19}/tiamat/readers/processing.py +0 -0
  31. {tiamat_python-0.1.17 → tiamat_python-0.1.19}/tiamat/readers/protocol.py +0 -0
  32. {tiamat_python-0.1.17 → tiamat_python-0.1.19}/tiamat/readers/stack.py +0 -0
  33. {tiamat_python-0.1.17 → tiamat_python-0.1.19}/tiamat/serialization.py +0 -0
  34. {tiamat_python-0.1.17 → tiamat_python-0.1.19}/tiamat/transformers/__init__.py +0 -0
  35. {tiamat_python-0.1.17 → tiamat_python-0.1.19}/tiamat/transformers/access.py +0 -0
  36. {tiamat_python-0.1.17 → tiamat_python-0.1.19}/tiamat/transformers/affine.py +0 -0
  37. {tiamat_python-0.1.17 → tiamat_python-0.1.19}/tiamat/transformers/axes.py +0 -0
  38. {tiamat_python-0.1.17 → tiamat_python-0.1.19}/tiamat/transformers/color.py +0 -0
  39. {tiamat_python-0.1.17 → tiamat_python-0.1.19}/tiamat/transformers/coordinates.py +0 -0
  40. {tiamat_python-0.1.17 → tiamat_python-0.1.19}/tiamat/transformers/dfield.py +0 -0
  41. {tiamat_python-0.1.17 → tiamat_python-0.1.19}/tiamat/transformers/intensity_mapping.py +0 -0
  42. {tiamat_python-0.1.17 → tiamat_python-0.1.19}/tiamat/transformers/mask.py +0 -0
  43. {tiamat_python-0.1.17 → tiamat_python-0.1.19}/tiamat/transformers/metadata.py +0 -0
  44. {tiamat_python-0.1.17 → tiamat_python-0.1.19}/tiamat/transformers/normalization.py +0 -0
  45. {tiamat_python-0.1.17 → tiamat_python-0.1.19}/tiamat/transformers/protocol.py +0 -0
  46. {tiamat_python-0.1.17 → tiamat_python-0.1.19}/tiamat/transformers/view.py +0 -0
  47. {tiamat_python-0.1.17 → tiamat_python-0.1.19}/tiamat_python.egg-info/SOURCES.txt +0 -0
  48. {tiamat_python-0.1.17 → tiamat_python-0.1.19}/tiamat_python.egg-info/dependency_links.txt +0 -0
  49. {tiamat_python-0.1.17 → tiamat_python-0.1.19}/tiamat_python.egg-info/entry_points.txt +0 -0
  50. {tiamat_python-0.1.17 → tiamat_python-0.1.19}/tiamat_python.egg-info/requires.txt +0 -0
  51. {tiamat_python-0.1.17 → tiamat_python-0.1.19}/tiamat_python.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tiamat-python
3
- Version: 0.1.17
3
+ Version: 0.1.19
4
4
  Summary: Tiled Image Access, Manipulation, and Analysis Toolkit
5
5
  Author-email: "Big Data Analytics Group, Forschungszentrum Juelich, Institute of Neuroscience and Medicine (INM-1)" <inm1-bda@fz-juelich.de>
6
6
  License:
@@ -1,5 +1,6 @@
1
1
  """
2
- Reader for OME-Zarr (Zarr v3 / OME-NGFF >=0.5).
2
+ Reader for OME-Zarr (Zarr v3 / OME-NGFF >=0.5): directories (.zarr) and zip files (.zarr.zip,
3
+ and .ozx, the single-file OME-Zarr extension).
3
4
  """
4
5
 
5
6
  from __future__ import annotations
@@ -22,7 +23,7 @@ except Exception: # pragma: no cover
22
23
 
23
24
  from tiamat.cache import instance_cache
24
25
  from tiamat.io import ImageAccessor
25
- from tiamat.metadata import ImageMetadata
26
+ from tiamat.metadata import ImageMetadata, dimensions
26
27
  from tiamat.readers.protocol import ImageReader
27
28
 
28
29
  # retrieved from https://ngff.openmicroscopy.org/specifications/0.5/index.html#axes-metadata
@@ -128,7 +129,7 @@ class OmeZarrReader(ImageReader):
128
129
  return False
129
130
 
130
131
  lower = str(fname).lower()
131
- is_zip = lower.endswith(".zarr.zip") or lower.endswith(".ome.zarr.zip")
132
+ is_zip = lower.endswith((".zarr.zip", ".ozx"))
132
133
  is_dir_like = lower.endswith(".zarr") or lower.endswith(".ome.zarr")
133
134
 
134
135
  if not (is_zip or is_dir_like):
@@ -212,7 +213,7 @@ class OmeZarrReader(ImageReader):
212
213
  image=arr,
213
214
  metadata=self.read_metadata(),
214
215
  accessor=accessor,
215
- image_scale=tuple(level_factors),
216
+ image_scale=self._to_spatial_meta(level_factors),
216
217
  )
217
218
 
218
219
  @instance_cache
@@ -241,7 +242,7 @@ class OmeZarrReader(ImageReader):
241
242
  @cached_property
242
243
  def _kvstore_spec(self) -> dict[str, Any]:
243
244
  lower = self.fname.lower()
244
- if lower.endswith(".zip"):
245
+ if lower.endswith((".zip", ".ozx")):
245
246
  return {
246
247
  "driver": "zip",
247
248
  "base": {
@@ -346,9 +347,22 @@ class OmeZarrReader(ImageReader):
346
347
  raise TypeError(f"Cannot determine value range for dtype {dtype}")
347
348
  return info.min, info.max
348
349
 
350
+ def _to_spatial_meta(self, values: list[float]) -> tuple[float, ...]:
351
+ """
352
+ Project a per-axis vector onto the spatial ``(x, y, z)`` order.
353
+
354
+ ``values`` is in this reader's ``axes_names`` order (e.g. ``c, x, y, z``).
355
+ The rest of tiamat treats ``scale`` and ``spacing`` as spatial-only vectors
356
+ in ``META_DIMENSIONS`` order (see ``tiamat.metadata.dimensions``), so non-spatial
357
+ axes (channel, time) are dropped and the remaining ones reordered by name.
358
+ """
359
+ by_axis = dict(zip(self.axes_names, values))
360
+ meta_axes = (dimensions.X, dimensions.Y, dimensions.Z)
361
+ return tuple(by_axis[axis] for axis in meta_axes if axis in by_axis)
362
+
349
363
  @cached_property
350
364
  def pixel_spacing(self) -> tuple[float, ...]:
351
- return tuple(self._dataset_physical_scales(0))
365
+ return self._to_spatial_meta(self._dataset_physical_scales(0))
352
366
 
353
367
  def _scale_transform_for_dataset(self, level: int) -> list[float]:
354
368
  transforms = self._datasets[level].get("coordinateTransformations", [])
@@ -398,7 +412,7 @@ class OmeZarrReader(ImageReader):
398
412
  def scales(self) -> list[tuple[float, ...]]:
399
413
  factors = []
400
414
  for lvl in range(len(self._datasets)):
401
- factors.append(tuple(self._level_factors(lvl)[::-1]))
415
+ factors.append(self._to_spatial_meta(self._level_factors(lvl)))
402
416
  return factors
403
417
 
404
418
  @instance_cache
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tiamat-python
3
- Version: 0.1.17
3
+ Version: 0.1.19
4
4
  Summary: Tiled Image Access, Manipulation, and Analysis Toolkit
5
5
  Author-email: "Big Data Analytics Group, Forschungszentrum Juelich, Institute of Neuroscience and Medicine (INM-1)" <inm1-bda@fz-juelich.de>
6
6
  License:
File without changes
File without changes
File without changes
File without changes