Comments (7)
The APL is a monster of a neuron. When I ran this code it effectively stopped at print(navis.split_axon_dendrite(on))
and started consuming obscene amounts of memory. There must be a bottleneck in the code that simply doesn't scale well. Will have a proper look and let you know. FWIW: smaller neurons should work fine.
from navis.
How big is the neuron when serialised? Might be a useful stress test case to keep around.
from navis.
This APL is ~12Mb pickled.
I've also found the culprit for the @dadanhan's problem: an inefficient path query in navis.flow_centrality
(which is called by split_axon_dendrite
. Should be able to make some improvements on that end soon.
from navis.
One day I'll fix my rust implementation of Arbor.js... I've been playing around with some linestring smoothing and simplification stuff too.
from navis.
One day I'll fix my rust implementation of Arbor.js... I've been playing around with some linestring smoothing and simplification stuff too.
Oh cool! Slightly parallel effort with what I started here: https://github.com/navis-org/fastcore
from navis.
@dadanhan I pushed a couple changes to the main branch that speed up the flow metrics functions. If you install navis
from Github your above code should go through albeit still not super fast: navis.split_axon_dendrite(on, metric='flow_centrality')
takes ~7min on my laptop... I would avoid calling it multiple times.
A note on how split_axon_dendrite
works: you can play around with the flow_thresh
parameter to improve the split. If you do that you can avoid having to re-calculate the flow every time you run the function by calculate it beforehand:
>>> # From your above example
>>> on.reroot(on.soma, inplace=True)
>>> navis.flow_centrality(on)
>>> # `on` now has a "flow_centrality" column in the node table (check e.g. `on.nodes.head()`)
>>> # Splitting now re-uses the column
>>> splits = navis.split_axon_dendrite(on, metric='flow_centrality', flow_thresh=0.9)
That way the actual navis.split_axon_dendrite
call only takes a minutes or so.
Also not sure how well this algorithm works on something like the APL with its many parallel fibres. Here's a screenshot coloured by flow centrality (navis.plot3d(on, color_by='flow_centrality', palette='viridis')
. As you can see the neurite with the highest centrality runs the entire length of the peduncle + lobes and then circles around. No clue whether that makes sense for this neuron or whether the skeleton has a messed up topology.
from navis.
Thank you Philipp!
from navis.
Related Issues (20)
- cut_skeleton memory issues HOT 2
- Minor: documentation on navis.Volume HOT 1
- Thoughts on synblast HOT 1
- Set DYLD_LIBRARY_PATH for elastix on MacOS HOT 2
- Custom colored connectors in plot2d is broken
- New numpy version leads to AttributeError HOT 5
- Traversal model make new nodes which is not in edges HOT 5
- downsample_neuron does not reassign connectors
- split_axon_dendrite fails for big neurons HOT 2
- New Feature for xform_brain: on-the-fly shortcuts for multi-transform chains
- Parquet skeletons HOT 4
- Neurons from Navis neuPrint tutorial load but without connection tables (no n_connectors) HOT 3
- Switch to pygfx? HOT 1
- igraph usage HOT 2
- disallow Dotprops for `write_swc` HOT 2
- caveclient > 5.15.2 crashes microns tutorial HOT 1
- Switch documentation to mkdocs + mkdocs material HOT 1
- Make function signatures more consistent
- New system for ultrastructural features
- Make nbl.smat.LookupNdBuilder more generic HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from navis.