Skip to content

Commit

Permalink
Add rechunking task to manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
jluethi committed Jan 7, 2025
1 parent 144873c commit f5d8f51
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 1 deletion.
69 changes: 68 additions & 1 deletion src/fractal_helper_tasks/__FRACTAL_MANIFEST__.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"default": false,
"title": "Overwrite Input",
"type": "boolean",
"description": "Whether"
"description": "Whether the existing iamge should be overwritten with the new OME-Zarr without the T dimension."
}
},
"required": [
Expand Down Expand Up @@ -128,6 +128,73 @@
"title": "Convert2dSegmentationTo3d"
},
"docs_link": "https://github.com/jluethi/fractal-helper-tasks"
},
{
"name": "Rechunk OME-Zarr",
"tags": [
"Rechunking",
"Many files"
],
"docs_info": "### Purpose\n- Rechunks OME-Zarr to new chunking parameters: Changes whether the array is stored as many small files or few larger files.\n- Optionally applies the same rechunking to label images.\n\n### Outputs\n- A **new Zarr image** that is rechunked.\n",
"executable_parallel": "rechunk_zarr.py",
"meta_parallel": {
"cpus_per_task": 1,
"mem": 4000
},
"args_schema_parallel": {
"additionalProperties": false,
"properties": {
"zarr_url": {
"title": "Zarr Url",
"type": "string",
"description": "Path or url to the individual OME-Zarr image to be processed. (standard argument for Fractal tasks, managed by Fractal server)."
},
"chunk_sizes": {
"additionalProperties": {
"type": "integer"
},
"title": "Chunk Sizes",
"type": "object",
"description": "Dictionary of chunk sizes to adapt. One can set any of the t, c, z, y, x axes that exist in the input image to be resized to a different chunk size. For example, {\"y\": 4000, \"x\": 4000} will set a new x & y chunking while maintaining the other chunk sizes. {\"z\": 10} will just change the Z chunking while keeping all other chunk sizes the same as the input."
},
"suffix": {
"default": "rechunked",
"title": "Suffix",
"type": "string",
"description": "Suffix of the rechunked image."
},
"rechunk_labels": {
"default": true,
"title": "Rechunk Labels",
"type": "boolean",
"description": "Whether to apply the same rechunking to all label images of the OME-Zarr as well."
},
"rebuild_pyramids": {
"default": true,
"title": "Rebuild Pyramids",
"type": "boolean",
"description": "Whether pyramids are built fresh in the rechunked image. This has a small performance overhead, but ensures that this task is save against off-by-one issues when pyramid levels aren't easily downsampled by 2."
},
"overwrite_input": {
"default": true,
"title": "Overwrite Input",
"type": "boolean",
"description": "Whether the old image without rechunking should be overwritten (to avoid duplicating the data needed)."
},
"overwrite": {
"default": false,
"title": "Overwrite",
"type": "boolean",
"description": "Whether to overwrite potential pre-existing output with the name zarr_url_suffix."
}
},
"required": [
"zarr_url"
],
"type": "object",
"title": "RechunkZarr"
},
"docs_link": "https://github.com/jluethi/fractal-helper-tasks"
}
],
"has_args_schemas": true,
Expand Down
6 changes: 6 additions & 0 deletions src/fractal_helper_tasks/dev/docs_info/rechunk_zarr.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
### Purpose
- Rechunks OME-Zarr to new chunking parameters: Changes whether the array is stored as many small files or few larger files.
- Optionally applies the same rechunking to label images.

### Outputs
- A **new Zarr image** that is rechunked.
10 changes: 10 additions & 0 deletions src/fractal_helper_tasks/dev/task_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,14 @@
],
docs_info="file:docs_info/2d_to_3d.md",
),
ParallelTask(
name="Rechunk OME-Zarr",
executable="rechunk_zarr.py",
meta={"cpus_per_task": 1, "mem": 4000},
tags=[
"Rechunking",
"Many files",
],
docs_info="file:docs_info/rechunk_zarr.md",
),
]

0 comments on commit f5d8f51

Please sign in to comment.