Base
all_pixel_yxz(y_size, x_size, z_planes)
Returns the yxz coordinates of all pixels on the indicated z-planes of an image.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
y_size |
int
|
number of pixels in y direction of image. |
required |
x_size |
int
|
number of pixels in x direction of image. |
required |
z_planes |
Union[List, int, np.ndarray]
|
|
required |
Returns:
Type | Description |
---|---|
np.ndarray
|
|
Source code in coppafish/spot_colors/base.py
163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 |
|
apply_transform(yxz, transform, tile_centre, z_scale, tile_sz)
This transforms the coordinates yxz based on an affine transform. E.g. to find coordinates of spots on the same tile but on a different round and channel.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
yxz |
np.ndarray
|
|
required |
transform |
np.ndarray
|
|
required |
tile_centre |
np.ndarray
|
|
required |
z_scale |
float
|
Scale factor to multiply z coordinates to put them in units of yx pixels.
I.e. |
required |
tile_sz |
np.ndarray
|
|
required |
Returns:
Type | Description |
---|---|
np.ndarray
|
|
np.ndarray
|
|
Source code in coppafish/spot_colors/base.py
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 |
|
get_spot_colors(yxz_base, t, transforms, nbp_file, nbp_basic, use_rounds=None, use_channels=None, return_in_bounds=False)
Takes some spots found on the reference round, and computes the corresponding spot intensity
in specified imaging rounds/channels.
By default, will run on nbp_basic.use_rounds
and nbp_basic.use_channels
.
Note
Returned spot colors have dimension n_spots x len(nbp_basic.use_rounds) x len(nbp_basic.use_channels)
not
n_pixels x nbp_basic.n_rounds x nbp_basic.n_channels
.
Note
invalid_value = -nbp_basic.tile_pixel_value_shift
is the lowest possible value saved in the npy file
minus 1 (due to clipping in extract step), so it is impossible for spot_color to be this.
Hence, I use this as integer nan. It will be invalid_value
if the registered coordinate of
spot s
is outside the tile in round r
, channel c
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
yxz_base |
np.ndarray
|
|
required |
t |
int
|
Tile that spots were found on. |
required |
transforms |
np.ndarray
|
|
required |
nbp_file |
NotebookPage
|
|
required |
nbp_basic |
NotebookPage
|
|
required |
use_rounds |
Optional[List[int]]
|
|
None
|
use_channels |
Optional[List[int]]
|
|
None
|
return_in_bounds |
bool
|
if |
False
|
Returns:
Type | Description |
---|---|
Union[np.ndarray, Tuple[np.ndarray, np.ndarray]]
|
|
Union[np.ndarray, Tuple[np.ndarray, np.ndarray]]
|
|
Source code in coppafish/spot_colors/base.py
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 147 148 149 150 151 152 153 154 155 156 157 158 159 160 |
|
Optimised
all_pixel_yxz(y_size, x_size, z_planes)
Returns the yxz coordinates of all pixels on the indicated z-planes of an image.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
y_size |
int
|
number of pixels in y direction of image. |
required |
x_size |
int
|
number of pixels in x direction of image. |
required |
z_planes |
Union[List, int, np.ndarray]
|
|
required |
Returns:
Type | Description |
---|---|
jnp.ndarray
|
|
Source code in coppafish/spot_colors/base_optimised.py
173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 |
|
apply_transform(yxz, transform, tile_centre, z_scale, tile_sz)
This transforms the coordinates yxz based on an affine transform. E.g. to find coordinates of spots on the same tile but on a different round and channel.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
yxz |
jnp.ndarray
|
|
required |
transform |
jnp.ndarray
|
|
required |
tile_centre |
jnp.ndarray
|
|
required |
z_scale |
float
|
Scale factor to multiply z coordinates to put them in units of yx pixels.
I.e. |
required |
tile_sz |
jnp.ndarray
|
|
required |
Returns:
Type | Description |
---|---|
jnp.ndarray
|
|
jnp.ndarray
|
|
Source code in coppafish/spot_colors/base_optimised.py
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 |
|
get_spot_colors(yxz_base, t, transforms, nbp_file, nbp_basic, use_rounds=None, use_channels=None, return_in_bounds=False)
Takes some spots found on the reference round, and computes the corresponding spot intensity
in specified imaging rounds/channels.
By default, will run on nbp_basic.use_rounds
and nbp_basic.use_channels
.
Note
Returned spot colors have dimension n_spots x len(nbp_basic.use_rounds) x len(nbp_basic.use_channels)
not
n_pixels x nbp_basic.n_rounds x nbp_basic.n_channels
.
Note
invalid_value = -nbp_basic.tile_pixel_value_shift
is the lowest possible value saved in the npy file
minus 1 (due to clipping in extract step), so it is impossible for spot_color to be this.
Hence I use this as integer nan. It will be invalid_value
if the registered coordinate of
spot s
is outside the tile in round r
, channel c
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
yxz_base |
jnp.ndarray
|
|
required |
t |
int
|
Tile that spots were found on. |
required |
transforms |
jnp.ndarray
|
|
required |
nbp_file |
NotebookPage
|
|
required |
nbp_basic |
NotebookPage
|
|
required |
use_rounds |
Optional[List[int]]
|
|
None
|
use_channels |
Optional[List[int]]
|
|
None
|
return_in_bounds |
bool
|
if |
False
|
Returns:
Type | Description |
---|---|
Union[np.ndarray, Tuple[np.ndarray, jnp.ndarray]]
|
|
Union[np.ndarray, Tuple[np.ndarray, jnp.ndarray]]
|
|
Source code in coppafish/spot_colors/base_optimised.py
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 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 |
|