Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: ENH: MultiscaleSpatialImage is an xarray DataTree #10

Merged
merged 1 commit into from
Apr 21, 2022

Conversation

thewtex
Copy link
Contributor

@thewtex thewtex commented Apr 21, 2022

No description provided.

@thewtex thewtex mentioned this pull request Apr 21, 2022
@thewtex
Copy link
Contributor Author

thewtex commented Apr 21, 2022

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

Pitched in ome/ngff#114

@thewtex
Copy link
Contributor Author

thewtex commented Apr 21, 2022

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