Register
Register Initial
view_register_shift_info
For all shifts to imaging rounds from the reference round computed in the register_initial
section
of the pipeline, this plots the values of the shifts found and the score
compared to
the score_thresh
.
For each round, there will be 3 plots:
- y shift vs x shift for all tiles
- z shift vs x shift for all tiles
score
vsscore_thresh
for all tiles (a green score = score_thresh line is plotted in this).
In each case, the markers in the plots are numbers.
These numbers indicate the tile the shift was found for.
The number will be blue if score > score_thresh
and red otherwise.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
nb |
Notebook
|
Notebook containing at least the |
required |
outlier |
bool
|
If |
False
|
Source code in coppafish/plot/register/shift.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 |
|
view_register_search
Function to plot results of exhaustive search to find shift between ref_round/ref_channel
and
round r
, channel c
for tile t
. This shift will then be used as the starting point when running point cloud
registration to find affine transform.
Useful for debugging the register_initial
section of the pipeline.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
nb |
Notebook
|
Notebook containing results of the experiment. Must contain |
required |
t |
int
|
tile interested in. |
required |
r |
int
|
Want to find the shift between the reference round and this round. |
required |
c |
Optional[int]
|
Want to find the shift between the reference channel and this channel. If |
None
|
return_shift |
bool
|
If True, will return shift found and will not call plt.show() otherwise will return None. |
False
|
Returns:
Type | Description |
---|---|
Optional[np.ndarray]
|
|
Source code in coppafish/plot/register/shift.py
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 |
|
Register
scale_box_plots
Function to plot distribution of chromatic aberration scaling amongst tiles for each round and channel. Want very similar values for a given channel across all tiles and rounds for each dimension. Also expect \(y\) and \(x\) scaling to be very similar. \(z\) scaling different due to unit conversion.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
nb |
Notebook
|
Notebook containing the |
required |
Source code in coppafish/plot/register/diagnostics.py
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 |
|
view_affine_shift_info
For all affine transforms to imaging rounds/channels from the reference round computed in the register
section
of the pipeline, this plots the values of the shifts, n_matches
(number of neighbours found) and
error
(average distance between neighbours).
For each round and channel (channel is changed by scrolling with the mouse), there will be 3 plots:
- y shift vs x shift for all tiles
- z shift vs x shift for all tiles
n_matches
vserror
for all tiles
In each case, the markers in the plots are numbers.
These numbers indicate the tile the shift was found for.
The number will be blue if nb.register_debug.n_matches > nb.register_debug.n_matches_thresh
and red otherwise.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
nb |
Notebook
|
Notebook containing at least the |
required |
c |
Optional[int]
|
If None, will give option to scroll with mouse to change channel. If specify c, will show just one channel with no scrolling. |
None
|
outlier |
bool
|
If |
False
|
Source code in coppafish/plot/register/diagnostics.py
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 |
|
ICP
view_icp
Function to plot results of iterative closest point to find affine transform between
ref_round/ref_channel
and round r
, channel c
for tile t
.
Useful for debugging the register
section of the pipeline.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
nb |
Notebook
|
Notebook containing results of the experiment. Must contain |
required |
t |
int
|
tile interested in. |
required |
r |
int
|
Want to find the transform between the reference round and this round. |
required |
c |
int
|
Want to find the transform between the reference channel and this channel. |
required |
Source code in coppafish/plot/register/icp.py
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 87 88 |
|
view_icp_reg
Function to plot how regularisation changes the affine transform found through iterative closest point between
ref_round/ref_channel
and round \(r\), channel \(c\) for tile \(t\).
Useful for finding suitable values for config['register']['regularize_constant']
and config['register']['regularize_factor']
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
nb |
Notebook
|
Notebook containing results of the experiment. Must contain |
required |
t |
int
|
tile interested in. |
required |
r |
int
|
Want to find the transform between the reference round and this round. |
required |
c |
int
|
Want to find the transform between the reference channel and this channel. |
required |
reg_constant |
Optional[List]
|
|
None
|
reg_factor |
Optional[List]
|
The regularized term in the loss function for finding the transform is: \(0.5\lambda (\mu D_{scale}^2 + D_{shift}^2)\) Where:
|
None
|
reg_transform |
Optional[np.ndarray]
|
Transform to regularize towards i.e. the expected transform.
If not specified, will use average transformation based on |
None
|
start_transform |
Optional[np.ndarray]
|
Initial transform to use as starting point for ICP.
If |
None
|
plot_residual |
bool
|
If |
False
|
Source code in coppafish/plot/register/icp.py
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 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 223 224 225 |
|
plot_reg_residual
This shows how changing the regularization parameters affect how close the affine transform
is to that which it was being regularized towards. E.g. it should show that
the larger reg_constant
, the smaller the difference (y-axis values in the plots).
There will be up to 4 plots, in each, the different colors refer to the different
reg_constant
/reg_factor
combinations and the smaller the y-axis value,
the closer the transform is to reg_transform
. The different axis variables in the plot are
explained in the reg_factor
variable description below.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
reg_transform |
np.ndarray
|
|
required |
transforms_plot |
List[np.ndarray]
|
|
required |
reg_constant |
List
|
|
required |
reg_factor |
List
|
The regularized term in the loss function for finding the transform is: \(0.5\lambda (\mu D_{scale}^2 + D_{shift}^2)\) Where:
|
required |
transform_no_reg |
Optional[np.ndarray]
|
|
None
|
n_matches |
Optional[int]
|
Number of nearest neighbours found for |
None
|
Source code in coppafish/plot/register/icp.py
228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 |
|