Skip to content

WIP: ENH: MultiscaleSpatialImage is an xarray DataTree#10

Merged
thewtex merged 1 commit into
spatial-image:mainfrom
thewtex:data-tree
Apr 21, 2022
Merged

WIP: ENH: MultiscaleSpatialImage is an xarray DataTree#10
thewtex merged 1 commit into
spatial-image:mainfrom
thewtex:data-tree

Conversation

@thewtex

@thewtex thewtex commented Apr 21, 2022

Copy link
Copy Markdown
Contributor

No description provided.

@thewtex thewtex mentioned this pull request Apr 21, 2022
@thewtex

thewtex commented Apr 21, 2022

Copy link
Copy Markdown
Contributor Author

Example consolidated metadata:

{
    "metadata": {
        ".zattrs": {
            "multiscales": [
                {
                    "axes": [
                        {
                            "name": "y",
                            "type": "space"
                        },
                        {
                            "name": "x",
                            "type": "space"
                        }
                    ],
                    "datasets": [
                        {
                            "coordinateTransformations": [
                                {
                                    "scale": [
                                        1.0,
                                        1.0
                                    ],
                                    "type": "scale"
                                },
                                {
                                    "translation": [
                                        0.0,
                                        0.0
                                    ],
                                    "type": "translation"
                                }
                            ],
                            "path": "0/cthead1"
                        },
                        {
                            "coordinateTransformations": [
                                {
                                    "scale": [
                                        4.0,
                                        4.0
                                    ],
                                    "type": "scale"
                                },
                                {
                                    "translation": [
                                        1.5,
                                        1.5
                                    ],
                                    "type": "translation"
                                }
                            ],
                            "path": "1/cthead1"
                        },
                        {
                            "coordinateTransformations": [
                                {
                                    "scale": [
                                        8.0,
                                        8.0
                                    ],
                                    "type": "scale"
                                },
                                {
                                    "translation": [
                                        3.5,
                                        3.5
                                    ],
                                    "type": "translation"
                                }
                            ],
                            "path": "2/cthead1"
                        }
                    ],
                    "name": "cthead1",
                    "version": "0.4"
                }
            ]
        },
        ".zgroup": {
            "zarr_format": 2
        },
        "0/.zattrs": {},
        "0/.zgroup": {
            "zarr_format": 2
        },
        "0/cthead1/.zarray": {
            "chunks": [
                64,
                64
            ],
            "compressor": {
                "blocksize": 0,
                "clevel": 5,
                "cname": "zstd",
                "id": "blosc",
                "shuffle": 1
            },
            "dtype": "|u1",
            "fill_value": null,
            "filters": null,
            "order": "C",
            "shape": [
                256,
                256
            ],
            "zarr_format": 2
        },
        "0/cthead1/.zattrs": {
            "_ARRAY_DIMENSIONS": [
                "y",
                "x"
            ],
            "direction": [
                [
                    1.0,
                    0.0
                ],
                [
                    0.0,
                    1.0
                ]
            ]
        },
        "0/x/.zarray": {
            "chunks": [
                256
            ],
            "compressor": {
                "blocksize": 0,
                "clevel": 5,
                "cname": "lz4",
                "id": "blosc",
                "shuffle": 1
            },
            "dtype": "<f8",
            "fill_value": "NaN",
            "filters": null,
            "order": "C",
            "shape": [
                256
            ],
            "zarr_format": 2
        },
        "0/x/.zattrs": {
            "_ARRAY_DIMENSIONS": [
                "x"
            ]
        },
        "0/y/.zarray": {
            "chunks": [
                256
            ],
            "compressor": {
                "blocksize": 0,
                "clevel": 5,
                "cname": "lz4",
                "id": "blosc",
                "shuffle": 1
            },
            "dtype": "<f8",
            "fill_value": "NaN",
            "filters": null,
            "order": "C",
            "shape": [
                256
            ],
            "zarr_format": 2
        },
        "0/y/.zattrs": {
            "_ARRAY_DIMENSIONS": [
                "y"
            ]
        },
        "1/.zattrs": {},
        "1/.zgroup": {
            "zarr_format": 2
        },
        "1/cthead1/.zarray": {
            "chunks": [
                16,
                16
            ],
            "compressor": {
                "blocksize": 0,
                "clevel": 5,
                "cname": "lz4",
                "id": "blosc",
                "shuffle": 1
            },
            "dtype": "<f8",
            "fill_value": "NaN",
            "filters": null,
            "order": "C",
            "shape": [
                64,
                64
            ],
            "zarr_format": 2
        },
        "1/cthead1/.zattrs": {
            "_ARRAY_DIMENSIONS": [
                "y",
                "x"
            ],
            "direction": [
                [
                    1.0,
                    0.0
                ],
                [
                    0.0,
                    1.0
                ]
            ]
        },
        "1/x/.zarray": {
            "chunks": [
                256
            ],
            "compressor": {
                "blocksize": 0,
                "clevel": 5,
                "cname": "lz4",
                "id": "blosc",
                "shuffle": 1
            },
            "dtype": "<f8",
            "fill_value": "NaN",
            "filters": null,
            "order": "C",
            "shape": [
                64
            ],
            "zarr_format": 2
        },
        "1/x/.zattrs": {
            "_ARRAY_DIMENSIONS": [
                "x"
            ]
        },
        "1/y/.zarray": {
            "chunks": [
                256
            ],
            "compressor": {
                "blocksize": 0,
                "clevel": 5,
                "cname": "lz4",
                "id": "blosc",
                "shuffle": 1
            },
            "dtype": "<f8",
            "fill_value": "NaN",
            "filters": null,
            "order": "C",
            "shape": [
                64
            ],
            "zarr_format": 2
        },
        "1/y/.zattrs": {
            "_ARRAY_DIMENSIONS": [
                "y"
            ]
        },
        "2/.zattrs": {},
        "2/.zgroup": {
            "zarr_format": 2
        },
        "2/cthead1/.zarray": {
            "chunks": [
                8,
                8
            ],
            "compressor": {
                "blocksize": 0,
                "clevel": 5,
                "cname": "lz4",
                "id": "blosc",
                "shuffle": 1
            },
            "dtype": "<f8",
            "fill_value": "NaN",
            "filters": null,
            "order": "C",
            "shape": [
                32,
                32
            ],
            "zarr_format": 2
        },
        "2/cthead1/.zattrs": {
            "_ARRAY_DIMENSIONS": [
                "y",
                "x"
            ],
            "direction": [
                [
                    1.0,
                    0.0
                ],
                [
                    0.0,
                    1.0
                ]
            ]
        },
        "2/x/.zarray": {
            "chunks": [
                256
            ],
            "compressor": {
                "blocksize": 0,
                "clevel": 5,
                "cname": "lz4",
                "id": "blosc",
                "shuffle": 1
            },
            "dtype": "<f8",
            "fill_value": "NaN",
            "filters": null,
            "order": "C",
            "shape": [
                32
            ],
            "zarr_format": 2
        },
        "2/x/.zattrs": {
            "_ARRAY_DIMENSIONS": [
                "x"
            ]
        },
        "2/y/.zarray": {
            "chunks": [
                256
            ],
            "compressor": {
                "blocksize": 0,
                "clevel": 5,
                "cname": "lz4",
                "id": "blosc",
                "shuffle": 1
            },
            "dtype": "<f8",
            "fill_value": "NaN",
            "filters": null,
            "order": "C",
            "shape": [
                32
            ],
            "zarr_format": 2
        },
        "2/y/.zattrs": {
            "_ARRAY_DIMENSIONS": [
                "y"
            ]
        }
    },
    "zarr_consolidated_format": 1
}

@joshmoore

Copy link
Copy Markdown

Pitched in ome/ngff#114

@thewtex

thewtex commented Apr 21, 2022

Copy link
Copy Markdown
Contributor Author

There is still more work to do, but merging to use in the DANDI hackathon.

@thewtex thewtex marked this pull request as ready for review April 21, 2022 17:57
@thewtex thewtex merged commit a4e4eaf into spatial-image:main Apr 21, 2022
@thewtex thewtex deleted the data-tree branch May 5, 2022 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants