patchworks 0.8.0__tar.gz → 0.8.1__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 (50) hide show
  1. {patchworks-0.8.0 → patchworks-0.8.1}/PKG-INFO +1 -1
  2. {patchworks-0.8.0 → patchworks-0.8.1}/src/patchworks/plugins/ome_zarr.py +31 -4
  3. {patchworks-0.8.0 → patchworks-0.8.1}/.github/workflows/docs.yml +0 -0
  4. {patchworks-0.8.0 → patchworks-0.8.1}/.github/workflows/lint.yml +0 -0
  5. {patchworks-0.8.0 → patchworks-0.8.1}/.github/workflows/release.yml +0 -0
  6. {patchworks-0.8.0 → patchworks-0.8.1}/.gitignore +0 -0
  7. {patchworks-0.8.0 → patchworks-0.8.1}/README.md +0 -0
  8. {patchworks-0.8.0 → patchworks-0.8.1}/cliff.toml +0 -0
  9. {patchworks-0.8.0 → patchworks-0.8.1}/docs/api/chunks.md +0 -0
  10. {patchworks-0.8.0 → patchworks-0.8.1}/docs/api/cluster.md +0 -0
  11. {patchworks-0.8.0 → patchworks-0.8.1}/docs/api/io.md +0 -0
  12. {patchworks-0.8.0 → patchworks-0.8.1}/docs/api/merge_tile_labels.md +0 -0
  13. {patchworks-0.8.0 → patchworks-0.8.1}/docs/api/plugins/cellpose.md +0 -0
  14. {patchworks-0.8.0 → patchworks-0.8.1}/docs/api/plugins/napari.md +0 -0
  15. {patchworks-0.8.0 → patchworks-0.8.1}/docs/api/plugins/ome_zarr.md +0 -0
  16. {patchworks-0.8.0 → patchworks-0.8.1}/docs/api/relabel.md +0 -0
  17. {patchworks-0.8.0 → patchworks-0.8.1}/docs/api/tile_process.md +0 -0
  18. {patchworks-0.8.0 → patchworks-0.8.1}/docs/examples/cellpose_2d.md +0 -0
  19. {patchworks-0.8.0 → patchworks-0.8.1}/docs/examples/cellpose_2d.py +0 -0
  20. {patchworks-0.8.0 → patchworks-0.8.1}/docs/examples/cellpose_3d.md +0 -0
  21. {patchworks-0.8.0 → patchworks-0.8.1}/docs/examples/cellpose_3d.py +0 -0
  22. {patchworks-0.8.0 → patchworks-0.8.1}/docs/examples/custom.md +0 -0
  23. {patchworks-0.8.0 → patchworks-0.8.1}/docs/examples/custom_method.py +0 -0
  24. {patchworks-0.8.0 → patchworks-0.8.1}/docs/examples/standalone_merge.md +0 -0
  25. {patchworks-0.8.0 → patchworks-0.8.1}/docs/examples/stardist.md +0 -0
  26. {patchworks-0.8.0 → patchworks-0.8.1}/docs/examples/stardist_2d.py +0 -0
  27. {patchworks-0.8.0 → patchworks-0.8.1}/docs/getting_started.md +0 -0
  28. {patchworks-0.8.0 → patchworks-0.8.1}/docs/guide/gpu_distributed.md +0 -0
  29. {patchworks-0.8.0 → patchworks-0.8.1}/docs/guide/merging.md +0 -0
  30. {patchworks-0.8.0 → patchworks-0.8.1}/docs/guide/ome_zarr_napari.md +0 -0
  31. {patchworks-0.8.0 → patchworks-0.8.1}/docs/guide/performance.md +0 -0
  32. {patchworks-0.8.0 → patchworks-0.8.1}/docs/guide/pitfalls.md +0 -0
  33. {patchworks-0.8.0 → patchworks-0.8.1}/docs/guide/skip_empty.md +0 -0
  34. {patchworks-0.8.0 → patchworks-0.8.1}/docs/guide/tiling.md +0 -0
  35. {patchworks-0.8.0 → patchworks-0.8.1}/docs/index.md +0 -0
  36. {patchworks-0.8.0 → patchworks-0.8.1}/mkdocs.yml +0 -0
  37. {patchworks-0.8.0 → patchworks-0.8.1}/pyproject.toml +0 -0
  38. {patchworks-0.8.0 → patchworks-0.8.1}/src/patchworks/__init__.py +0 -0
  39. {patchworks-0.8.0 → patchworks-0.8.1}/src/patchworks/_chunks.py +0 -0
  40. {patchworks-0.8.0 → patchworks-0.8.1}/src/patchworks/_cluster.py +0 -0
  41. {patchworks-0.8.0 → patchworks-0.8.1}/src/patchworks/_core.py +0 -0
  42. {patchworks-0.8.0 → patchworks-0.8.1}/src/patchworks/_io.py +0 -0
  43. {patchworks-0.8.0 → patchworks-0.8.1}/src/patchworks/_merge.py +0 -0
  44. {patchworks-0.8.0 → patchworks-0.8.1}/src/patchworks/_relabel.py +0 -0
  45. {patchworks-0.8.0 → patchworks-0.8.1}/src/patchworks/plugins/__init__.py +0 -0
  46. {patchworks-0.8.0 → patchworks-0.8.1}/src/patchworks/plugins/cellpose.py +0 -0
  47. {patchworks-0.8.0 → patchworks-0.8.1}/src/patchworks/plugins/napari.py +0 -0
  48. {patchworks-0.8.0 → patchworks-0.8.1}/tests/test_core.py +0 -0
  49. {patchworks-0.8.0 → patchworks-0.8.1}/tests/test_napari.py +0 -0
  50. {patchworks-0.8.0 → patchworks-0.8.1}/tests/test_ome_zarr.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: patchworks
