Skip to content

Commit f5d8f51

Browse files
committed
Add rechunking task to manifest
1 parent 144873c commit f5d8f51

File tree

3 files changed

+84
-1
lines changed

3 files changed

+84
-1
lines changed

src/fractal_helper_tasks/__FRACTAL_MANIFEST__.json

+68-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"default": false,
3434
"title": "Overwrite Input",
3535
"type": "boolean",
36-
"description": "Whether"
36+
"description": "Whether the existing iamge should be overwritten with the new OME-Zarr without the T dimension."
3737
}
3838
},
3939
"required": [
@@ -128,6 +128,73 @@
128128
"title": "Convert2dSegmentationTo3d"
129129
},
130130
"docs_link": "https://github.com/jluethi/fractal-helper-tasks"
131+
},
132+
{
133+
"name": "Rechunk OME-Zarr",
134+
"tags": [
135+
"Rechunking",
136+
"Many files"
137+
],
138+
"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",
139+
"executable_parallel": "rechunk_zarr.py",
140+
"meta_parallel": {
141+
"cpus_per_task": 1,
142+
"mem": 4000
143+
},
144+
"args_schema_parallel": {
145+
"additionalProperties": false,
146+
"properties": {
147+
"zarr_url": {
148+
"title": "Zarr Url",
149+
"type": "string",
150+
"description": "Path or url to the individual OME-Zarr image to be processed. (standard argument for Fractal tasks, managed by Fractal server)."
151+
},
152+
"chunk_sizes": {
153+
"additionalProperties": {
154+
"type": "integer"
155+
},
156+
"title": "Chunk Sizes",
157+
"type": "object",
158+
"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."
159+
},
160+
"suffix": {
161+
"default": "rechunked",
162+
"title": "Suffix",
163+
"type": "string",
164+
"description": "Suffix of the rechunked image."
165+
},
166+
"rechunk_labels": {
167+
"default": true,
168+
"title": "Rechunk Labels",
169+
"type": "boolean",
170+
"description": "Whether to apply the same rechunking to all label images of the OME-Zarr as well."
171+
},
172+
"rebuild_pyramids": {
173+
"default": true,
174+
"title": "Rebuild Pyramids",
175+
"type": "boolean",
176+
"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."
177+
},
178+
"overwrite_input": {
179+
"default": true,
180+
"title": "Overwrite Input",
181+
"type": "boolean",
182+
"description": "Whether the old image without rechunking should be overwritten (to avoid duplicating the data needed)."
183+
},
184+
"overwrite": {
185+
"default": false,
186+
"title": "Overwrite",
187+
"type": "boolean",
188+
"description": "Whether to overwrite potential pre-existing output with the name zarr_url_suffix."
189+
}
190+
},
191+
"required": [
192+
"zarr_url"
193+
],
194+
"type": "object",
195+
"title": "RechunkZarr"
196+
},
197+
"docs_link": "https://github.com/jluethi/fractal-helper-tasks"
131198
}
132199
],
133200
"has_args_schemas": true,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
### Purpose
2+
- Rechunks OME-Zarr to new chunking parameters: Changes whether the array is stored as many small files or few larger files.
3+
- Optionally applies the same rechunking to label images.
4+
5+
### Outputs
6+
- A **new Zarr image** that is rechunked.

src/fractal_helper_tasks/dev/task_list.py

+10
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,14 @@
2222
],
2323
docs_info="file:docs_info/2d_to_3d.md",
2424
),
25+
ParallelTask(
26+
name="Rechunk OME-Zarr",
27+
executable="rechunk_zarr.py",
28+
meta={"cpus_per_task": 1, "mem": 4000},
29+
tags=[
30+
"Rechunking",
31+
"Many files",
32+
],
33+
docs_info="file:docs_info/rechunk_zarr.md",
34+
),
2535
]

0 commit comments

Comments
 (0)