patchworks 0.11.8__tar.gz → 0.11.9__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 (69) hide show
  1. {patchworks-0.11.8 → patchworks-0.11.9}/PKG-INFO +7 -1
  2. {patchworks-0.11.8 → patchworks-0.11.9}/pyproject.toml +10 -1
  3. {patchworks-0.11.8 → patchworks-0.11.9}/src/patchworks/plugins/napari.py +25 -2
  4. {patchworks-0.11.8 → patchworks-0.11.9}/.github/workflows/docs.yml +0 -0
  5. {patchworks-0.11.8 → patchworks-0.11.9}/.github/workflows/lint.yml +0 -0
  6. {patchworks-0.11.8 → patchworks-0.11.9}/.github/workflows/release.yml +0 -0
  7. {patchworks-0.11.8 → patchworks-0.11.9}/.gitignore +0 -0
  8. {patchworks-0.11.8 → patchworks-0.11.9}/.markdownlint-cli2.yaml +0 -0
  9. {patchworks-0.11.8 → patchworks-0.11.9}/README.md +0 -0
  10. {patchworks-0.11.8 → patchworks-0.11.9}/cliff.toml +0 -0
  11. {patchworks-0.11.8 → patchworks-0.11.9}/docs/api/chunks.md +0 -0
  12. {patchworks-0.11.8 → patchworks-0.11.9}/docs/api/cluster.md +0 -0
  13. {patchworks-0.11.8 → patchworks-0.11.9}/docs/api/io.md +0 -0
  14. {patchworks-0.11.8 → patchworks-0.11.9}/docs/api/merge_tile_labels.md +0 -0
  15. {patchworks-0.11.8 → patchworks-0.11.9}/docs/api/plugins/cellpose.md +0 -0
  16. {patchworks-0.11.8 → patchworks-0.11.9}/docs/api/plugins/napari.md +0 -0
  17. {patchworks-0.11.8 → patchworks-0.11.9}/docs/api/plugins/ome_zarr.md +0 -0
  18. {patchworks-0.11.8 → patchworks-0.11.9}/docs/api/relabel.md +0 -0
  19. {patchworks-0.11.8 → patchworks-0.11.9}/docs/api/tile_process.md +0 -0
  20. {patchworks-0.11.8 → patchworks-0.11.9}/docs/examples/cellpose_2d.md +0 -0
  21. {patchworks-0.11.8 → patchworks-0.11.9}/docs/examples/cellpose_2d.py +0 -0
  22. {patchworks-0.11.8 → patchworks-0.11.9}/docs/examples/cellpose_3d.md +0 -0
  23. {patchworks-0.11.8 → patchworks-0.11.9}/docs/examples/cellpose_3d.py +0 -0
  24. {patchworks-0.11.8 → patchworks-0.11.9}/docs/examples/custom.md +0 -0
  25. {patchworks-0.11.8 → patchworks-0.11.9}/docs/examples/custom_method.py +0 -0
  26. {patchworks-0.11.8 → patchworks-0.11.9}/docs/examples/standalone_merge.md +0 -0
  27. {patchworks-0.11.8 → patchworks-0.11.9}/docs/examples/stardist.md +0 -0
  28. {patchworks-0.11.8 → patchworks-0.11.9}/docs/examples/stardist_2d.py +0 -0
  29. {patchworks-0.11.8 → patchworks-0.11.9}/docs/getting_started.md +0 -0
  30. {patchworks-0.11.8 → patchworks-0.11.9}/docs/guide/gpu_distributed.md +0 -0
  31. {patchworks-0.11.8 → patchworks-0.11.9}/docs/guide/merging.md +0 -0
  32. {patchworks-0.11.8 → patchworks-0.11.9}/docs/guide/ome_zarr_napari.md +0 -0
  33. {patchworks-0.11.8 → patchworks-0.11.9}/docs/guide/performance.md +0 -0
  34. {patchworks-0.11.8 → patchworks-0.11.9}/docs/guide/pitfalls.md +0 -0
  35. {patchworks-0.11.8 → patchworks-0.11.9}/docs/guide/skip_empty.md +0 -0
  36. {patchworks-0.11.8 → patchworks-0.11.9}/docs/guide/snakemake.md +0 -0
  37. {patchworks-0.11.8 → patchworks-0.11.9}/docs/guide/tiling.md +0 -0
  38. {patchworks-0.11.8 → patchworks-0.11.9}/docs/index.md +0 -0
  39. {patchworks-0.11.8 → patchworks-0.11.9}/mkdocs.yml +0 -0
  40. {patchworks-0.11.8 → patchworks-0.11.9}/src/patchworks/__init__.py +0 -0
  41. {patchworks-0.11.8 → patchworks-0.11.9}/src/patchworks/_chunks.py +0 -0
  42. {patchworks-0.11.8 → patchworks-0.11.9}/src/patchworks/_cluster.py +0 -0
  43. {patchworks-0.11.8 → patchworks-0.11.9}/src/patchworks/_core.py +0 -0
  44. {patchworks-0.11.8 → patchworks-0.11.9}/src/patchworks/_distributed.py +0 -0
  45. {patchworks-0.11.8 → patchworks-0.11.9}/src/patchworks/_io.py +0 -0
  46. {patchworks-0.11.8 → patchworks-0.11.9}/src/patchworks/_merge.py +0 -0
  47. {patchworks-0.11.8 → patchworks-0.11.9}/src/patchworks/_relabel.py +0 -0
  48. {patchworks-0.11.8 → patchworks-0.11.9}/src/patchworks/plugins/__init__.py +0 -0
  49. {patchworks-0.11.8 → patchworks-0.11.9}/src/patchworks/plugins/cellpose.py +0 -0
  50. {patchworks-0.11.8 → patchworks-0.11.9}/src/patchworks/plugins/ome_zarr.py +0 -0
  51. {patchworks-0.11.8 → patchworks-0.11.9}/tests/test_core.py +0 -0
  52. {patchworks-0.11.8 → patchworks-0.11.9}/tests/test_distributed.py +0 -0
  53. {patchworks-0.11.8 → patchworks-0.11.9}/tests/test_napari.py +0 -0
  54. {patchworks-0.11.8 → patchworks-0.11.9}/tests/test_ome_zarr.py +0 -0
  55. {patchworks-0.11.8 → patchworks-0.11.9}/workflow/README.md +0 -0
  56. {patchworks-0.11.8 → patchworks-0.11.9}/workflow/Snakefile +0 -0
  57. {patchworks-0.11.8 → patchworks-0.11.9}/workflow/config/config.yaml +0 -0
  58. {patchworks-0.11.8 → patchworks-0.11.9}/workflow/pixi.toml +0 -0
  59. {patchworks-0.11.8 → patchworks-0.11.9}/workflow/profile/slurm/config.yaml +0 -0
  60. {patchworks-0.11.8 → patchworks-0.11.9}/workflow/rules/common.smk +0 -0
  61. {patchworks-0.11.8 → patchworks-0.11.9}/workflow/rules/convert.smk +0 -0
  62. {patchworks-0.11.8 → patchworks-0.11.9}/workflow/rules/merge.smk +0 -0
  63. {patchworks-0.11.8 → patchworks-0.11.9}/workflow/rules/segment.smk +0 -0
  64. {patchworks-0.11.8 → patchworks-0.11.9}/workflow/scripts/_pw.py +0 -0
  65. {patchworks-0.11.8 → patchworks-0.11.9}/workflow/scripts/convert.py +0 -0
  66. {patchworks-0.11.8 → patchworks-0.11.9}/workflow/scripts/fetch_model.py +0 -0
  67. {patchworks-0.11.8 → patchworks-0.11.9}/workflow/scripts/merge.py +0 -0
  68. {patchworks-0.11.8 → patchworks-0.11.9}/workflow/scripts/prepare_tiles.py +0 -0
  69. {patchworks-0.11.8 → patchworks-0.11.9}/workflow/scripts/segment_tile.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: patchworks
