napari_ndev.morphology
#
Functions for processing label morphology.
Process labels with various functions using pyclesperanto and scikit-image. Intended to be compatible with workflow.yaml files, and will be incorporated into napari-workflows and napari-assistant in the future. Should accept both OCLArray and other ArrayLike types.
Functions:
-
skeletonize_labels : Create skeletons with label identities from a label image.
–
connect_breaks_between_labels
#
connect_breaks_between_labels(label, connect_distance)
Connect breaks between labels in a label image.
Return the input label image with new label identities connecting breaks between the original labels. The new labels have the original label dimensions, so this is intended to keep the overall morphology the same, just with new labels connecting the original labels if under the specified distance.
Parameters:
-
label
#ArrayLike
) –Label image.
-
connect_distance
#float
) –Maximum distance to connect labels, in pixels.
Returns:
-
ArrayLike
–Label image with new labels connecting breaks between original labels.
Source code in src/napari_ndev/morphology.py
67 68 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 |
|
convert_float_to_int
#
convert_float_to_int(img)
Convert an image from float to integer.
Parameters:
-
img
#ArrayLike
) –Label image.
Returns:
-
ArrayLike
–Label image as integer.
Source code in src/napari_ndev/morphology.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
|
label_voronoi_based_on_intensity
#
label_voronoi_based_on_intensity(label, intensity_image)
Create a voronoi label masks of labels based on an intensity image.
Return a label image with Voronoi regions based on the intensity image. The intensity image should be the same shape as the label image, and the labels will be assigned to the Voronoi regions based on the intensity values.
Parameters:
Returns:
-
ArrayLike
–Label image with Voronoi regions based on the intensity image.
Source code in src/napari_ndev/morphology.py
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 |
|
skeletonize_labels
#
skeletonize_labels(label)
Create skeletons and maintains label identities from a label image.
Parameters:
-
label
#ArrayLike
) –Label image.
Returns:
-
ndarray
–Skeletonized label image.
Source code in src/napari_ndev/morphology.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
|