Stitch
Shift
view_stitch_search
Function to plot results of exhaustive search to find overlap between tile t
and its neighbours.
Useful for debugging the stitch
section of the pipeline.
White in the color plot refers to the value of score_thresh
for this search.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
nb |
Notebook
|
Notebook containing results of the experiment. Must contain |
required |
t |
int
|
Want to look at overlap between tile |
required |
direction |
Optional[str]
|
Direction of overlap interested in - either |
None
|
Source code in coppafish/plot/stitch/shift.py
225 226 227 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 |
|
view_shifts
Function to plot scores indicating number of neighbours between 2 point clouds corresponding to particular shifts
applied to one of them. I.e. you can use this to view the output from
coppafish/stitch/shift/compute_shift
function.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
shifts_2d |
np.ndarray
|
|
required |
scores_2d |
np.ndarray
|
|
required |
shifts_3d |
Optional[np.ndarray]
|
|
None
|
scores_3d |
Optional[np.ndarray]
|
|
None
|
best_shift |
Optional[np.ndarray]
|
|
None
|
score_thresh_2d |
Optional[float]
|
Threshold returned by |
None
|
best_shift_initial |
Optional[np.ndarray]
|
|
None
|
score_thresh_3d |
Optional[float]
|
Threshold returned by |
None
|
thresh_shift |
Optional[np.ndarray]
|
|
None
|
thresh_min_dist |
Optional[int]
|
|
None
|
thresh_max_dist |
Optional[int]
|
|
None
|
title |
Optional[str]
|
Title to show. |
None
|
show |
bool
|
If |
True
|
Source code in coppafish/plot/stitch/shift.py
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 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 |
|
Point Clouds
view_stitch_overlap
This plots point clouds of neighbouring tiles with:
- No overlap
- Initial guess at shift using
config['stitch']['expected_overlap']
- Overlap determined in stitch stage of the pipeline (using
nb.stitch.south_shifts
ornb.stitch.west_shifts
) - Their final global coordinate system positions (using
nb.stitch.tile_origin
)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
nb |
Notebook
|
Notebook containing at least |
required |
t |
int
|
Want to look at overlap between tile |
required |
direction |
str
|
Direction of overlap interested in - either |
'south'
|
Source code in coppafish/plot/stitch/point_clouds.py
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 226 227 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 |
|
view_stitch
This plots all the reference spots found (ref_round
/ref_channel
) in the global coordinate system created
in the stitch
stage of the pipeline.
It also indicates which of these spots are duplicates (detected on a tile which is not the tile whose centre
they are closest to).
These will be removed in the get_reference_spots
step of the pipeline so we don't double count the same spot.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
nb |
Notebook
|
Notebook containing at least |
required |
Source code in coppafish/plot/stitch/point_clouds.py
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 |
|
view_point_clouds
Plots two point clouds. point_clouds[0]
always plotted but you can change the second point cloud using
radio buttons.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
point_clouds |
List
|
List of point clouds, each of which is yxz coordinates |
required |
pc_labels |
List
|
List of labels to appear in legend/radio-buttons for each point cloud.
Must provide one for each |
required |
neighb_dist_thresh |
float
|
If distance between neighbours is less than this, a white line will connect them. |
5
|
z_scale |
float
|
|
1
|
super_title |
Optional[str]
|
Optional title for plot |
None
|
Source code in coppafish/plot/stitch/point_clouds.py
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 |
|
Diagnostics
view_stitch_shift_info
For all north/south and east/west shifts computed in the stitch
section
of the pipeline, this plots the values of the shifts found and the score
compared to
the score_thresh
.
For each direction, there will be 3 plots:
- y shift vs x shift for all pairs of neighbouring tiles
- z shift vs x shift for all pairs of neighbouring tiles
score
vsscore_thresh
for all pairs of neighbouring 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 applied to,
to take it to its north or east neighbour i.e. nb.stitch.south_pairs[:, 0]
or nb.stitch.west_pairs[:, 0]
.
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/stitch/diagnostics.py
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 |
|
shift_info_plot
If shift_info
contains \(n\) keys, this will produce an \(n\) column x 3 row grid of subplots.
For each key in shift_info
dictionary, there are 3 plots:
- y shift vs x shift
- z shift vs x shift
score
vsscore_thresh
orn_matches
vserror
In each case, the markers in the plots are numbers.
These numbers are given by shift_info[key][tile]
.
The number will be blue if score > score_thresh
and red otherwise.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
shift_info |
dict
|
Dictionary containing \(n\) dictionaries.
Each of these dictionaries contains (either (
|
required |
title |
Optional[str]
|
Overall title for the plot. |
None
|
score_plot_thresh |
int
|
Only shifts with |
0
|
fig |
Optional[plt.Figure]
|
Can provide previous figure to plot on. |
None
|
ax |
Optional[np.ndarray]
|
Can provide array of plt.Axes to plot on. |
None
|
return_ax |
bool
|
If |
False
|
Source code in coppafish/plot/stitch/diagnostics.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 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 147 148 149 150 151 152 153 154 155 156 |
|