neuror.axon¶
The axon repair module
Functions
The sum of this section and its descendents's pathlengths. |
|
Use the "mirror" technique of BlueRepairSDK to find out the similar section. |
|
|
Returns an array of sections sorted by their score. |
Returns the number of sections between the 2 sections. |
|
Axonal repair. |
- neuror.axon._downstream_pathlength(section)[source]¶
The sum of this section and its descendents’s pathlengths.
Note
This is a re-implementation of the C++ function “children_length”: https://bbpgitlab.epfl.ch/nse/morphologyrepair/BlueRepairSDK/-/blob/main/BlueRepairSDK/src/morphstats.cpp#L112
- neuror.axon._similar_section(intact_axons, section)[source]¶
Use the “mirror” technique of BlueRepairSDK to find out the similar section.
Note
This is a re-implementation of: https://bbpgitlab.epfl.ch/nse/morphologyrepair/BlueRepairSDK/-/blob/main/BlueRepairSDK/src/helper_axon.cpp#L83
Warning
I have absolutely no clue why sorting by this metric
- neuror.axon._tree_distance(sec1, sec2)[source]¶
Returns the number of sections between the 2 sections.
- Parameters:
- Returns:
The number of sections
- Return type:
- Raises:
NeuroRError – if both sections are not part of the same neurite.
Note
This is a re-implementation of: https://bbpgitlab.epfl.ch/nse/morphologyrepair/BlueRepairSDK/-/blob/main/BlueRepairSDK/src/helper_axon.cpp#L35
Note
I think the implementation of tree distance is
True
to the original but I would expect the tree distance of 2 children with the same parent to be 2 and not 1 Because in the current case,(root, child1)
and(child1, child2)
have the same tree distance and it should probably not be the case
- neuror.axon.repair(morphology, section, intact_sections, axon_branches, used_axon_branches, y_extent)[source]¶
Axonal repair.
Find the most similar section in INTACT_SECTIONS list to SECTION
Sort AXON_BRANCHES according to a similarity score to the section found at step 1
Loop through the sorted AXON_BRANCHES to find a section with same strahler orders and that, when appended, does not extend further than Y_EXTENT
Append the first section that meets the conditions of step 3)
Mark this section as used and do not re-use it
- Parameters:
morphology (Morphology) – the morphology to repair
section (neurom.core.morphology.Section) – the section to repair
intact_sections (List[Section]) – a list of all sections from this morphology that are part of an intact subtree. Note: these section won’t be grafted.
axon_branches (List[neurom.core.morphology.Section]) – a list a intact sections coming from donor morphologies. These are the sections that will be appended
Note
This is a re-implementation of: https://bbpgitlab.epfl.ch/nse/morphologyrepair/BlueRepairSDK/-/blob/main/BlueRepairSDK/src/repair.cpp#L727
The original code used to have more parameters. In the context of the bbp-morphology-workflow it seems that some of the parameters were always used with the same value. This re-implementation assumes the following BlueRepairSDK options:
--overlap=true
--incremental=false
--restrict=true
--distmethod=mirror