From e1a51683a84bced1e6be241aa1479d3eff5c71be Mon Sep 17 00:00:00 2001 From: Constantin Pape Date: Sat, 13 Mar 2021 15:04:56 +0100 Subject: [PATCH 1/4] Lift 5d requirement for images --- latest/index.bs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/latest/index.bs b/latest/index.bs index 7c2a5c7d..8ab63e75 100644 --- a/latest/index.bs +++ b/latest/index.bs @@ -124,8 +124,8 @@ multiple levels of resolutions and optionally associated labels. ├── n # The name of the array is arbitrary with the ordering defined by │ │ # by the "multiscales" metadata, but is often a sequence starting at 0. │ │ - │ ├── .zarray # All image arrays are 5-dimensional - │ │ # with dimension order (t, c, z, y, x). + │ ├── .zarray # All image arrays are up to 5-dimensional with dimension order (t, c, z, y, x). + │ │ # An image without time dimension has axes (c, z, y, x) etc. │ │ │ ├── 0.0.0.0.0 # Chunks are stored with the flat directory layout. │ │ ... # Each dotted component of the chunk file represents From 9fae8451eba2e3dbec45fe22c4a74bc66750831e Mon Sep 17 00:00:00 2001 From: Constantin Pape Date: Sat, 13 Mar 2021 15:39:21 +0100 Subject: [PATCH 2/4] Move multiscales definition into spec --- latest/index.bs | 48 ++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 46 insertions(+), 2 deletions(-) diff --git a/latest/index.bs b/latest/index.bs index 8ab63e75..2d3eca5c 100644 --- a/latest/index.bs +++ b/latest/index.bs @@ -207,8 +207,52 @@ keys as specified below for discovering certain types of data, especially images Metadata about the multiple resolution representations of the image can be found under the "multiscales" key in the group-level metadata. -The specification for the multiscale (i.e. "resolution") metadata is provided -in [zarr-specs#50](https://github.com/zarr-developers/zarr-specs/issues/50). +"multiscales" contains a list of dictionaries where each entry describes a multiscale image. + +"multiscales" MUST contain the field "datasets", which is a list of dictionaries describing +the arrays storing the individual resolution levels. Each dictionary in "datasets" MUST +contain the field "path", whose value contains the path to the array for this resolution relative +to the root zarr group. The "path"s MUST be ordered from largest (i.e. highest resolution) to smallest. + +It SHOULD contain the field "name". + +It SHOULD contain the field "version", which indicates the version of the +multiscale metadata of this image (current version is 0.1). + +It SHOULD contain the field "axes", which is a list of dimension names of the axes. +If given, the values MUST be unique and one of `{"t", "c", "z", "y", "x"}`. +The number of values MUST be the same as the number of dimensions of the arrays corresponding to this image. + +It SHOULD contain the field "type", which gives the type of downscaling method used to generate the multiscale image pyramid. +It SHOULD contain the field "metadata", which contains a dictionary with additional information about the downscaling method. + +```json +{ + "multiscales": [ + { + "version": "0.1", + "name": "example", + "datasets": [ + {"path": "0"}, + {"path": "1"}, + {"path": "2"} + ], + "axes": [ + "t", "c", "z", "y", "z" + ], + "type": "gaussian", + "metadata": { # the fields in metadata depend on the downscaling implementation + "method": "skimage.transform.pyramid_gaussian", # here, the paramters passed to the skimage function are given + "version": "0.16.1", + "args": "[true]", + "kwargs": {"multichannel": true} + } + } + ] +} +``` + + If only one multiscale is provided, use it. Otherwise, the user can choose by name, using the first multiscale as a fallback: From 4223549b84357003a6ddd85c25702d93bab04522 Mon Sep 17 00:00:00 2001 From: Constantin Pape Date: Tue, 16 Mar 2021 23:37:01 +0100 Subject: [PATCH 3/4] Address reviews: make axes MUST; bump version to 0.2 --- latest/index.bs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/latest/index.bs b/latest/index.bs index 2d3eca5c..58b61880 100644 --- a/latest/index.bs +++ b/latest/index.bs @@ -212,16 +212,16 @@ found under the "multiscales" key in the group-level metadata. "multiscales" MUST contain the field "datasets", which is a list of dictionaries describing the arrays storing the individual resolution levels. Each dictionary in "datasets" MUST contain the field "path", whose value contains the path to the array for this resolution relative -to the root zarr group. The "path"s MUST be ordered from largest (i.e. highest resolution) to smallest. +to the current zarr group. The "path"s MUST be ordered from largest (i.e. highest resolution) to smallest. + +It MUST contain the field "axes", which is a list of dimension names of the axes. +The values MUST be unique and one of `{"t", "c", "z", "y", "x"}`. +The number of values MUST be the same as the number of dimensions of the arrays corresponding to this image. It SHOULD contain the field "name". It SHOULD contain the field "version", which indicates the version of the -multiscale metadata of this image (current version is 0.1). - -It SHOULD contain the field "axes", which is a list of dimension names of the axes. -If given, the values MUST be unique and one of `{"t", "c", "z", "y", "x"}`. -The number of values MUST be the same as the number of dimensions of the arrays corresponding to this image. +multiscale metadata of this image (current version is 0.2). It SHOULD contain the field "type", which gives the type of downscaling method used to generate the multiscale image pyramid. It SHOULD contain the field "metadata", which contains a dictionary with additional information about the downscaling method. @@ -230,7 +230,7 @@ It SHOULD contain the field "metadata", which contains a dictionary with additio { "multiscales": [ { - "version": "0.1", + "version": "0.2", "name": "example", "datasets": [ {"path": "0"}, From 7b664a97803af24235a1830776ba48a5aee25082 Mon Sep 17 00:00:00 2001 From: Constantin Pape Date: Wed, 17 Mar 2021 08:59:43 +0100 Subject: [PATCH 4/4] Address review comments --- latest/index.bs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/latest/index.bs b/latest/index.bs index 58b61880..4ed18b0a 100644 --- a/latest/index.bs +++ b/latest/index.bs @@ -209,9 +209,9 @@ Metadata about the multiple resolution representations of the image can be found under the "multiscales" key in the group-level metadata. "multiscales" contains a list of dictionaries where each entry describes a multiscale image. -"multiscales" MUST contain the field "datasets", which is a list of dictionaries describing -the arrays storing the individual resolution levels. Each dictionary in "datasets" MUST -contain the field "path", whose value contains the path to the array for this resolution relative +Each "multiscales" dictionary MUST contain the field "datasets", which is a list of dictionaries describing +the arrays storing the individual resolution levels. +Each dictionary in "datasets" MUST contain the field "path", whose value contains the path to the array for this resolution relative to the current zarr group. The "path"s MUST be ordered from largest (i.e. highest resolution) to smallest. It MUST contain the field "axes", which is a list of dimension names of the axes. @@ -238,7 +238,7 @@ It SHOULD contain the field "metadata", which contains a dictionary with additio {"path": "2"} ], "axes": [ - "t", "c", "z", "y", "z" + "t", "c", "z", "y", "x" ], "type": "gaussian", "metadata": { # the fields in metadata depend on the downscaling implementation