threshold_segmentation
Task for threshold-based segmentation of OME-Zarr images.
_skip_segmentation(channels, ome_zarr)
¶
Check whether to skip the current task based on the channel configuration.
If the channel selection specified in the channels parameter is not valid for the provided OME-Zarr image, this function checks the skip_if_missing attribute of the channels configuration. If skip_if_missing is True, the function returns True, indicating that the task should be skipped. If skip_if_missing is False, a ValueError is raised.
| PARAMETER | DESCRIPTION |
|---|---|
channels |
The channel selection configuration.
TYPE:
|
ome_zarr |
The OME-Zarr container to check against.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if the task should be skipped due to missing channels,
TYPE:
|
bool
|
False otherwise. |
Source code in fractal_tasks_core/threshold_segmentation.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | |
threshold_segmentation(*, zarr_url, channel, output_label_name='{channel_identifier}_segmented', level_path=None, segmentation_method=Field(default_factory=OtsuConfiguration), iterator_configuration=None, pre_post_process=Field(default_factory=SegmentationTransformConfig), create_masking_roi_table=Field(default_factory=SkipCreateMaskingRoiTable), overwrite=True)
¶
Segment an image using intensity thresholding.
Pixels above the threshold are treated as foreground and connected components are labelled. The threshold can be computed automatically (Otsu) or set manually.
| PARAMETER | DESCRIPTION |
|---|---|
zarr_url |
URL to the OME-Zarr container.
TYPE:
|
channel |
Channel to use for segmentation, selected by label, wavelength ID, or index.
TYPE:
|
output_label_name |
Name of the resulting label image. Optionally, it can contain a placeholder "{channel_identifier}" which will be replaced by the channel identifier specified in the channels parameter.
TYPE:
|
level_path |
If the OME-Zarr has multiple resolution levels, the level to use can be specified here. If not provided, the highest resolution level will be used.
TYPE:
|
iterator_configuration |
Optionally restrict segmentation to a specific set of ROIs or a sub-region. If not provided, the full image is segmented.
TYPE:
|
segmentation_method |
Configuration for the segmentation method.
TYPE:
|
pre_post_process |
Configuration for pre- and post-processing transforms applied by the iterator.
TYPE:
|
create_masking_roi_table |
Configuration to create a masking ROI table after segmentation.
TYPE:
|
overwrite |
Whether to overwrite an existing label image. Defaults to True.
TYPE:
|
Source code in fractal_tasks_core/threshold_segmentation.py
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 | |