3
- Version: 0.11.8
3
+ Version: 0.11.9
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
@@ -29,9 +29,12 @@ Requires-Dist: bioio-lif; extra == 'all'
29
29
  Requires-Dist: bioio-nd2; extra == 'all'
30
30
  Requires-Dist: bioio-ome-tiff; extra == 'all'
31
31
  Requires-Dist: bioio-tifffile; extra == 'all'
32
+ Requires-Dist: glasbey; extra == 'all'
32
33
  Requires-Dist: imaris-ims-file-reader; extra == 'all'
34
+ Requires-Dist: ipykernel<7; extra == 'all'
33
35
  Requires-Dist: lxml-html-clean; extra == 'all'
34
36
  Requires-Dist: napari[all]>=0.5.5; extra == 'all'
37
+ Requires-Dist: numpy<2.5; extra == 'all'
35
38
  Requires-Dist: nvidia-ml-py; extra == 'all'
36
39
  Requires-Dist: psutil; extra == 'all'
37
40
  Requires-Dist: scikit-image; extra == 'all'
@@ -63,8 +66,11 @@ Provides-Extra: io
63
66
  Requires-Dist: psutil; extra == 'io'
64
67
  Requires-Dist: tqdm; extra == 'io'
65
68
  Provides-Extra: napari
