99
1010
1111def label_image_to_roi_list (label_image , low_thresh = None ):
12- """Converts a label image to a list of ROIs
12+ """Convert a label image to a list of ROIs.
1313
1414 Parameters
1515 ----------
1616 label_image : ij.ImagePlus
17- Label image to convert
17+ Label image to convert.
1818 low_thresh : int, optional
19- Value under which the labels should be discarded, by default None
19+ Value under which the labels should be discarded, by default ` None`.
2020
2121 Returns
2222 -------
2323 roi_list : list(ij.gui.Roi)
24- List of all the ROIs converted from the label image
24+ List of all the ROIs converted from the label image.
2525 """
2626
2727 roi_list = []
@@ -65,21 +65,21 @@ def label_image_to_roi_list(label_image, low_thresh=None):
6565
6666
6767def relate_label_images (label_image_ref , label_image_to_relate ):
68- """Relate label images, giving same label to objects being together
68+ """Relate label images, giving the same label to objects belonging together.
6969
70- /!\ Won't work with touching labels
70+ ❗ NOTE: Won't work with touching labels ❗
7171
7272 Parameters
7373 ----------
7474 label_image_ref : ij.ImagePlus
75- Reference to use for the labels
75+ Reference to use for the labels.
7676 label_image_to_relate : ij.ImagePlus
77- Image to change for the labels
77+ Image to change for the labels.
7878
7979 Returns
8080 -------
8181 ij.ImagePlus
82- New ImagePlus with modified labels matching the reference
82+ New ImagePlus with modified labels matching the reference.
8383 """
8484
8585 imp_dup = label_image_to_relate .duplicate ()
@@ -91,26 +91,25 @@ def relate_label_images(label_image_ref, label_image_to_relate):
9191
9292
9393def filter_objects (label_image , table , string , min_val , max_val ):
94- """Filter labels based on values
94+ """Filter labels based on specific min and max values.
9595
9696 Parameters
9797 ----------
9898 label_image : ij.ImagePlus
99- Label image on which to filter
99+ Label image on which to filter.
100100 table : ResultsTable
101- ResultsTable containing all the measurements on which to filter
101+ ResultsTable containing all the measurements on which to filter.
102102 string : str
103- Measurement name on which to filter
104- e.g. "Area","Mean Intensity" etc...
103+ Measurement name on which to filter, e.g. `Area`, `Mean Intensity` etc.
105104 min_val : float
106- Minimum value to keep
105+ Minimum value to keep.
107106 max_val : float
108107 Maximum value to keep
109108
110109 Returns
111110 -------
112111 ij.ImagePlus
113- Label image containing only the remaining labels
112+ Label image containing only the remaining labels.
114113 """
115114
116115 keep_label_id = []
@@ -123,17 +122,17 @@ def filter_objects(label_image, table, string, min_val, max_val):
123122
124123
125124def measure_objects_size_shape_2d (label_image ):
126- """Measure the different labels shapes
125+ """Measure the shapes of the different labels.
127126
128127 Parameters
129128 ----------
130129 label_image : ij.ImagePlus
131- Label image on which to get the shapes
130+ Label image on which to get the shapes.
132131
133132 Returns
134133 -------
135134 ResultsTable
136- ResultsTable with the shape measurements
135+ ResultsTable with the shape measurements.
137136 """
138137 regions = AnalyzeRegions ()
139138 return regions .process (label_image )
0 commit comments