Strel
annulus(r0, r_xy, r_z=None)
Gets structuring element used to assess if spot isolated.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
r0 |
float
|
Inner radius within which values are all zero. |
required |
r_xy |
float
|
Outer radius in xy direction.
Can be float not integer because all values with |
required |
r_z |
Optional[float]
|
Outer radius in z direction. Size in z-pixels. None means 2D annulus returned. |
None
|
Returns:
Type | Description |
---|---|
np.ndarray
|
|
Source code in coppafish/utils/strel.py
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 |
|
disk(r, n=4)
Creates a flat disk-shaped structuring element with the specified radius, r
.
r
must be a nonnegative integer.
n
must be 0, 4, 6, or 8
.
When n
is greater than 0
, the disk-shaped structuring
element is approximated by a sequence of n
(or sometimes n+2
)
periodic-line structuring elements.
When n
is 0
, no approximation is used, and the structuring element members comprise all pixels whose
centers are no greater than r
away from the origin. n
can be omitted, in which case its default value is 4
.
Note
Morphological operations using disk approximations (n>0
) run much faster than when n=0
.
Also, the structuring elements resulting from choosing n>0
are suitable for
computing granulometries, which is not the case for vn=0
. Sometimes it
is necessary for STREL to use two extra line structuring elements in the
approximation, in which case the number of decomposed structuring
elements used is n+2
.
Copy of MATLAB strel('disk')
.
Source code in coppafish/utils/strel.py
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 |
|
disk_3d(r_xy, r_z)
Gets structuring element used to find spots when dilated with 3d image.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
r_xy |
float
|
Radius in xy direction. |
required |
r_z |
float
|
Radius in z direction. |
required |
Returns:
Type | Description |
---|---|
np.ndarray
|
|
Source code in coppafish/utils/strel.py
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 |
|
fspecial(r_y, r_x=None, r_z=None)
Creates an ellipsoidal 3D filter kernel if r_y
, r_x
and r_z
given.
Copy of MATlAB fspecial3('ellipsoid')
.
Creates a disk 2D filter kernel if just r_y
given. Copy of MATlAB fspecial('disk')
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
r_y |
float
|
Radius in y direction or radius of disk if only parameter provided. |
required |
r_x |
Optional[float]
|
Radius in x direction. |
None
|
r_z |
Optional[float]
|
Radius in z direction. |
None
|
Returns:
Type | Description |
---|---|
np.ndarray
|
|
Source code in coppafish/utils/strel.py
165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 |
|
periodic_line(p, v)
Creates a flat structuring element containing 2*p+1
members.
v
is a two-element vector containing integer-valued row and column offsets.
One structuring element member is located at the origin.
The other members are located at 1*v, -1*v, 2*v, -2*v, ..., p*v, -p*v
.
Copy of MATLAB strel('periodicline')
.
Source code in coppafish/utils/strel.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
|