Comments (3)
Hi and thanks for opening an issue. Could you please provide an SWC file example to reproduce the error?
from tmd.
Hi:
Thanks for the response!
I've figured out the 0-length issue (some neurites are stored as type=0 in the SWCs so they are not read correctly when I specify dendrite_type = 'basal_dendrite'), so we're good with that. But unfortunately there are still some files that have "key error" issue.
Please see the attached example. I converted it to .txt format since .swc is not supported by Github, you may need to change it back.
By looking into this example, the get_ph_neuron() method first get a dictionary called ‘parents’, which is a dictionary of {children:parent} pairs, and use birth and death time to get the p-diagram, after the first round of iteration over the active nodes, a parent node is added to the active list, which is not a key in the ‘parents’ dictionary, thus throw the key error.
For example, for the 5th dendrite:
- The parent dictionary of the 5th dendrite extracted is: {1: 0, 4: 1, 10: 4, 33: 10, 92: 10, 131: 4, 139: 1, 195: 139, 202: 140}
- The active nodes in the first iteration are: [33, 92, 131, 195, 202], they all have keys in the parent dictionary
- The active nodes in the second iteration are: [4, 139, 140], while 140 is not a key in the parent dictionary, which creates the error
Please let me know if you have any thoughts on this. Thank you very much!
Best,
Ming
example_swc_failed_getPH_neuron.txt
from tmd.
Hi Ming,
Thanks for reporting this issue.
I checked your data and I see where it breaks. It looks like one of the sections connects to the wrong place.
I suggest that you use the following way to load your files and I will check again later what goes wrong in the main loader.
neuron = tmd.io.load_neuron_from_morphio('example_swc_failed_getPH_neuron.swc')
This extracts the persistence diagrams correctly
from tmd.
Related Issues (13)
- Tests not runnign properly with tox
- Tutorial not running HOT 1
- Use MorphIO as IO layer HOT 2
- Node labeling affects persistence diagram outcome HOT 1
- Unable to load morphologies downloaded BBP EPFL project. HOT 3
- ERROR: Package 'tmd' requires a different Python: 2.7.12 not in '>=3.6' HOT 3
- Setting xlim on plot.persistence_image HOT 1
- KeyError for a neuron while computing persistence diagram HOT 3
- Simplify kwargs in plotting
- Make xlim and xlims consistent in plotting functions
- When using TMD is the module case sensitive to swc, asc and h5 file types? HOT 2
- How to resolve SomaError
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 tmd.