neurom.check.morphology_checks¶
NeuroM morphology checking functions.
Contains functions for checking validity of morphology neurites and somata.
Functions
|
Check presence of neurite points with radius not above threshold. |
|
Check presence of morphology sections with length not above threshold. |
|
Check presence of morphology segments with length not above threshold. |
|
Check if a morphology has apical dendrites. |
|
Check if a morphology has an axon. |
|
Check if a morphology has basal dendrites. |
|
Check if a section has more than 3 children. |
|
Check if the morphology has sections with back-tracks. |
|
Check if the morphology has dangling neurites. |
|
Check if leaf points are too large. |
|
Check that a morphology has no flat neurites. |
|
Check if there are jumps (large movements in the axis). |
|
Check if the morphology has dendrites with narrow sections. |
|
Check if neurites have a narrow start. |
|
Check if the morphology has overlapping points. |
|
Check that the neurites have no root node jumps. |
|
Check if the morphology has sections with only one child section. |
|
Check if soma radius not above threshold. |
|
Check if a section has 1 child. |
- neurom.check.morphology_checks.has_all_nonzero_neurite_radii(morph, threshold=0.0)¶
Check presence of neurite points with radius not above threshold.
- Parameters:
morph (Morphology) – the morphology to test
threshold (float) – value above which a radius is considered to be non-zero
- Returns:
CheckResult with result including list of (section ID, point ID) pairs of zero-radius points
- neurom.check.morphology_checks.has_all_nonzero_section_lengths(morph, threshold=0.0)¶
Check presence of morphology sections with length not above threshold.
- Parameters:
morph (Morphology) – the morphology to test
threshold (float) – value above which a section length is considered to be non-zero
- Returns:
CheckResult with result including list of ids of bad sections
- neurom.check.morphology_checks.has_all_nonzero_segment_lengths(morph, threshold=0.0)¶
Check presence of morphology segments with length not above threshold.
- Parameters:
morph (Morphology) – the morphology to test
threshold (float) – value above which a segment length is considered to be non-zero
- Returns:
CheckResult with result including list of (section_id, segment_id) of zero length segments
- neurom.check.morphology_checks.has_apical_dendrite(morph, min_number=1, treefun=<function _read_neurite_type>)¶
Check if a morphology has apical dendrites.
- Parameters:
morph (Morphology) – the morphology to test
min_number – minimum number of apical dendrites required
treefun – optional function to calculate the tree type of morphology’s neurites
- Returns:
CheckResult with result
- neurom.check.morphology_checks.has_axon(morph, treefun=<function _read_neurite_type>)¶
Check if a morphology has an axon.
- Parameters:
morph (Morphology) – The morphology object to test
treefun – Optional function to calculate the tree type of morphology’s neurites
- Returns:
CheckResult with result
- neurom.check.morphology_checks.has_basal_dendrite(morph, min_number=1, treefun=<function _read_neurite_type>)¶
Check if a morphology has basal dendrites.
- Parameters:
morph (Morphology) – The morphology object to test
min_number – minimum number of basal dendrites required
treefun – Optional function to calculate the tree type of morphology’s neurites
- Returns:
CheckResult with result
- neurom.check.morphology_checks.has_multifurcation(morph)¶
Check if a section has more than 3 children.
- neurom.check.morphology_checks.has_no_back_tracking(morph)¶
Check if the morphology has sections with back-tracks.
- neurom.check.morphology_checks.has_no_dangling_branch(morph)¶
Check if the morphology has dangling neurites.
Are considered dangling
dendrites whose first point is too far from the soma center
axons whose first point is too far from the soma center AND from any point belonging to a dendrite
- Parameters:
morph (Morphology) – the morphology to test
- Returns:
CheckResult with a list of all first segments of dangling neurites
- neurom.check.morphology_checks.has_no_fat_ends(morph, multiple_of_mean=2.0, final_point_count=5)¶
Check if leaf points are too large.
- Parameters:
morph (Morphology) – the morphology to test
multiple_of_mean (float) – how many times larger the final radius has to be compared to the mean of the final points
final_point_count (int) – how many points to include in the mean
- Returns:
CheckResult with a list of all ids of bad sections
Note
A fat end is defined as a leaf segment whose last point is larger by a factor of multiple_of_mean than the mean of the points in final_point_count
- neurom.check.morphology_checks.has_no_flat_neurites(morph, tol=0.1, method='ratio')¶
Check that a morphology has no flat neurites.
- Parameters:
morph (Morphology) – The morphology object to test
tol (float) – tolerance
method (str) – way of determining flatness, ‘tolerance’, ‘ratio’ as described in
neurom.check.morphtree.get_flat_neurites()
- Returns:
CheckResult with result
- neurom.check.morphology_checks.has_no_jumps(morph, max_distance=30.0, axis='z')¶
Check if there are jumps (large movements in the axis).
- Parameters:
morph (Morphology) – the morphology to test
max_distance (float) – value above which consecutive z-values are considered a jump
axis (str) – one of x/y/z, which axis to check for jumps
- Returns:
CheckResult with result list of ids of bad sections
- neurom.check.morphology_checks.has_no_narrow_neurite_section(morph, neurite_filter, radius_threshold=0.05, considered_section_min_length=50)¶
Check if the morphology has dendrites with narrow sections.
- Parameters:
morph (Morphology) – the morphology to test
neurite_filter (Callable) – filter the neurites by this callable
radius_threshold (float) – radii below this are considered narro
considered_section_min_length (float) – sections with length below this are not taken into account
- Returns:
CheckResult with result. result.info contains the narrow section ids and their first point
- neurom.check.morphology_checks.has_no_narrow_start(morph, frac=0.9)¶
Check if neurites have a narrow start.
- Parameters:
morph (Morphology) – the morphology to test
frac (float) – Ratio that the second point must be smaller than the first
- Returns:
CheckResult with a list of all first segments of neurites with a narrow start
- neurom.check.morphology_checks.has_no_overlapping_point(morph, tolerance=None)¶
Check if the morphology has overlapping points.
- Returns:
CheckResult with result. result.info contains a tuple with the two overlapping section ids and a list containing only the first overlapping points.
- neurom.check.morphology_checks.has_no_root_node_jumps(morph, radius_multiplier=2)¶
Check that the neurites have no root node jumps.
Their first point not should not be further than radius_multiplier * soma radius from the soma center
- neurom.check.morphology_checks.has_no_single_children(morph)¶
Check if the morphology has sections with only one child section.
- neurom.check.morphology_checks.has_nonzero_soma_radius(morph, threshold=0.0)¶
Check if soma radius not above threshold.
- Parameters:
morph (Morphology) – the morphology to test
threshold – value above which the soma radius is considered to be non-zero
- Returns:
CheckResult with result
- neurom.check.morphology_checks.has_unifurcation(neuron)¶
Check if a section has 1 child.