You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/image_list.md
+23-29Lines changed: 23 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,54 +20,48 @@ Note: when applying filters to the image list, the absence of a type corresponds
20
20
21
21
Image attributes are scalar properties (strings, integers, floats or booleans). They are always defined from within individual tasks, and never by the task manifest. They allow selecting subsets of your data (e.g. select a given well, a given plate or a given multiplexing acquisition).
22
22
23
-
Fractal server uses the image list combined with filters (see [below](#dataset-filters)) to provide the right image URLs to tasks.
23
+
Fractal server uses the image list combined with filters (see [below](#filters)) to provide the right image URLs to each task during execution.
24
24
25
25
26
26
## Filters
27
27
28
-
Before running a given task, Fractal prepares an appropriate image list by extracting the images that match with a given set of filters (that is, a set of specific values assigned to image types and/or image attributes). Filters can be defined for a dataset and/or for a workflow task. If a specific filter is set both for the dataset and for the workflow task, the workflow-task filter takes priority.
28
+
Before running a given task, Fractal prepares an appropriate image list by extracting the images that match with a given set of filters (that is, a set of specific values assigned to image types and/or image attributes). Filters can refer both to image types or image attributes and they may come from different sources.
29
29
30
+
### Type filters
30
31
31
-
###Dataset filters
32
+
#### Input filters
32
33
33
-
There are multiple ways a dataset may have a given filter set:
34
+
Before executing a given task, Fractal checks which type filters should be applied to obtain the right list of images to be processed.
35
+
The set of type filters is obtained by combining these sources:
34
36
35
-
1. I manually set it, by modifying the dataset `filters` property.
36
-
2. While writing the Fractal manifest for a task package, I include the `output_types` attribute for a given task. These types are automatically included in the dataset filters after the task is run.
37
-
Examples:
38
-
* An MIP task would set `output_types = {"is_3D": False}` in its output arguments: from this task onwards, the 2D images are processed (not the raw 3D images).
39
-
* An illumination-correction task would set `output_types = {"illumination_corrected": True}`: from this task onwards, the registered images are processed (not the raw images).
40
-
3. When writing the code for a specific task, the task output can include a `filters` property, for either image attributes and/or types - see the [section on task outputs](./tasks_spec.md#output-api).
41
-
42
-
Examples:
43
-
44
-
* My dataset currently has the type filter `{"is_3D": False}`, because I previously ran an MIP task. Subsequent tasks in the workflow will run on 2D images by default.
45
-
* My dataset currently has the attribute filter `{"well": "B03"}`, because I manually added it to the dataset (I just want to process a single well for the time being).
46
-
* My dataset currently has the attribute filter `{"acquisition": 1}`, because I manually added it to the dataset (I just want to process a single multiplexing acquisition).
37
+
1. The dataset may have `type_filters` set - this is the source with lowest priority.
38
+
* Example: I manually set `type_filters = {"is_3D": True}"` through Fractal, by modifying the dataset, since I want to only work on the 3D images.
39
+
2. The manifest of a tasks package may specify that a task has some required `input_types` (e.g. a projection task may have `input_types = {"is_3D": True}`), which count as filters.
40
+
* Example: An "Illumination correction" task with `input_types={"illumination_corrected": False}`, meaning that it cannot run on images with type `illumination_correction=True`.
41
+
* Example: Am "Apply Registration to Image" task with `input_types={"registered": False}`, meaning that it cannot run on images with type `registered=True`.
42
+
3. For a task within a workflow, it is possible to specify some additional `type_filters` (see [example below](#workflow-task-filters)).
43
+
* Example: I may need a workflow that includes a 3D->2D projection task but then switches back to 3D images in a later task. I can achieve this by setting `type_filters = {"is_3D": True}` for the relevant task, so that from this task onwards the 3D images are processed (and not the 2D ones).
47
44
45
+
#### Output filters
48
46
49
-
### Workflow-task filters
50
-
51
-
I can manually set an additional input filter by modifying the workflow-task `input_filters` property.
47
+
After executing a given task, Fractal may update the dataset `type_filters` property.
48
+
This happend when the task manifest includes an `output_types` property for this specific task. These types are automatically included in the dataset filters after the task is run.
52
49
53
50
Examples:
54
51
55
-
* I may need a workflow that includes the MIP task but then switches back to 3D images in a later task. I can achieve this by setting `input_filters = {"is_3D": True}` for the relevant task, so that from this task onwards the 3D images is processed (and not the 2D ones).
56
-
57
-
### Additional validation
52
+
* A 3D->2D projection task typically has `output_types = {"is_3D": False}`: from this task onwards, the 2D images are processed (not the raw 3D images).
53
+
* An illumination-correction task would have `output_types = {"illumination_corrected": True}`: from this task onwards, the registered images are processed (not the raw images).
58
54
59
-
Task manifest may also specify the `input_types` of a given task. These are not used for filtering the image list, but rather to validate that the filtered image list is valid. If some images of the filtered list do not comply with `input_types`, the Fractal runner raises an error.
60
-
61
-
Examples:
55
+
### Attribute filters
62
56
63
-
* The illumination-correction task has `input_types={"illumination_corrected": False}`, which means it cannot run on images with type `illumination_correction=True`.
64
-
* The Apply Registration to Image task has `input_types={"registered": False}`, which means it cannot run on images with type `registered=True`.
57
+
Before executing a given task, Fractal also checks which attribute filters should be applied to obtain the right list of images to be processed. These filters offer a way to process a subset of the whole dataset (e.g. only a few wells, rather than the whole plate).
65
58
59
+
Attribute filters are defined upon submission of a job, and they do not change during the job execution.
66
60
67
61
68
62
## Examples
69
63
70
-
After running a converter task, I may have an OME-Zarr HCS plate with 2 wells that contain one image each. In this case, the image list has 2 entries and each image has attributes for plate and well, as well as a true/fals`is_3D` type.
64
+
After running a converter task, I may have an OME-Zarr HCS plate with 2 wells that contain one image each. In this case, the image list has 2 entries and each image has attributes for plate and well, as well as a true/false`is_3D` type.
71
65
72
66

73
67
@@ -80,4 +74,4 @@ If I then run an MIP task, this will act on the two images with `illumination_co
80
74

81
75
82
76
83
-
Another example is that if I have an OME-Zarr HCS plate with 3 wells and each well has 3 multiplexing acquisition, then the image list includes 9 OME-Zarr images (and those entries should have the acquisition attribute set).
77
+
Another example is that if I have an OME-Zarr HCS plate with 3 wells and each well has 3 multiplexing acquisition, then the image list includes 9 OME-Zarr images (and those entries should have the acquisition attribute set).
0 commit comments