Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Do not edit - changes here will be overwritten by Copier
_commit: v0.4.4
_commit: v0.4.5
_src_path: gh:fractal-analytics-platform/fractal-tasks-template
author_email: [email protected]
author_name: Joel Luethi
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ authors = [
# Required Python version and dependencies
requires-python = ">=3.9"
dependencies = [
"fractal-tasks-core==1.3.3"
"fractal-tasks-core==1.3.4"
]

# Optional dependencies (e.g. for `pip install -e ".[dev]"`, see
Expand Down
4 changes: 2 additions & 2 deletions src/fractal_helper_tasks/__FRACTAL_MANIFEST__.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"tags": [
"Singleton time dimension"
],
"docs_info": "### Purpose\n- Removes a **singleton time (T) dimension** from an OME-Zarr image. \n- Creates a new OME-Zarr image with updated metadata and dimensions.\n- Optionally overwrites the input image if `overwrite_input` is set to True.\n\n### Outputs\n- A **new Zarr image** without the singleton T-dimension, stored with a configurable suffix. \n\n### Limitations\n- Only processes OME-Zarr images where the **T-axis is the first axis**. \n- Assumes the T-dimension is **singleton**; does not process non-singleton time axes. \n- Does not copy associated **label images** or **ROI tables** to the new Zarr structure. ",
"executable_non_parallel": "drop_t_dimension.py",
"meta_non_parallel": {
"cpus_per_task": 2,
Expand Down Expand Up @@ -41,7 +42,6 @@
"type": "object",
"title": "DropTDimension"
},
"docs_info": "## drop_t_dimension\nDrops singleton t dimension.\n",
"docs_link": "https://github.com/jluethi/fractal-helper-tasks"
},
{
Expand All @@ -53,6 +53,7 @@
"Mixed modality",
"2D to 3D workflows"
],
"docs_info": "### Purpose\n- Converts a **2D segmentation** image into a **3D segmentation** by replicating the 2D segmentation across Z-slices. \n- Supports OME-Zarr datasets where **2D and 3D images** share the same base name but differ by suffixes. \n- Optionally copies associated ROI tables and adjusts them to align with the replicated Z-dimensions. \n\n### Outputs\n- A **3D segmentation label image** saved with a new name. \n- Updated **ROI tables** adjusted for Z-dimensions (optional). \n\n### Limitations\n- Only supports **same-base 2D and 3D Zarr names**; full flexibility in file names is not yet implemented. \n- Assumes **2D OME-Zarr images** and corresponding 3D images are stored in the same base folder and just differ with a suffix before the .zarr. \n",
"executable_parallel": "convert_2D_segmentation_to_3D.py",
"meta_parallel": {
"cpus_per_task": 2,
Expand Down Expand Up @@ -126,7 +127,6 @@
"type": "object",
"title": "Convert2dSegmentationTo3d"
},
"docs_info": "## convert_2D_segmentation_to_3D\nConvert 2D segmentation to 3D segmentation.\n\nThis task loads the 2D segmentation, replicates it along the Z slice and\nstores it back into the 3D OME-Zarr image.\n\nThis is a temporary workaround task, as long as we store 2D data in\na separate OME-Zarr file from the 3D data. If the 2D & 3D OME-Zarr images\nhave different suffixes in their name, use `image_suffix_2D_to_remove` &\n`image_suffix_3D_to_add`. If their base names are different, this task\ndoes not support processing them at the moment.\n\nIt makes the assumption that the 3D OME-Zarrs are stored in the same place\nas the 2D OME-Zarrs (same based folder).\n",
"docs_link": "https://github.com/jluethi/fractal-helper-tasks"
}
],
Expand Down
9 changes: 7 additions & 2 deletions src/fractal_helper_tasks/convert_2D_segmentation_to_3D.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,15 @@ def convert_2D_segmentation_to_3D(
table_attrs=table_attrs,
)

# FIXME: Set a filter for is_3D = True

logger.info("Finished 2D to 3D conversion")

output_dict = dict(
filters=dict(
types=dict(is_3D=True),
)
)
return output_dict


if __name__ == "__main__":
from fractal_tasks_core.tasks._utils import run_fractal_task
Expand Down
12 changes: 12 additions & 0 deletions src/fractal_helper_tasks/dev/docs_info/2d_to_3d.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
### Purpose
- Converts a **2D segmentation** image into a **3D segmentation** by replicating the 2D segmentation across Z-slices.
- Supports OME-Zarr datasets where **2D and 3D images** share the same base name but differ by suffixes.
- Optionally copies associated ROI tables and adjusts them to align with the replicated Z-dimensions.

### Outputs
- A **3D segmentation label image** saved with a new name.
- Updated **ROI tables** adjusted for Z-dimensions (optional).

### Limitations
- Only supports **same-base 2D and 3D Zarr names**; full flexibility in file names is not yet implemented.
- Assumes **2D OME-Zarr images** and corresponding 3D images are stored in the same base folder and just differ with a suffix before the .zarr.
12 changes: 12 additions & 0 deletions src/fractal_helper_tasks/dev/docs_info/drop_t_dimension.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
### Purpose
- Removes a **singleton time (T) dimension** from an OME-Zarr image.
- Creates a new OME-Zarr image with updated metadata and dimensions.
- Optionally overwrites the input image if `overwrite_input` is set to True.

### Outputs
- A **new Zarr image** without the singleton T-dimension, stored with a configurable suffix.

### Limitations
- Only processes OME-Zarr images where the **T-axis is the first axis**.
- Assumes the T-dimension is **singleton**; does not process non-singleton time axes.
- Does not copy associated **label images** or **ROI tables** to the new Zarr structure.
2 changes: 2 additions & 0 deletions src/fractal_helper_tasks/dev/task_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
meta={"cpus_per_task": 2, "mem": 8000},
output_types=dict(has_t=False),
tags=["Singleton time dimension"],
docs_info="file:docs_info/drop_t_dimension.md",
),
ParallelTask(
input_types=dict(is_3D=False),
Expand All @@ -19,5 +20,6 @@
"Mixed modality",
"2D to 3D workflows",
],
docs_info="file:docs_info/2d_to_3d.md",
),
]