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

SWC reading error due to soma #213

Open
jonathanlurie opened this issue Dec 3, 2020 · 5 comments
Open

SWC reading error due to soma #213

jonathanlurie opened this issue Dec 3, 2020 · 5 comments

Comments

@jonathanlurie
Copy link

Hello,

I am having an issue parsing an SWC file and I think it's related to the soma being multipoint. The Python error I have is the following:

Traceback (most recent call last):
  File "test_morphio.py", line 11, in <module>
    m = Morphology(morph_path)
morphio._morphio.SectionBuilderError: Cannot create section with type soma

When I open the morph with my JS or custom Python parser, I can see that the soma is actually having a "star shape" and that one branch of the star is an actual section composed of the point 1, 5136 and 5137 (on the file I'll provide you by email). I admit it's a bit weird to have a soma designed like that, but to my understanding, it's still somehow compliant with the SWC pseudo-spec (very loose spec imo).

As a side note, I haven't tested all the files but on the about 100 files I have tested, this happens only once.

Best.

@mgeplf
Copy link
Contributor

mgeplf commented Dec 3, 2020

[...] soma being multipoint [...]

Do you mean that it's a contour as opposed to a set of stacked cylinders?

@jonathanlurie
Copy link
Author

jonathanlurie commented Dec 3, 2020

No, it's not a contour, it's more like that (attempt to ASCII art!):

         A
           \
          O \______ C
            /
           /
          B

On the point O you have the node with no parent, and then A and B are regular neurite sections while the section between O and C is of type soma and composed of 3 nodes. Then, after C, it continues with a regular neurite type.

@mgeplf
Copy link
Contributor

mgeplf commented Dec 3, 2020

Spec wise, it's quite hard to nail anything down, and people seem to put stuff out that isn't conformant with what little there is. For the soma; I have always referred to this: http://neuromorpho.org/SomaFormat.html as neuromorpho.org has the most clout (in a way). 4. Multiple cylinders on that page sorta describe what you have, although the split isn't in their example (ri05.swc is a single stack).

The original paper (R.C.Cannon et al.: Journal of Neuroscience Methods - 1998) with the spec says:
Screenshot 2020-12-03 at 19 25 33
So it specifically says the parent must have a lower index, but it doesn't really say anything about split somas.

What do you think @wizmer?

Nice art :)

@mgeplf
Copy link
Contributor

mgeplf commented Jan 20, 2021

Ping @wizmer

@wizmer
Copy link
Contributor

wizmer commented Jan 21, 2021

I don't think this should be allowed if we don't understand the physical meaning of such thing.
How can we make something useful of those points if we don't understand what they represent.
Are these points supposed to represent a surface as in the contour representation, a volume as in the single point soma representation ?
If we can't put a physical meaning on this representation we won't be able to compute anything with (for example, soma surface, soma volume, center of gravity...)

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

3 participants