For tracking file
To detect fibre centre in a slice
fibretracker.models
fibretracker.models.track_fibres
track_fibres(vol=None, max_jump=5, max_skip=5, momentum=0.1, track_min_length=5, coords=None, std=2.5, min_distance=5, threshold_abs=0.5, weighted_avg=False, window_size=10, apply_filter=False, smoothtrack_gaussian=False, sigma=3, smoothtrack_watershed=False, threshold=None)
Tracks fibers throughout the volume
Parameters:
Name | Type | Description | Default |
---|---|---|---|
vol |
ndarray
|
3D volume. |
None
|
max_jump |
int
|
Maximum distance between detected points in two consecutive frames. Threshold in pixels. |
5
|
max_skip |
int
|
Maximum number of frames along one track where no points are detected. |
5
|
momentum |
float
|
Parameter in the range [0;1] that gives momentum to the tracking direction. |
0.1
|
track_min_length |
int
|
Minimum number of points in a track. |
5
|
coords |
list
|
List of numpy arrays with row and column indices of detected points. One per slice, which means that z is gives as the index of the list. |
None
|
std |
float
|
Standard deviation of the Gaussian filter. |
2.5
|
min_distance |
int
|
Minimum distance between fibres. |
5
|
threshold_abs |
float
|
Threshold value for the peak from the background. |
0.5
|
weighted_avg |
bool
|
Whether to apply weighted average to the detected coordinates. |
False
|
window_size |
int
|
Size of the neighbourhood window around the peak. |
10
|
apply_filter |
bool
|
Whether to apply Gaussian filter to the window. |
False
|
smoothtrack_gaussian |
bool
|
Whether to smooth tracks using Gaussian. |
False
|
sigma |
float
|
Sigma value for Gaussian filter. |
3
|
smoothtrack_watershed |
bool
|
Whether to smooth tracks using watershed. |
False
|
threshold |
float
|
Threshold value for watershed. |
None
|
Returns:
Name | Type | Description |
---|---|---|
tracks |
List[ndarray]
|
List of arrays of shape (n_points, 3) - each list contains coordinates of tracked fibers. |
Example
Source code in fibretracker/models/tracker.py
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 |
|