Documention for fibre detection
To detect fibre centre in a slice
fibretracker.models
fibretracker.models.get_fibre_coords
get_fibre_coords(vol, std=2.5, min_distance=3, threshold_abs=0.4, weighted_avg=False, window_size=10, apply_filter=False)
Get list of fibres centre coordinates in a volume using blob detector
Parameters:
Name | Type | Description | Default |
---|---|---|---|
vol |
ndarray
|
input volume |
required |
std |
float
|
standard deviation of the Gaussian filter |
2.5
|
min_distance |
int
|
minimum distance between fibres |
3
|
threshold_abs |
float
|
threshold value for the peak from the background |
0.4
|
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
|
Returns:
Name | Type | Description |
---|---|---|
coords |
List(array)
|
List of fibres centre coordinates in the volume |
Example
Source code in fibretracker/models/detector.py
fibretracker.models.blob_centre_detector
Predict coordinates of fibres centre in a volume slice using blob detector
Parameters:
Name | Type | Description | Default |
---|---|---|---|
im |
ndarray
|
input image |
required |
std |
float
|
standard deviation of the Gaussian filter |
2.5
|
min_distance |
int
|
minimum distance between peaks |
3
|
threshold_abs |
float
|
threshold value for the peak from the background |
0.4
|
Returns:
Name | Type | Description |
---|---|---|
pred_coords |
ndarray
|
predicted coordinates of the fibre centre |
Example
Source code in fibretracker/models/detector.py
fibretracker.models.gauss_filter
Generate a 1D Gaussian filter and its derivatives
Parameters:
Name | Type | Description | Default |
---|---|---|---|
std |
float
|
standard deviation of the Gaussian filter |
required |
Returns:
Name | Type | Description |
---|---|---|
g |
ndarray
|
1D Gaussian filter |
dg |
ndarray
|
derivative of the Gaussian filter |
ddg |
ndarray
|
second derivative of the Gaussian filter |
Source code in fibretracker/models/detector.py
fibretracker.models.avg_fibre_coord
Recompute the fibre centre in a slice using weighted average of peak neighbourhood
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pred_coord |
ndarray
|
predicted coordinates of the peaks |
required |
im |
ndarray
|
input image |
required |
window_size |
int
|
size of the neighbourhood window around the peak |
10
|
apply_filter |
bool
|
whether to apply Gaussian filter to the window |
False
|
std |
Optional[float]
|
standard deviation of the Gaussian filter |
None
|
Returns:
Name | Type | Description |
---|---|---|
coords |
ndarray
|
recomputed fibre centre coordinates in the slice with weighted average |