Tools
| FUNCTION | DESCRIPTION |
|---|---|
aggregate_attributes |
Given a list of images, this function returns a dictionary of all image |
aggregate_types |
Given a list of images, this function returns a list of all image types. |
filter_image_list |
Compute a sublist with images that match a filter set. |
find_image_by_zarr_url |
Return a copy of the image with a given zarr_url, and its positional index. |
match_filter |
Find whether an image matches a filter set. |
merge_type_filters |
Merge two type-filters sets, if they are compatible. |
Attributes¶
Functions:¶
_sort_with_fallback(value)
¶
Returns the value list sorted using the sorted method.
If the list is non-homogeneous (i.e. "TypeError: '<' not supported between
instances of 'x' and 'y'") returns the original value list.
Source code in fractal_server/images/tools.py
aggregate_attributes(images)
¶
Given a list of images, this function returns a dictionary of all image attributes, each mapped to a sorted list of existing values.
Source code in fractal_server/images/tools.py
aggregate_types(images)
¶
Given a list of images, this function returns a list of all image types.
filter_image_list(images, type_filters=None, attribute_filters=None)
¶
Compute a sublist with images that match a filter set.
| PARAMETER | DESCRIPTION |
|---|---|
|
A list of images. |
|
|
|
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
list[dict[str, Any]]
|
List of the |
Source code in fractal_server/images/tools.py
find_image_by_zarr_url(*, images, zarr_url)
¶
Return a copy of the image with a given zarr_url, and its positional index.
| PARAMETER | DESCRIPTION |
|---|---|
|
List of images. |
|
Path that the returned image must have.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
ImageSearch | None
|
The first image from |
Source code in fractal_server/images/tools.py
match_filter(*, image, type_filters, attribute_filters)
¶
Find whether an image matches a filter set.
| PARAMETER | DESCRIPTION |
|---|---|
|
A single image. |
|
|
|
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
Whether the image matches the filter set. |
Source code in fractal_server/images/tools.py
merge_type_filters(*, task_input_types, wftask_type_filters)
¶
Merge two type-filters sets, if they are compatible.