Conversation
There was a problem hiding this comment.
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.
cellmap_flow/utils/ds.py
Outdated
| } | ||
| ] | ||
|
|
||
| z_attrs["multiscales"][0]["name"] = "" |
There was a problem hiding this comment.
The name field is set to an empty string. Consider making this configurable through a parameter or providing a meaningful default name.
| z_attrs["multiscales"][0]["name"] = "" | |
| z_attrs["multiscales"][0]["name"] = ds_name |
| translation=[0.0,]*3, | ||
| units=['nanometer',]*3, |
There was a problem hiding this comment.
The hardcoded values for translation and units should be made configurable or derived from existing configuration parameters to maintain consistency.
| def check_block(tmp_dir, block: daisy.Block) -> bool: | ||
| return (tmp_dir / f"{block.block_id[1]}").exists() |
There was a problem hiding this comment.
The magic index [1] for block.block_id is unclear. Consider adding a comment explaining what this index represents or using a named constant.
|
Hi @yuriyzubov {
"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"
}
] |
don't convert zg.attrs to list Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

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