Skip to content

Conversation

@yuriyzubov
Copy link
Member

add single-scale ome-ngff (0.4) metadata when creating a zarr array.

Copilot AI review requested due to automatic review settings September 15, 2025 22:58
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds single-scale OME-NGFF (0.4) metadata support when creating zarr arrays. The changes enable proper OME-NGFF metadata generation and improve the blockwise processing workflow.

  • Adds a new function to generate OME-NGFF v0.4 compliant metadata for single-scale datasets
  • Updates the blockwise processor to use NestedDirectoryStore and apply metadata to zarr groups
  • Improves progress tracking and error handling in the processing pipeline

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
cellmap_flow/utils/ds.py Adds generate_singlescale_metadata function for OME-NGFF v0.4 metadata creation
cellmap_flow/cli/fly_model.py Adds input_size and output_size configuration parameters
cellmap_flow/blockwise/blockwise_processor.py Updates zarr storage to NestedDirectoryStore, adds metadata generation, and improves progress tracking

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

}
]

z_attrs["multiscales"][0]["name"] = ""
Copy link

Copilot AI Sep 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name field is set to an empty string. Consider making this configurable through a parameter or providing a meaningful default name.

Suggested change
z_attrs["multiscales"][0]["name"] = ""
z_attrs["multiscales"][0]["name"] = ds_name

Copilot uses AI. Check for mistakes.
Comment on lines 158 to 159
translation=[0.0,]*3,
units=['nanometer',]*3,
Copy link

Copilot AI Sep 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hardcoded values for translation and units should be made configurable or derived from existing configuration parameters to maintain consistency.

Copilot uses AI. Check for mistakes.
Comment on lines +262 to +263
def check_block(tmp_dir, block: daisy.Block) -> bool:
return (tmp_dir / f"{block.block_id[1]}").exists()
Copy link

Copilot AI Sep 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The magic index [1] for block.block_id is unclear. Consider adding a comment explaining what this index represents or using a named constant.

Copilot uses AI. Check for mistakes.
@mzouink
Copy link
Member

mzouink commented Sep 16, 2025

Hi @yuriyzubov
I got an error in neuroglancer
Screenshot 2025-09-16 at 10 41 34 AM
metadata:

{
    "multiscales": [
        {
            "axes": [
                {
                    "name": "z",
                    "type": "space",
                    "unit": [
                        "nanometer",
                        "nanometer",
                        "nanometer"
                    ]
                },
                {
                    "name": "y",
                    "type": "space",
                    "unit": [
                        "nanometer",
                        "nanometer",
                        "nanometer"
                    ]
                },
                {
                    "name": "x",
                    "type": "space",
                    "unit": [
                        "nanometer",
                        "nanometer",
                        "nanometer"
                    ]
                }
            ],
            "coordinateTransformations": [
                {
                    "scale": [
                        1.0,
                        1.0,
                        1.0
                    ],
                    "type": "scale"
                }
            ],
            "datasets": [
                {
                    "coordinateTransformations": [
                        {
                            "scale": [
                                16,
                                16,
                                16
                            ],
                            "type": "scale"
                        },
                        {
                            "translation": [
                                0.0,
                                0.0,
                                0.0
                            ],
                            "type": "translation"
                        }
                    ],
                    "path": "s0"
                }
            ],
            "name": "",
            "version": "0.4"
        }
    ]

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.

3 participants