diff --git a/index.md b/index.md
index ccee9425..be04aea8 100644
--- a/index.md
+++ b/index.md
@@ -4,6 +4,7 @@ short_title: OME-Zarr
---
# π§ Dev: 0.6.dev3 π§
+
(ngff-spec:spec:head)=
**Feedback:** [Forum](https://forum.image.sc/tag/ome-ngff), [Github](https://github.com/ome/ngff/issues)
@@ -82,7 +83,7 @@ Note that the number of dimensions is variable between 2 and 5 and that axis nam
β βββ zarr.json # All image arrays must be up to 5-dimensional
β β # with the axis of type time before type channel, before spatial axes.
β β
- β ββ ... # Chunks are stored conforming to the Zarr array specification and
+ β ββ ... # Chunks are stored conforming to the Zarr array specification and
β # metadata as specified in the array's `zarr.json`.
β
βββ labels
@@ -131,7 +132,7 @@ A well group SHOULD NOT be present if there are no images in the well.
β β βββ 0 # First field of view of well A1
β β β β
β β β βββ zarr.json # Implements "multiscales", "omero"
- β β β βββ 0 # Resolution levels
+ β β β βββ 0 # Resolution levels
β β β βββ ...
β β β βββ labels # Labels (optional)
β β βββ ... # Other fields of view
@@ -140,6 +141,7 @@ A well group SHOULD NOT be present if there are no images in the well.
```
## OME-Zarr Metadata
+
(metadata)=
The "OME-Zarr Metadata" contains metadata keys as specified below for discovering certain types of data, especially images.
@@ -163,10 +165,12 @@ The OME-Zarr Metadata version MUST be consistent within a hierarchy.
```
### "coordinateSystems" metadata
+
(coordinate-systems-md)=
A `coordinateSystem` is a JSON object with a `name` field and a `axes` field.
Every coordinate system:
+
- MUST contain the field `name`.
The value MUST be a non-empty string that is unique among all entries under `coordinateSystems`.
- MUST contain the field `axes`, whose value is an array of valid `axes` (see below).
@@ -189,12 +193,13 @@ Coordinate Systems metadata example
]
}
```
+
:::
The axes of a coordinate system (see below) give information
about the types, units, and other properties of the coordinate system's dimensions.
Axis names may contain semantically meaningful information, but can be arbitrary.
-As a result, two coordinate systems that have identical axes in the same order
+As a result, two coordinate systems that have identical axes in the same order
may not be "the same" in the sense that measurements at the same point
refer to different physical entities and therefore should not be analyzed jointly.
Tasks that require images, annotations, regions of interest, etc.,
@@ -209,6 +214,7 @@ and adds an interpretation to the samples along that dimension.
It is an array of objects,
where each object describes a dimension (axis) and:
+
- MUST contain the field `name` that gives the name for this dimension.
The values MUST be unique across all `name` fields in the same coordinate system.
- SHOULD contain the field `type`.
@@ -220,8 +226,8 @@ where each object describes a dimension (axis) and:
- SHOULD contain the field `unit` to specify the physical unit of this dimension.
The value SHOULD be one of the following strings,
which are valid units according to UDUNITS-2.
- - Units for `space` axes: 'angstrom', 'attometer', 'centimeter', 'decimeter', 'exameter', 'femtometer', 'foot', 'gigameter', 'hectometer', 'inch', 'kilometer', 'megameter', 'meter', 'micrometer', 'mile', 'millimeter', 'nanometer', 'parsec', 'petameter', 'picometer', 'terameter', 'yard', 'yoctometer', 'yottameter', 'zeptometer', 'zettameter'
- - Units for `time` axes: 'attosecond', 'centisecond', 'day', 'decisecond', 'exasecond', 'femtosecond', 'gigasecond', 'hectosecond', 'hour', 'kilosecond', 'megasecond', 'microsecond', 'millisecond', 'minute', 'nanosecond', 'petasecond', 'picosecond', 'second', 'terasecond', 'yoctosecond', 'yottasecond', 'zeptosecond', 'zettasecond'
+ - Units for `space` axes: 'angstrom', 'attometer', 'centimeter', 'decimeter', 'exameter', 'femtometer', 'foot', 'gigameter', 'hectometer', 'inch', 'kilometer', 'megameter', 'meter', 'micrometer', 'mile', 'millimeter', 'nanometer', 'parsec', 'petameter', 'picometer', 'terameter', 'yard', 'yoctometer', 'yottameter', 'zeptometer', 'zettameter'
+ - Units for `time` axes: 'attosecond', 'centisecond', 'day', 'decisecond', 'exasecond', 'femtosecond', 'gigasecond', 'hectosecond', 'hour', 'kilosecond', 'megasecond', 'microsecond', 'millisecond', 'minute', 'nanosecond', 'petasecond', 'picosecond', 'second', 'terasecond', 'yoctosecond', 'yottasecond', 'zeptosecond', 'zettasecond'
- MAY contain the field `longName`.
The value MUST be a string,
and can provide a longer name or description of an axis and its properties.
@@ -260,6 +266,7 @@ The i-th axis has `"name": "dim_i"` (these are the same default names used by [x
As with all coordinate systems, the dimension names must be unique and non-null.
:::{dropdown} Example
+
```json
{
"arrayCoordinateSystem" : {
@@ -275,6 +282,7 @@ As with all coordinate systems, the dimension names must be unique and non-null.
```
For example, if 0/zarr.json contains:
+
```jsonc
{
"zarr_format": 3,
@@ -291,7 +299,7 @@ Then `dim_0` has length 4, `dim_1` has length 3, and `dim_2` has length 5.
The axes and their order align with the shape of the corresponding zarr array,
and whose data depends on the byte order used to store chunks.
As described in the [Zarr array metadata](https://zarr.readthedocs.io/en/stable/spec/v3.html#arrays),
-the last dimension of an array in "C" order are stored contiguously on disk or in-memory when directly loaded.
+the last dimension of an array in "C" order are stored contiguously on disk or in-memory when directly loaded.
The name and axes names MAY be customized by including a `arrayCoordinateSystem` field
in the user-defined attributes of the array whose value is a coordinate system object.
@@ -342,6 +350,7 @@ series.ome.zarr # One converted fileset from bioformats2raw
```
#### bf2raw-attributes
+
(bf2raw-attributes-md)=
The OME-Zarr Metadata in the top-level `zarr.json` file must contain the `bioformats2raw.layout` key:
@@ -365,6 +374,7 @@ The OME-Zarr Metadata in the `zarr.json` file within the OME group may contain t
```
#### Details
+
(bf2raw-details)=
Conforming groups:
@@ -394,6 +404,7 @@ Conforming readers:
- MAY ignore other groups or arrays under the root of the hierarchy.
### "coordinateTransformations" metadata
+
(coord-trafo-md)=
`coordinateTransformations` describe the mapping between two coordinate systems (defined by [`coordinateSystems`](#coordinate-systems-md)).
@@ -432,7 +443,7 @@ The following transformations are supported:
| [`byDimension`](#bydimension-md) | `"transformations":List[Transformation]`,
`"input_axes": List[str]`,
`"output_axes": List[str]` | A high dimensional transformation using lower dimensional transformations on subsets of dimensions. |
Implementations SHOULD prefer to store transformations as a sequence of less expressive transformations where possible
-(e.g., sequence[translation, rotation], instead of affine transformation with translation/rotation).
+(e.g., sequence[translation, rotation], instead of affine transformation with translation/rotation).
:::{dropdown} Example
(spec:example:coordinate_transformation_scale)=
@@ -443,7 +454,7 @@ Implementations SHOULD prefer to store transformations as a sequence of less exp
{ "name": "in", "axes": [{"name": "j"}, {"name": "i"}] },
{ "name": "out", "axes": [{"name": "y"}, {"name": "x"}] }
],
- "coordinateTransformations": [
+ "coordinateTransformations": [
{
"type": "scale",
"scale": [2, 3.12],
@@ -466,6 +477,7 @@ i.e., the mapping from the first input axis to the first output axis is determin
:::
Conforming readers:
+
- MUST parse `identity`, `scale`, `translation` transformations;
- SHOULD parse `mapAxis`, `affine`, `rotation` transformations;
- SHOULD display an informative warning if encountering transformations that cannot be parsed or displayed by a viewer;
@@ -473,7 +485,7 @@ Conforming readers:
- SHOULD be able to apply transformations to images;
Coordinate transformations can be stored in multiple places to reflect different usecases.
-
+
- Transformations in individual multiscale datasets represent a special case of transformations
and are explained [below](#multiscales-md).
- Additional transformations for single multiscale images MUST be stored under a field `coordinateTransformations`
@@ -483,7 +495,6 @@ Coordinate transformations can be stored in multiple places to reflect different
For transformations that store data or parameters in a zarr array,
those zarr arrays SHOULD be stored in a zarr group called `coordinateTransformations`.
-
store.zarr # Root folder of the zarr store
β
@@ -571,6 +582,7 @@ The image at path `sampleA_instrument2` would have this as the first listed coor
}
],
```
+
:::
#### Additional details
@@ -601,7 +613,7 @@ where a coordinate is the location/value of that point along its corresponding a
The indexes of axis dimensions correspond to indexes into transformation parameter arrays.
When rendering transformed images and interpolating,
-implementations may need the "inverse" transformation -
+implementations may need the "inverse" transformation -
from the output to the input coordinate system.
Inverse transformations will not be explicitly specified
when they can be computed in closed form from the forward transformation.
@@ -629,6 +641,7 @@ implementations MAY estimate an inverse,
or MAY output a warning that the requested operation is unsupported.
#### Matrix transformations
+
(matrix-trafo-md)=
Two transformation types ([affine](#affine-md) and [rotation](#rotation-md)) are parametrized by matrices.
@@ -674,15 +687,17 @@ because it is computed with the matrix-vector multiplication:
:::
#### Transformation types
+
(trafo-types-md)=
-Input and output dimensionality may be determined by the coordinate system referred to by the `input` and `output` fields, respectively.
+Input and output dimensionality may be determined by the coordinate system referred to by the `input` and `output` fields, respectively.
If the value of `input` is a path to an array, its shape gives the input dimension,
otherwise it is given by the length of `axes` for the coordinate system with the name of the `input`.
If the value of `output` is an array, its shape gives the output dimension,
otherwise it is given by the length of `axes` for the coordinate system with the name of the `output`.
##### identity
+
(identity-md)=
`identity` transformations map input coordinates to output coordinates without modification.
@@ -710,6 +725,7 @@ y = j
:::
##### mapAxis
+
(mapAxis-md)=
`mapAxis` transformations describe axis permutations as a transpose vector of integers.
@@ -725,7 +741,6 @@ The value at position `i` in the array indicates which input axis becomes the `i
The `input` and `output` fields MAY be omitted if wrapped in another transformation that provides `input`/`output`
(e.g., [`sequence`](#sequence-md), [`inverseOf`](#inverseof-md), ['byDimension](#bydimension-md) or [`bijection`](#bijection-md)).
-
:::{dropdown} Example 1
:animate: fade-in
@@ -769,9 +784,11 @@ x = a
y = b
z = b
```
+
:::
##### translation
+
(translation-md)=
`translation` transformations are special cases of affine transformations.
@@ -801,12 +818,14 @@ The array MUST have length `N`.
defines the function:
```
-x = i + 9
+x = i + 9
y = j - 1.42
```
+
:::
##### scale
+
(scale-md)=
`scale` transformations are special cases of affine transformations.
@@ -840,6 +859,7 @@ defines the function:
x = 3.12 * i
y = 2 * j
```
+
i.e., the mapping from the first input axis to the first output axis is determined by the first scale parameter.
:::
@@ -853,9 +873,11 @@ these axes are typically not transformed, but must be represented in the scale p
```{literalinclude} examples/transformations/scale_with_discrete.json
:language: json
```
+
:::
##### affine
+
(affine-md)=
`affine`s are [matrix transformations](#matrix-trafo-md) from N-dimensional inputs to M-dimensional outputs.
@@ -949,6 +971,7 @@ these axes are typically not transformed, but must be represented in the transfo
```
##### rotation
+
(rotation-md)=
`rotation`s are [matrix transformations](#matrix-trafo-md) that are special cases of affine transformations.
@@ -985,9 +1008,11 @@ defines the function:
x = 0*i - 1*j
y = 1*i + 0*j
```
+
:::
##### inverseOf
+
(inverseOf-md)=
An `inverseOf` transformation contains another transformation (often non-linear),
@@ -1016,9 +1041,11 @@ a choice that many users and developers find intuitive.
```{literalinclude} examples/transformations/inverseOf.json
:language: json
```
+
:::
##### sequence
+
(sequence-md)=
A `sequence` transformation consists of an ordered array of coordinate transformations,
@@ -1070,6 +1097,7 @@ and is invertible.
:::
##### coordinates and displacements
+
(coordinates-displacements-md)=
`coordinates` and `displacements` transformations store coordinates or displacements in an array
@@ -1088,14 +1116,14 @@ constrain the array size and the coordinate system metadata for the array (field
The `input` and `output` fields MAY be omitted if wrapped in another transformation that provides `input`/`output`
(e.g., [`sequence`](#sequence-md), [`inverseOf`](#inverseof-md), [`byDimension`](#bydimension-md) or [`bijection`](#bijection-md)).
-* If the input coordinate system has `N` axes,
+- If the input coordinate system has `N` axes,
the array at location path MUST have `N+1` dimensions
-* The field coordinate system MUST contain an axis identical to every axis
+- The field coordinate system MUST contain an axis identical to every axis
of its input coordinate system in the same order.
-* The field coordinate system MUST contain an axis with type `coordinate` or `displacement`, respectively,
+- The field coordinate system MUST contain an axis with type `coordinate` or `displacement`, respectively,
for transformations of type `coordinates` or `displacements`.
- * This SHOULD be the last axis (contiguous on disk when c-order).
-* If the output coordinate system has `M` axes,
+ - This SHOULD be the last axis (contiguous on disk when c-order).
+- If the output coordinate system has `M` axes,
the length of the array along the `coordinate`/`displacement` dimension MUST be of length `M`.
The `i`th value of the array along the `coordinate` or `displacement` axis refers to the coordinate or displacement
@@ -1103,7 +1131,7 @@ of the `i`th output axis. See the example below.
`coordinates` and `displacements` transformations are not invertible in general,
but implementations MAY approximate their inverses.
-Metadata for these coordinate transforms have the following fields:
+Metadata for these coordinate transforms have the following fields: