neuror.zero_diameter_fixer¶
Fix zero diameters.
Note
This module is a re-implementation of: https://bbpgitlab.epfl.ch/nse/morphologyrepair/MUK/-/blob/main/apps/Fix_Zero_Diameter.cpp with sections recursion instead of point recursion
Module Attributes
The class used to store a point as a section and point ID in this section. |
Functions
|
Apply a ramp diameter between the two points. |
|
Apply a ramp diameter between the two points. |
Ensure that diameters are decreasing in downstream direction. |
|
Fix diameters between two points with valid diameters by applying a ramp. |
|
Reset the diameter to upstream_good_diameter if the current value and all child values are below threshold. |
|
|
|
|
Yield upstream points until reaching the root. |
|
Set a given diameter. |
Apply all fixes to a neurite. |
|
Fix zero diameters. |
Classes
The class used to store a point as a section and point ID in this section. |
- class neuror.zero_diameter_fixer.Point(section, point_id)¶
Bases:
tuple
The class used to store a point as a section and point ID in this section.
- neuror.zero_diameter_fixer._fix_downstream(section)[source]¶
Ensure that diameters are decreasing in downstream direction.
If the current diameter is below the threshold, change its value to the biggest value among the 1-degree children downstream diameters.
This is recursive only until a diameter above threshold is found so this fixes zero diameters that are located at the beginning of the neurite.
Fixes this:
Soma--0--0--0--1--1--1
But not this:
Soma--1--1--1--0--0--0--1--1
Note
This is a re-implementation of recursePullFix() available at https://bbpgitlab.epfl.ch/nse/morphologyrepair/MUK/-/blob/main/muk/Zero_Diameter_Fixer.cpp#L66
- Parameters:
section (morphio.Section) –
- neuror.zero_diameter_fixer._fix_in_between(section, stack, legacy)[source]¶
Fix diameters between two points with valid diameters by applying a ramp.
Note
This is a re-implementation of https://bbpgitlab.epfl.ch/nse/morphologyrepair/MUK/-/blob/main/muk/Zero_Diameter_Fixer.cpp#L162
- Parameters:
point – the current points
stack – the stack of upstream points
legacy – whether to use legacy algorithm that didn’t account for path lengths
- neuror.zero_diameter_fixer._fix_upstream(section, upstream_good_diameter)[source]¶
Reset the diameter to upstream_good_diameter if the current value and all child values are below threshold.
Note
This is a re-implementation of recursePushFix() available at https://bbpgitlab.epfl.ch/nse/morphologyrepair/MUK/-/blob/main/muk/Zero_Diameter_Fixer.cpp#L94
- Parameters:
section – the current section
upstream_good_diameter – the diameter value coming from upstream that will be used if the current diameter is not suitable
- Returns:
The current diameter if above threshold, else the smallest child value above threshold else (if no child value is above threshold) returns 0.
- Return type:
(float)