BlueBrain / MorphIO

A python and C++ library for reading and writing neuronal morphologies
https://morphio.readthedocs.io
Apache License 2.0
26 stars 22 forks source link

How to create a morphology with mut and SomaType.SOMA_NEUROMORPHO_THREE_POINT_CYLINDERS ? #480

Closed arnaudon closed 9 months ago

arnaudon commented 9 months ago

I am trying to create a simple morphology with a 3 points soma with morphio, but it seems to not give the correct parent id assignment for the 3rd point. It should be to id 1, but it is on id 2.

jdcourcol commented 9 months ago

Just to put more context: Alexis is able to create such a morphology:

image

However, it is not compliant to the spec: " The second and third soma points, as well as all starting points (roots) of dendritic and axonal arbors have this first point as the parent (parent ID 1)." from this page: https://neuromorpho.org/SomaFormat.html referenced by morph-io: https://morphio.readthedocs.io/en/latest/specification.html#id2 for 3 points soma.

mgeplf commented 9 months ago

@arnaudon: can you make a snippet of what you are doing, so I can have a look?

The soma formats are constantly a headache because when they have 3 points, they can either be a proper (IMO) set of 2 stacked cylinders, OR the 3 point soma from neuromorpho.

Clearly, this needs to be cleaned up, regardless.

arnaudon commented 9 months ago

Yes, I noticed, I want to make a 3 point some as in neuromorpho. But probably the best is just to save a str directly, instead of creating a morphio object and somehow tell morphio it should be a 3 point neuromorpho thing

arnaudon commented 9 months ago

@jdcourcol , in fact, why do we want placeholder morph to be neuromorpho 3 points, and not 2 cylinder version?

mgeplf commented 9 months ago

in fact, why do we want placeholder morph to be neuromorpho 3 points, and not 2 cylinder version?

What about a single point; then it's just a sphere that has the nice property that its surface area is the same as a cylinder (not including the endcaps)

jdcourcol commented 9 months ago

@jdcourcol , in fact, why do we want placeholder morph to be neuromorpho 3 points, and not 2 cylinder version?

We don't want that: this is what the cell team provided to us. I want the format to be correct. Then if it a 2 cylinders soma, I am fine with it too.

arnaudon commented 9 months ago

ok, so the morph created here is a valid one with 2 cylinders, not a neuromorpho 3 points, right? https://github.com/BlueBrain/BluePyEModel/blob/main/bluepyemodel/tools/morphology.py which is the same as in your comment above, which you said is not compliant to neuromopho spec, but if it is not a neuromorpho morph, we are good, no?