Skip to content

Commit 033253b

Browse files
Merge pull request #4 from rhornb/bug_fix
Fixes to pixel classification task
2 parents d6b1ff9 + 7661e17 commit 033253b

10 files changed

+318
-122
lines changed

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,4 +109,8 @@ ENV/
109109

110110
# IDE settings
111111
.vscode/
112-
.idea/
112+
.idea/
113+
114+
*.zarr
115+
# Test data loaded via pooch
116+
/tests/data/10_5281_zenodo_14883998

create_env_script.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ $COMMMAND run $COMMMAND create $LOCATION \
1919
--override-channels \
2020
-c pytorch \
2121
-c ilastik-forge \
22-
-c conda-forge $PYTHON ilastik \
22+
-c conda-forge $PYTHON ilastik vigra \
2323
--no-channel-priority --yes
2424

2525
echo "Installing ilastik-tasks version $VERSION"

src/ilastik_tasks/__FRACTAL_MANIFEST__.json

Lines changed: 37 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -37,62 +37,77 @@
3737
"zarr_url": {
3838
"title": "Zarr Url",
3939
"type": "string",
40-
"description": "URL of the Zarr image."
40+
"description": "Path or url to the individual OME-Zarr image to be processed. (standard argument for Fractal tasks, managed by Fractal server)."
4141
},
4242
"level": {
4343
"title": "Level",
4444
"type": "integer",
45-
"description": "Level of the Zarr image to process."
45+
"description": "Pyramid level of the image to be segmented. Choose `0` to process at full resolution."
4646
},
4747
"channel": {
4848
"$ref": "#/$defs/ChannelInputModel",
4949
"title": "Channel",
50-
"description": "Channel input model."
50+
"description": "Primary channel for pixel classification; requires either `wavelength_id` (e.g. `A01_C01`) or `label` (e.g. `DAPI`)."
5151
},
52-
"ilastik_model": {
53-
"title": "Ilastik Model",
54-
"type": "string",
55-
"description": "Path to the Ilastik model."
52+
"channel2": {
53+
"allOf": [
54+
{
55+
"$ref": "#/$defs/ChannelInputModel"
56+
}
57+
],
58+
"title": "Channel2",
59+
"description": "Second channel for pixel classification (in the same format as `channel`). Use only if second channel has also been used during Ilastik model training."
5660
},
5761
"input_ROI_table": {
5862
"default": "FOV_ROI_table",
5963
"title": "Input Roi Table",
6064
"type": "string",
61-
"description": "Name of the input ROI table."
65+
"description": "Name of the ROI table over which the task loops to apply Cellpose segmentation. Examples: `FOV_ROI_table` => loop over the field of views, `organoid_ROI_table` => loop over the organoid ROI table (generated by another task), `well_ROI_table` => process the whole well as one image."
6266
},
6367
"output_ROI_table": {
6468
"title": "Output Roi Table",
6569
"type": "string",
66-
"description": "Name of the output ROI table."
70+
"description": "If provided, a ROI table with that name is created, which will contain the bounding boxes of the newly segmented labels. ROI tables should have `ROI` in their name."
6771
},
6872
"output_label_name": {
6973
"title": "Output Label Name",
7074
"type": "string",
71-
"description": "Name of the output label."
75+
"description": "Name of the output label image (e.g. `\"embryo\"`)."
76+
},
77+
"use_masks": {
78+
"default": true,
79+
"title": "Use Masks",
80+
"type": "boolean",
81+
"description": "If `True`, try to use masked loading and fall back to `use_masks=False` if the ROI table is not suitable. Masked loading is relevant when only a subset of the bounding box should actually be processed (e.g. running within `emb_ROI_table`)."
82+
},
83+
"ilastik_model": {
84+
"title": "Ilastik Model",
85+
"type": "string",
86+
"description": "Path to the Ilastik model (e.g. `\"somemodel.ilp\"`)."
87+
},
88+
"foreground_class": {
89+
"default": 0,
90+
"title": "Foreground Class",
91+
"type": "integer",
92+
"description": "Class to be considered as foreground during prediction thresholding."
7293
},
7394
"threshold": {
74-
"default": 10000,
95+
"default": 0.5,
7596
"title": "Threshold",
76-
"type": "integer",
77-
"description": "Threshold for the Ilastik model."
97+
"type": "number",
98+
"description": "Probabiltiy threshold for the Ilastik model."
7899
},
79100
"min_size": {
80-
"default": 3,
101+
"default": 15,
81102
"title": "Min Size",
82103
"type": "integer",
83-
"description": "Minimum size for the Ilastik model."
84-
},
85-
"use_masks": {
86-
"default": true,
87-
"title": "Use Masks",
88-
"type": "boolean",
89-
"description": "Whether to use masks."
104+
"description": "Minimum size of the segmented objects (in pixels)."
90105
},
91106
"overwrite": {
92107
"default": true,
93108
"title": "Overwrite",
94109
"type": "boolean",
95-
"description": "Whether to overwrite existing data."
110+
"description": "If `True`, overwrite the task output."
96111
}
97112
},
98113
"required": [

src/ilastik_tasks/__init__.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
"""
2-
Collection of Fractal task to run Headless ilastik workflows
3-
"""
1+
"""Collection of Fractal task to run Headless ilastik workflows"""
2+
43
from importlib.metadata import PackageNotFoundError, version
54

65
try:
76
__version__ = version("ilastik-tasks")
87
except PackageNotFoundError:
9-
__version__ = "uninstalled"
8+
__version__ = "uninstalled"

src/ilastik_tasks/dev/create_manifest.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
"""
2-
Generate JSON schemas for task arguments afresh, and write them
3-
to the package manifest.
4-
"""
1+
"""Generate JSON schemas for task arguments."""
2+
53
from fractal_tasks_core.dev.create_manifest import create_manifest
64

75
if __name__ == "__main__":

0 commit comments

Comments
 (0)