elektronn2.data.skeleton module¶
-
class
elektronn2.data.skeleton.
SkeletonMFK
(aniso_scale=2, name=None, skel_num=None)[source]¶ Bases:
object
Joints: all branches and end points / node terminations (nodes not of deg 2) Branches: Joints of degree >= 3
-
get_loss_and_gradient
(new_position_s, cutoff_inner=0.3333333333333333, rise_factor=0.1)[source]¶ prediction_c (zxy) Zoned error surface: flat in inner hull (selected at cutoff_inner) constant gradient in “outer” hull towards nearest inner hull voxel gradient increasing with distance (scaled by rise_factor) for predictions outside hull
-
static
get_scale_factor
(radius, old_factor, scale_strenght)[source]¶ Parameters: - radius (predicted radius (not the true radius)) –
- old_factor (factor by which the radius prediction and the image was scaled) –
- scale_strenght (limits the maximal scale factor) –
Returns: Return type: new_factor
-
getbatch
(prediction, scale_strenght, **get_batch_kwargs)[source]¶ Parameters: - prediction ([[new_position_c, radius, ]]) –
- scale_strenght (limits the maximal scale factor for zoom) –
- get_batch_kwargs –
Returns: batch
Return type: img, target_img, target_grid, target_node
-
init_from_annotation
(skeleton_annotatation, min_radius=None, interpolation_resolution=0.5, interpolation_order=1)[source]¶
-
make_grid
= <elektronn2.utils.utils_basic.cache object>¶
-
map_hull
(hull_points)[source]¶ Distances take already into account the anisotropy in z (i.e. they are true distances) But all coordinates for hulls and vectors are still pixel coordinates
-
sample_local_direction_iso
(point, n_neighbors=6)[source]¶ For a point gives the local skeleton direction/orientation by fitting a line through the nearest neighbours, sign is randomly assigned
-
sample_tracing_direction_iso
(rng, local_direction_iso, c=0.5)[source]¶ Sample a direction close to the local direction there is a prior so that the normalised (0,1) angle of deviation a has this distribution: p(a) = 1/N * (1-c*a), where N= 1 - c/2, tmp is the inverse cdf of this.
-
sample_tube_point
(rng, r_max_scale=0.9, joint_ratio=None)[source]¶ This is skeleton node based sampling: Go to a random node, sample a random orthogonal direction go a random distance into direction (uniform over the [0, r_max_scale * local maximal radius])
-
-
class
elektronn2.data.skeleton.
Trace
(linked_skel=None, aniso_scale=2, max_cutoff=200, uturn_detection_k=40, uturn_detection_thresh=0.45, uturn_detection_hold=10, feature_count=7)[source]¶ Bases:
object
Unless otherwise state all coordinates are in skeleton system (xyz) with z-axis anisotrope and all distances are in pixels (conversion to mu: 1/100)
-
avg_dist_self
¶
-
avg_dist_skel
¶
-
avg_seg_length
¶
-
max_dist_skel
¶
-
min_dist_self
¶
-
min_normed_dist_self
¶
-
runlength
¶
-