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

improve strahler_index #89

Open
schlegelp opened this issue Apr 5, 2022 · 4 comments
Open

improve strahler_index #89

schlegelp opened this issue Apr 5, 2022 · 4 comments

Comments

@schlegelp
Copy link
Collaborator

Give more of a summary (perhaps split out into separate function) with e.g. cable per index, distributions, etc.

@clbarnes
Copy link
Collaborator

clbarnes commented Apr 8, 2022

Yeah, sounds like an extra function strahler_summary, which can use a neuron already populated strahler values or populates them if necessary.

@schlegelp
Copy link
Collaborator Author

I ended up writing a segment_analysis function which returns Strahler index plus a bunch of other metrics for each linear segment (see d0590cc).

>>> import navis
>>> n = navis.example_neurons(1, kind='skeleton')
>>> n.reroot(n.soma, inplace=True)
>>> sa = navis.segment_analysis(n)
>>> sa.head()
        length  tortuosity     root_dist  strahler_index
0  1073.535053    1.151022    229.448586               1
1   112.682839    1.092659  10279.037511               1
2   214.124934    1.013030   9557.521377               1
3   159.585328    1.074575   9747.866968               1
4   229.448586    1.000000      0.000000               6

I have another commit in the works that would add radius_min, radius_max, radius_mean and volume to that table. Let me know if you have ideas for more stuff to add.

@clbarnes
Copy link
Collaborator

clbarnes commented Apr 8, 2022

Maybe the node IDs at the root and leaf of each segment?

@schlegelp
Copy link
Collaborator Author

Yeah can add that too! The order is the same as n.small_segments so you could get them like this:

>>> sa['first_node'] = [seg[0] for seg in n.small_segments]
>>> sa['last_node'] = [seg[-1] for seg in n.small_segments]

Minimally, I can add that to the docstring.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants