Detect
detect_spots(image, intensity_thresh, radius_xy, radius_z=None, remove_duplicates=False, se=None)
Finds local maxima in image exceeding intensity_thresh
.
This is achieved through a dilation being run on the whole image.
Should use for a large se.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
image |
np.ndarray
|
|
required |
intensity_thresh |
float
|
Spots are local maxima in image with |
required |
radius_xy |
Optional[int]
|
Radius of dilation structuring element in xy plane (approximately spot radius). |
required |
radius_z |
Optional[int]
|
Radius of dilation structuring element in z direction (approximately spot radius).
Must be more than 1 to be 3D.
If |
None
|
remove_duplicates |
bool
|
Whether to only keep one pixel if two or more pixels are local maxima and have same intensity. Only works with integer image. |
False
|
se |
Optional[np.ndarray]
|
|
None
|
Returns:
Type | Description |
---|---|
np.ndarray
|
|
np.ndarray
|
|
Source code in coppafish/find_spots/detect.py
7 8 9 10 11 12 13 14 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 |
|
Optimised
detect_spots(image, intensity_thresh, radius_xy, radius_z=None, remove_duplicates=False, se=None)
Finds local maxima in image exceeding intensity_thresh
.
This is achieved by looking at neighbours of pixels above intensity_thresh.
Should use for a small se
and high intensity_thresh
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
image |
np.ndarray
|
|
required |
intensity_thresh |
float
|
Spots are local maxima in image with |
required |
radius_xy |
Optional[int]
|
Radius of dilation structuring element in xy plane (approximately spot radius). |
required |
radius_z |
Optional[int]
|
Radius of dilation structuring element in z direction (approximately spot radius).
Must be more than 1 to be 3D.
If |
None
|
remove_duplicates |
bool
|
Whether to only keep one pixel if two or more pixels are local maxima and have same intensity. Only works with integer image. |
False
|
se |
Optional[np.ndarray]
|
|
None
|
Returns:
Type | Description |
---|---|
np.ndarray
|
|
np.ndarray
|
|
Source code in coppafish/find_spots/detect_optimised.py
10 11 12 13 14 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 |
|
get_local_maxima_jax(image, se_shifts, pad_size_y, pad_size_x, pad_size_z, consider_yxz, consider_intensity)
Finds the local maxima from a given set of pixels to consider.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
image |
jnp.ndarray
|
|
required |
se_shifts |
Tuple[jnp.ndarray, jnp.ndarray, jnp.ndarray]
|
|
required |
pad_size_y |
int
|
How much to zero pad image in y. |
required |
pad_size_x |
int
|
How much to zero pad image in x. |
required |
pad_size_z |
int
|
How much to zero pad image in z. |
required |
consider_yxz |
List[jnp.ndarray]
|
|
required |
consider_intensity |
jnp.ndarray
|
|
required |
Returns:
Type | Description |
---|---|
jnp.ndarray
|
|
Source code in coppafish/find_spots/detect_optimised.py
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 |
|