3
- Version: 0.8.0
3
+ Version: 0.8.1
4
4
  Summary: Tiled processing of arbitrarily large images with globally consistent labels
5
5
  Project-URL: Homepage, https://github.com/imcf/patchworks
6
6
  Project-URL: Issues, https://github.com/imcf/patchworks/issues
@@ -265,11 +265,38 @@ def _open_imaris(path: str, level: int = 0) -> tuple[da.Array, str, PixelSize]:
265
265
  "Install it with:\n pip install 'patchworks[imaris]'"
266
266
  ) from exc
267
267
 
268
- # The object is array-like and h5py-backed (lazy).
269
- reader = ims(path, ResolutionLevelLock=level)
270
- order = _DEFAULT_ORDER[len(_DEFAULT_ORDER) - reader.ndim :]
271
- arr = da.from_array(reader, chunks=_default_chunks(reader.shape, order))
268
+ # Read straight from the underlying HDF5 datasets. The reader's own
269
+ # __getitem__ squeezes singletons and pads to chunk boundaries, which both
270
+ # break da.from_array; the raw h5py datasets slice exactly and keep their
271
+ # native chunking. Imaris stores one 3-D (Z, Y, X) Data array per
272
+ # (timepoint, channel), padded to a chunk multiple — crop to the true
273
+ # extent the reader reports.
274
+ import h5py
272
275
 
276
+ reader = ims(path, ResolutionLevelLock=level)
277
+ n_t = int(getattr(reader, "TimePoints", 1) or 1)
278
+ n_c = int(getattr(reader, "Channels", 1) or 1)
279
+ z, y, x = (int(s) for s in reader.shape[-3:])
280
+
281
+ # Open our own h5py handle (the reader closes its own on GC). The Dataset
282
+ # objects keep this File alive for the lifetime of the dask graph, and
283
+ # da.from_array's default read lock makes the (thread-unsafe) h5py reads
284
+ # safe under the threaded scheduler.
285
+ hf = h5py.File(path, "r")
286
+ t_stack = []
287
+ for t in range(n_t):
288
+ c_stack = []
289
+ for c in range(n_c):
290
+ ds = hf[
291
+ f"DataSet/ResolutionLevel {level}/TimePoint {t}/"
292
+ f"Channel {c}/Data"
293
+ ]
294
+ c_stack.append(da.from_array(ds, chunks=ds.chunks)[:z, :y, :x])
295
+ t_stack.append(da.stack(c_stack, axis=0)) # (c, z, y, x)
296
+ arr = da.stack(t_stack, axis=0) # (t, c, z, y, x)
297
+
298
+ # Drop singleton non-spatial axes for a tidy result.
299
+ order = "tczyx"
273
300
  keep = [
274
301
  i
275
302
  for i, name in enumerate(order)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes