Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
ce7b8c7
feat: add OMEZarrScene
jo-mueller Aug 4, 2026
92e2281
tests: add tests for OMEZarrScene
jo-mueller Aug 4, 2026
b700a98
docs; add documentation for OMEZarrScene
jo-mueller Aug 4, 2026
af27cb1
feat: write 0.6, not 0.6.dev4
jo-mueller Jul 24, 2026
1f36579
feat write 0.6
jo-mueller Jul 24, 2026
82e46a5
feat: add missing version checks in additional metadata
jo-mueller Jul 24, 2026
e0e0135
tests: add 0.6 to tested versions in writer
jo-mueller Jul 24, 2026
018e942
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 24, 2026
538541a
tests: pull out scale transforms correctly irrespective of version
jo-mueller Jul 24, 2026
935842c
feat: default to 0.6 for writing
jo-mueller Jul 30, 2026
a7d097c
feat: add formatV06 class
jo-mueller Jul 30, 2026
2a93d4f
tests: add checks for what version is encountered
jo-mueller Jul 30, 2026
38a6cdd
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 30, 2026
59ad17d
Revert "[pre-commit.ci] auto fixes from pre-commit.com hooks"
jo-mueller Jul 31, 2026
53c2750
Revert "tests: add checks for what version is encountered"
jo-mueller Jul 31, 2026
f543138
Revert "feat: add formatV06 class"
jo-mueller Jul 31, 2026
a213ad4
deps: pin to zarr-python <3.3.0
jo-mueller Jul 31, 2026
b1c510f
Revert "deps: pin to zarr-python <3.3.0"
jo-mueller Jul 31, 2026
7a5809d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 4, 2026
5394cb1
deps: bump required python
jo-mueller Aug 4, 2026
9828592
feat: add explicit inverse
jo-mueller Aug 4, 2026
4235c68
feat: default coordinate systems to `()` rather than None
jo-mueller Aug 5, 2026
ad8ea3c
feat: use pydantic feature to pop `None`s from generated dicts
jo-mueller Aug 5, 2026
faee5e1
chore: type checks
jo-mueller Aug 5, 2026
529b9cf
feat: add properties/getters/setters
jo-mueller Aug 5, 2026
8b3810b
docs: add docstring for metadata property
jo-mueller Aug 5, 2026
0041226
docs: complete docstring
jo-mueller Aug 5, 2026
7db011d
feat: add compute parameter to writer method
jo-mueller Aug 5, 2026
dd1070f
feat: more powerful get_coordinate_system function
jo-mueller Aug 5, 2026
c933832
chore: type checker
jo-mueller Aug 5, 2026
7e3eaf8
docs: improve docstring
jo-mueller Aug 5, 2026
0b1ad99
feat: posixnames and tnd querying by tuples
jo-mueller Aug 6, 2026
c3bc9c8
fix: do not forget building the graph on init :)
jo-mueller Aug 6, 2026
17cfbb9
tests: fix call to test
jo-mueller Aug 6, 2026
9f851e1
feat: remove tqdm
jo-mueller Aug 6, 2026
207cfe3
test: fix version check for 0.6
jo-mueller Aug 6, 2026
ef0a3d2
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 6, 2026
39c9e12
tests: more tests
jo-mueller Aug 7, 2026
e24ceeb
tests: expand upon coordinate system retrieval
jo-mueller Aug 7, 2026
df610fd
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 7, 2026
f141081
chore: use python 3.12 type declaration
jo-mueller Aug 7, 2026
aac2471
Merge branch 'OMEZarrScene' of https://github.com/jo-mueller/ome-zarr…
jo-mueller Aug 7, 2026
5847668
feat: do not return empty list if no global cs found
jo-mueller Aug 7, 2026
e927f89
feat: do not simplify on graph build
jo-mueller Aug 7, 2026
3e2c389
deps: require latest ozmp
jo-mueller Aug 7, 2026
37d125a
refactor: change arg order in `get_coordinate_system` function
jo-mueller Aug 7, 2026
1b5bcee
feat: simplify tnd conversion
jo-mueller Aug 10, 2026
dccfcf5
feat: make sure rotation matrix is passed correctly as square affine
jo-mueller Aug 10, 2026
d356656
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 10, 2026
8d34fd1
refactor: query coordinate system by (path, name)
jo-mueller Aug 13, 2026
ed6e47e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 13, 2026
2d62ea6
Merge branch 'master' into OMEZarrScene
jo-mueller Aug 18, 2026
f718162
refactor: rename arg to `coordinate_displacements`
jo-mueller Aug 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.11', '3.12', '3.13']
python-version: ['3.12', '3.13', '3.14']
os: ['windows-latest', 'macos-latest', 'ubuntu-latest']
dask-version: [ 'latest' ]
include:
- os: ubuntu-latest
python-version: '3.11'
python-version: '3.12'
dask-version: '2025.2.0'
steps:
- uses: actions/checkout@v4
Expand Down
3 changes: 3 additions & 0 deletions docs/source/_toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ parts:
- file: advanced/transforms/index
sections:
- file: advanced/transforms/add_transforms_to_multiscales
- file: advanced/transforms/create_scenes
- file: advanced/transforms/reading_scenes
- file: advanced/transforms/scene_2d_to_3d

- file: advanced/sharding
- file: advanced/build_custom_pyramid
Expand Down
255 changes: 255 additions & 0 deletions docs/source/advanced/transforms/create_scenes.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,255 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "8b0be7e9",
"metadata": {},
"source": [
"# Create Scenes\n",
"\n",
"(advanced:create-scenes)=\n",
"\n",
"This tutorial demonstrates basic usage around writing and reading [Ngff Scenes](https://ngff.openmicroscopy.org/specifications/dev/index.html#scene-metadata) using the {py:class}`ome_zarr.classes.scene.OMEZarrScene` class."
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "a49ec1c2",
"metadata": {},
"outputs": [],
"source": [
"from skimage import data\n",
"\n",
"from ome_zarr import OMEZarrImage, OMEZarrMultiscale, OMEZarrScene"
]
},
{
"cell_type": "markdown",
"id": "98bbabd7",
"metadata": {},
"source": [
"We create some sample data, which we will store as a tiled layout in a scene zarr group:"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "e3023c95",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"c:\\Users\\johan\\Documents\\GitHub\\ome-zarr-py\\.venv\\Lib\\site-packages\\tqdm\\auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n",
" from .autonotebook import tqdm as notebook_tqdm\n"
]
},
{
"data": {
"text/plain": [
"(512, 512)"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"example_image = data.human_mitosis()\n",
"example_image.shape"
]
},
{
"cell_type": "markdown",
"id": "71e31e2a",
"metadata": {},
"source": [
"First, we cut the image into four tiles and convert them into instances of {py:class}`ome_zarr.classes.image.OMEZarrMultiscale`:"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "017d4c59",
"metadata": {},
"outputs": [],
"source": [
"img1 = OMEZarrImage(data=example_image[:256, :256], axes=[\"y\", \"x\"], name=\"img1\")\n",
"img2 = OMEZarrImage(data=example_image[256:, :256], axes=[\"y\", \"x\"], name=\"img2\")\n",
"img3 = OMEZarrImage(data=example_image[:256, 256:], axes=[\"y\", \"x\"], name=\"img3\")\n",
"img4 = OMEZarrImage(data=example_image[256:, 256:], axes=[\"y\", \"x\"], name=\"img4\")\n",
"\n",
"img1_ms = OMEZarrMultiscale(img1)\n",
"img2_ms = OMEZarrMultiscale(img2)\n",
"img3_ms = OMEZarrMultiscale(img3)\n",
"img4_ms = OMEZarrMultiscale(img4)"
]
},
{
"cell_type": "markdown",
"id": "cf59df32",
"metadata": {},
"source": [
"Next, we need to define a coordinate system into which all images are projected.\n",
"This is defined in accordance with the NGFF [coordinate systems specification](https://ngff.openmicroscopy.org/specifications/dev/index.html#coordinatesystems-metadata)."
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "994674c2",
"metadata": {},
"outputs": [],
"source": [
"coordinate_system = {\n",
" \"name\": \"world\",\n",
" \"axes\": [\n",
" {\"name\": \"y\", \"type\": \"space\"},\n",
" {\"name\": \"x\", \"type\": \"space\"},\n",
" ],\n",
"}"
]
},
{
"cell_type": "markdown",
"id": "c1d629be",
"metadata": {},
"source": [
"We then define translations that move each tile into the appropriate position in the world coordinate system.\n",
"In this example, these are simple translations in the y and x dimensions:"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "d6329caa",
"metadata": {},
"outputs": [],
"source": [
"coordinate_transformations = [\n",
" {\n",
" \"type\": \"translation\",\n",
" \"translation\": [0, 0],\n",
" \"input\": {\"path\": \"img1\", \"name\": \"physical\"},\n",
" \"output\": {\"name\": \"world\"},\n",
" },\n",
" {\n",
" \"type\": \"translation\",\n",
" \"translation\": [256, 0],\n",
" \"input\": {\"path\": \"img2\", \"name\": \"physical\"},\n",
" \"output\": {\"name\": \"world\"},\n",
" },\n",
" {\n",
" \"type\": \"translation\",\n",
" \"translation\": [0, 256],\n",
" \"input\": {\"path\": \"img3\", \"name\": \"physical\"},\n",
" \"output\": {\"name\": \"world\"},\n",
" },\n",
" {\n",
" \"type\": \"translation\",\n",
" \"translation\": [256, 256],\n",
" \"input\": {\"path\": \"img4\", \"name\": \"physical\"},\n",
" \"output\": {\"name\": \"world\"},\n",
" },\n",
"]"
]
},
{
"cell_type": "markdown",
"id": "4444a8d3",
"metadata": {},
"source": [
"We can then create and write a scene like this:"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "d05be093",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"Writing images: 100%|\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588| 4/4 [00:00<00:00, 7.08it/s]\n"
]
}
],
"source": [
"scene = OMEZarrScene(\n",
" images=[img1_ms, img2_ms, img3_ms, img4_ms],\n",
" coordinate_systems=[coordinate_system],\n",
" coordinate_transformations=coordinate_transformations\n",
")\n",
"\n",
"scene.to_ome_zarr(\"test_example_scene.zarr\", overwrite=True)"
]
},
{
"cell_type": "markdown",
"id": "9333cd91",
"metadata": {},
"source": [
"....and load it back like this:"
]
},
{
"cell_type": "code",
"execution_count": 12,
"id": "8b87b923",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(Translation(type='translation', input=CoordinateSystemIdentifier(name='physical', path='img1'), output=CoordinateSystemIdentifier(name='world', path=None), name=None, translation=(0.0, 0.0)),\n",
" Translation(type='translation', input=CoordinateSystemIdentifier(name='physical', path='img2'), output=CoordinateSystemIdentifier(name='world', path=None), name=None, translation=(256.0, 0.0)),\n",
" Translation(type='translation', input=CoordinateSystemIdentifier(name='physical', path='img3'), output=CoordinateSystemIdentifier(name='world', path=None), name=None, translation=(0.0, 256.0)),\n",
" Translation(type='translation', input=CoordinateSystemIdentifier(name='physical', path='img4'), output=CoordinateSystemIdentifier(name='world', path=None), name=None, translation=(256.0, 256.0)))"
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"loaded_scene = OMEZarrScene.from_ome_zarr(\"test_example_scene.zarr\")\n",
"loaded_scene.coordinate_transformations"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "cd5dda7c",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "ome-zarr (3.13.12)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.13.12"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
92 changes: 92 additions & 0 deletions docs/source/advanced/transforms/reading_scenes.ipynb

Large diffs are not rendered by default.

Loading
Loading