69
+ Requires-Dist: glasbey; extra == 'napari'
70
+ Requires-Dist: ipykernel<7; extra == 'napari'
66
71
  Requires-Dist: lxml-html-clean; extra == 'napari'
67
72
  Requires-Dist: napari[all]>=0.5.5; extra == 'napari'
73
+ Requires-Dist: numpy<2.5; extra == 'napari'
68
74
  Provides-Extra: workflow
69
75
  Requires-Dist: snakemake-executor-plugin-slurm; extra == 'workflow'
70
76
  Requires-Dist: snakemake>=8; extra == 'workflow'
@@ -59,9 +59,18 @@ imaris = ["imaris-ims-file-reader"]
59
59
  # napari enables the interactive viewer plugin.
60
60
  # - napari >= 0.5: NumPy 2.0 compatible (older 0.4.x uses np.array(copy=False),
61
61
  # which raises under NumPy 2 -> ValidationError on Viewer()).
62
+ # - numpy < 2.5: napari/numba don't support numpy 2.5 yet.
63
+ # - ipykernel < 7: napari-console requires ipykernel < 7.
62
64
  # - lxml-html-clean: napari's notebook_display imports lxml.html.clean, split
63
65
  # into a separate package in lxml >= 5.2 (else ImportError on Viewer()).
64
- napari = ["napari[all]>=0.5.5", "lxml-html-clean"]
66
+ # - glasbey: distinct high-contrast label LUTs for view_in_napari.
67
+ napari = [
68
+ "napari[all]>=0.5.5",
69
+ "numpy<2.5",
70
+ "ipykernel<7",
71
+ "lxml-html-clean",
72
+ "glasbey",
73
+ ]
65
74
  # workflow runs the Snakemake pipeline (per-tile SLURM jobs across GPUs).
66
75
  workflow = ["snakemake>=8", "snakemake-executor-plugin-slurm"]
67
76
  dev = ["pytest", "pytest-cov", "scikit-image", "psutil", "tqdm"]
@@ -199,6 +199,7 @@ def view_in_napari(
199
199
  labels_component: str = "labels",
200
200
  image_name: str = "image",
201
201
  labels_name: str = "labels",
202
+ glasbey: bool = True,
202
203
  show: bool = True,
203
204
  **add_image_kwargs: Any,
204
205
  ):
@@ -223,6 +224,11 @@ def view_in_napari(
223
224
  matching ``tile_process``'s ``output_component``).
224
225
  image_name, labels_name : str, optional
225
226
  Layer names shown in napari.
227
+ glasbey : bool, optional
228
+ Colour the labels with a glasbey palette (many distinct, high-contrast
229
+ colours, tuned to read on the dark canvas) instead of napari's default.
230
+ Default ``True``. Needs the ``glasbey`` package (ships with
231
+ ``patchworks[napari]``).
226
232
  show : bool, optional
227
233
  Start the napari event loop (blocking). Set ``False`` in scripts/tests
228
234
  that manage the loop themselves.
@@ -250,9 +256,24 @@ def view_in_napari(
250
256
  **add_image_kwargs,
251
257
  )
252
258
 
259
+ label_kwargs: dict[str, Any] = {}
260
+ if glasbey:
261
+ try:
262
+ import glasbey as _glasbey
263
+
264
+ # bias lighter so colours read on napari's dark canvas
265
+ label_kwargs["colormap"] = _glasbey.create_palette(
266
+ 256, lightness_bounds=(40, 100)
267
+ )
268
+ except ImportError:
269
+ logger.warning(
270
+ "glasbey not installed; using napari's default label colours "
271
+ "(pip install glasbey, or it ships with patchworks[napari])."
272
+ )
273
+
253
274
  if labels is not None:
254
275
  lab = _resolve_labels(labels, labels_component)
255
- viewer.add_labels(lab, name=labels_name)
276
+ viewer.add_labels(lab, name=labels_name, **label_kwargs)
256
277
  elif _is_zarr(image):
257
278
  # No labels given → auto-overlay every label image stored inside the
258
279
  # OME-ZARR under labels/<name>/ (the default place tile_process writes
@@ -260,7 +281,9 @@ def view_in_napari(
260
281
  for name in _inner_label_names(image):
261
282
  levels = _multiscale_levels(f"{image}/labels/{name}", None)
262
283
  lab = [lvl.astype("int32") for lvl in levels]
263
- viewer.add_labels(lab if len(lab) > 1 else lab[0], name=name)
284
+ viewer.add_labels(
285
+ lab if len(lab) > 1 else lab[0], name=name, **label_kwargs
286
+ )
264
287
  logger.info("auto-loaded labels/%s from %s", name, image)
265
288
 
266
289
  if show:
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes