Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mixed subtree processing #981

Merged
merged 87 commits into from
Apr 25, 2022
Merged

Mixed subtree processing #981

merged 87 commits into from
Apr 25, 2022

Conversation

mgeplf
Copy link
Collaborator

@mgeplf mgeplf commented Feb 16, 2022

No description provided.

neurom/features/__init__.py Outdated Show resolved Hide resolved
neurom/features/morphology.py Outdated Show resolved Hide resolved
neurom/features/morphology.py Outdated Show resolved Hide resolved
tests/features/test_get_features.py Show resolved Hide resolved
neurom/features/morphology.py Outdated Show resolved Hide resolved
@eleftherioszisis eleftherioszisis changed the title Subtree processing example [WIP] Mixed subtree processing Feb 24, 2022
Calculate the distance of the morphology points to the soma, instead to (0,0,0)
@eleftherioszisis eleftherioszisis force-pushed the zisis/heterogeneous-neurites branch from 835ac4e to 96ff8af Compare February 25, 2022 09:58
The feature throws a warning if path distances deeper than the first section
are used and handles all special cases wrt the combinations of min/max filters.
Make sholl_frequency return an empty list for a neurite_type that is not present in the morphology.
@eleftherioszisis eleftherioszisis force-pushed the zisis/heterogeneous-neurites branch from 6acd5a5 to 15782a9 Compare February 28, 2022 13:06
@eleftherioszisis eleftherioszisis self-assigned this Mar 3, 2022
@codecov-commenter
Copy link

codecov-commenter commented Mar 3, 2022

Codecov Report

Merging #981 (d427225) into master (c6d187a) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##            master      #981   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           36        36           
  Lines         2421      2505   +84     
=========================================
+ Hits          2421      2505   +84     

@eleftherioszisis eleftherioszisis force-pushed the zisis/heterogeneous-neurites branch from 0dd71a2 to f2c87d0 Compare March 10, 2022 12:31
@eleftherioszisis eleftherioszisis force-pushed the zisis/heterogeneous-neurites branch from ce410ce to f6db8be Compare March 14, 2022 12:02
…#1002)

The NeuroM deprecation warning configuration was hijacking the warnings setup in
order to enable visibility of the DeprecationWarning. This change doesn't enforce a 
warning filter configuration, but increases the stack level of the warn function to 3.

Setting it to 3 brings the warning stacl level to the __main__ (e.g. user's interactive
 shell) where the visibility of the DeprecationWarning is by default enabled.
@eleftherioszisis eleftherioszisis changed the title [WIP] Mixed subtree processing Mixed subtree processing Mar 15, 2022
@eleftherioszisis eleftherioszisis force-pushed the zisis/heterogeneous-neurites branch from 1ba9840 to 5a2d799 Compare March 16, 2022 11:09
- Refactor features to utilize the iterators and mappers as much as possible.
- Reduce the number of nested functions/closures by moving them to section features.
- neurom.features.segment_taper_rates were fixed to return signed taper rates.
@eleftherioszisis eleftherioszisis force-pushed the zisis/heterogeneous-neurites branch from 5a2d799 to 9957c7e Compare March 18, 2022 14:12
Allow passing downstream iterator_type in partition asymmetry functions
@eleftherioszisis eleftherioszisis force-pushed the zisis/heterogeneous-neurites branch from 9957c7e to 2d054bb Compare March 18, 2022 17:07
Fixes principal_direction_extent to calculate correctly the extent of the projections along the principal directions.
@eleftherioszisis eleftherioszisis force-pushed the zisis/heterogeneous-neurites branch from 800f82e to 8bba54f Compare April 16, 2022 22:13
Copy link
Collaborator Author

@mgeplf mgeplf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think one decision we should make is whether to throw a warning (w/ a way of turning it off) if it's a mixed subtree, but ppl haven't specified it.


A sub-neurite can be either the entire tree or a homogeneous downstream
sub-tree.
"""
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we want to check/error/differenciate/document what happens if there is a dendrite - axon - dendrite - axon situation?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a warning if the neurite is not an AcD

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I changed the way that identifies the subtrees so that it creates a subtree for each different type it encounters downstream, regardless if it has been added to the list. This allows to have a dendrite-axon-dendrite-axon situation, which was not possible before due to the set I was using.

neurom/core/morphology.py Outdated Show resolved Hide resolved
neurom/core/morphology.py Outdated Show resolved Hide resolved
neurom/features/__init__.py Show resolved Hide resolved
neurom/features/__init__.py Show resolved Hide resolved
neurom/features/bifurcation.py Outdated Show resolved Hide resolved
neurom/features/morphology.py Show resolved Hide resolved
sections = filter(is_type(neurite_type), morph)
else:
if use_subtrees:
sections = iter_sections(morph, section_filter=is_type(neurite_type))
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we drop that, do any of the tests fail? I'd consider removing it if not?

@eleftherioszisis eleftherioszisis force-pushed the zisis/heterogeneous-neurites branch from 8ebcbec to d427225 Compare April 25, 2022 08:30
Copy link
Contributor

@eleftherioszisis eleftherioszisis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rebase yo

@mgeplf mgeplf changed the base branch from master to v4 April 25, 2022 13:16
@mgeplf mgeplf merged commit 57b634d into v4 Apr 25, 2022
@mgeplf mgeplf deleted the zisis/heterogeneous-neurites branch April 25, 2022 13:32
eleftherioszisis pushed a commit that referenced this pull request Jun 7, 2022
* A heterogeneous morphology consists of zero or more homogeneous and at least one heterogeneous neurite trees extending from the soma; 
* 'heterogeneous neurite trees ' is called a 'mixed subtree' for brevity
* this is a breaking change with how NeuroM<=3.x works
* this will fix #975
eleftherioszisis pushed a commit that referenced this pull request May 14, 2024
* Mixed subtree processing (#981)
* Refactor tests for test_mixed.py (#1027)
* Remove deprecated modules and functions/classes & warnings (#1026, #1032)
* Use readonly morphio Morphology by default (#979)
* Morphology level radial distance features use the soma as reference point (#1030)
* Expose subtree processing from the morph_stats api (#1034)
* Remove pyXX prefix for lint, docs, and coverage (#1038)
* Fix tutorials and add tutorial testenv (#1039)
* Add isort for formatting/linting (#1040)
* Add testing of example scripts (#1041)
* Make documentation/docstrings testable (#1035)
* Add black to neurom, format everything, and add to lint (#1042)
* Fix load_morpholgies to always resolve paths (#1047)
* allow Morphology objects to be either mut or immut (#1049)
* Replace iter_* methods by properties in core objects and improve iter_segments (#1054)
* Decouple Morphology constructor from io (#1120)
* Move soma methods to functions (#1118)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants