Comments (1)
Hello, thanks a lot for your message. Indeed, you are correct, this is an assumption according to the "standard swc": http://www.neuronland.org/NLMorphologyConverter/MorphologyFormats/SWC/Spec.html.
Parent samples should appear before any child samples.
According to this assumption the second file is not "standard" (see for example node 3 has as parent node 8), and therefore it is not loaded as expected.
I am aware however, that often data do not follow the correct specifications. I would be glad to modify the code to add a per-processing step to fix this issue, this step should be at the loading of the neuron. However, we are planning to integrate a proper IO library that will resolve this kind of issues (https://github.com/BlueBrain/MorphIO). If you have data that are in a non standard format I would suggest as a quick fix to use MorphIO to save the data in the "expected" format.
Example code:
import morphio
m = morphio.mut.Morphology('test2.swc')
m.write('test3.swc')
Result:
1 1 0.000000 0.000000 0.000000 0.500000 -1
2 3 0.000000 1.000000 0.000000 0.500000 1
3 3 0.000000 2.000000 0.000000 0.500000 2
4 3 0.000000 3.000000 0.000000 0.500000 3
5 3 0.000000 4.000000 0.000000 0.500000 4
6 3 0.000000 3.200000 0.500000 0.500000 4
7 3 0.000000 2.500000 0.500000 0.500000 3
8 3 0.000000 1.000000 0.000000 0.500000 1
9 3 0.000000 1.500000 1.000000 0.500000 8
10 3 0.000000 2.500000 1.300000 0.500000 9
11 3 0.000000 1.500000 2.000000 0.500000 9
from tmd.
Related Issues (13)
- Tests not runnign properly with tox
- Tutorial not running HOT 1
- Use MorphIO as IO layer HOT 2
- 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
- Persistence diagram failed/empty list for some neurons HOT 3
- 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.