Bacteria Class
Bacteria
#
A class to store all the properties of a single bacterium.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
img
|
|
required | |
mask
|
|
required | |
options
|
|
dict()
|
Attributes:
| Name | Type | Description |
|---|---|---|
centroid |
the centroid of the bacterium
|
|
xc |
the x-coordinate of the centroid
|
|
yc |
the y-coordinate of the centroid
|
|
xc_nm |
the x-coordinate of the centroid in nm
|
|
yc_nm |
the y-coordinate of the centroid in nm
|
|
bbox |
the bounding box of the bacterium
|
|
axis_major_length |
the major axis length of the bacterium
|
|
axis_minor_length |
the minor axis length of the bacterium
|
|
orientation |
the orientation of the bacterium
|
|
area |
the area of the bacterium
|
|
boundary |
the boundary of the bacterium
|
|
medial_axis |
the medial axis of the bacterium
|
|
medial_axis_extended |
the medial axis of the bacterium extended to the boundary
|
|
slice |
the slice of the stack where the bacterium is located (default is zero)
|
|
all_widths |
the widths of the bacterium at different points along the medial axis
|
|
Source code in src/micromorph/bacteria/Bacteria.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 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 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 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 | |
get_bacteria_for_index(img: np.array, mask: np.array, i: int, options: dict)
#
Function which returns a Bacteria object for the i-th bacterium in the labelled mask.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
img
|
np.array
|
the image containing all the bacteria |
required |
mask
|
np.array
|
the labelled mask of the image |
required |
i
|
int
|
the index of the bacterium to be analysed |
required |
options
|
dict
|
a dictionary with options to be passed to the functions used to calculate the morphological properties of the bacterium |
required |
Returns:
| Name | Type | Description |
|---|---|---|
bac |
Bacteria
|
a Bacteria object containing the properties of the i-th bacterium |
Source code in src/micromorph/bacteria/Bacteria.py
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 | |
options: docstring_style: numpy docstring_section_style: table show_docstring_attributes: true