Conversation
| If a soma is made of only one point it will be treated as a "single point soma" for H5 and ASC formats. | ||
| The single point soma is represented as a sphere whose coordinate and radius are given by the soma point. | ||
| SWC interprets such soma differently. | ||
| If a soma is composed of only one point, it will be treated as a sphere with the center in this point, and the radius |
There was a problem hiding this comment.
This conflicts with single point description of http://neuromorpho.org/SomaFormat.html . There it is said: "Somata represented as a single point in the original files are also converted into the three-point representation..."(c). Here we treat single point as a sphere in all three formats ASC, H5, SWC.
There was a problem hiding this comment.
I don t know enough the format to be sure : in our morphologies + morphio do we make a difference between the single point contour and the single point ?
There was a problem hiding this comment.
H5v1 spec does not say anything about two-point somas. According to it, two-point soma is not something illegal.
There was a problem hiding this comment.
That s true indeed but also not defined. So I guess having an undefined soma then makes sense ?
There was a problem hiding this comment.
Somata represented as a single point in the original files are also converted into the three-point representation...
So this is what the neuromorph site does when it is ingesting morphologies - ie: they convert them to a 'standardised' representation.
I'm not sure whether ASC will output a single point, so we'll ignore that for now.
For H5, we should probably decide on what happens for 1 point, or 2 points, because they don't really define a contour - I think they should probably raise an exception.
There was a problem hiding this comment.
1-point and 2-point somas don't raise in H5 and ASC. An exception is only raised when .surface property is accessed. H5, ASC, SWC interpret 1-point as a sphere currently.
There was a problem hiding this comment.
I see, ok, that's really good info.
The soma fixes that @tomdele did for the hdf5 reader cleanup PR should fix the H5 version of the code. Let's open a new issues for the ASC one, so we don't forget to tackle that.
There was a problem hiding this comment.
hdf5 reader cleanup PR didn't fix the H5 version. Two-point and one-point somas are still allowed for H5 and ASC. I think it is good to keep it as is. MorphIO is a plain reader. Because ASC and H5 do not explicitly say anything about such somas, we should not think for the specs, and define something on our own. Lets keep as is.
| ************************************ | ||
| Two point Soma | ||
| ************** | ||
| Only SWC is allowed to have two point Soma. |
There was a problem hiding this comment.
ASC and H5 treat such somas as SOMA_UNDEFINED. Should they treat them differently? Should they treat them the same as they treat three points soma?
There was a problem hiding this comment.
If this is not explicitly in the specs I don t think so
| .. image:: images/swc/neuromorpho.svg | ||
| Three point Soma | ||
| **************** | ||
| Interpretation of three point soma differs among formats. |
There was a problem hiding this comment.
This conflicts with http://neuromorpho.org/SomaFormat.html. There it does not say that only SWC must implement this standard. There is no explicit mentioning of SWC vs H5 vs ASC. Should we treat such somas the same in all three formats ASC, H5, SWC?
There was a problem hiding this comment.
In these specs, only the swc is mentioned. So I am not sure we can propagated the behavior to any other formats. Or we should change the specs from the h5/asc...
There was a problem hiding this comment.
Well, the spec is vague. I don't see that it explicitly says it is only for SWC however it mentions it the most. H5 not at all, and there are 2 examples of ASC.
There was a problem hiding this comment.
Remember that H5/ASC are defining contours, and SWC is stacked cylinders - thus, three points in h5/asc makes a (strange, but valid) triangular contour.
|
Not sure I'm helping or making things more confusing. |
|
It's ready for the review. I've reflected the current behavior in the specs. This behavior might conflict with what you expected but it describes what MorphIO does. If we want to change something, like throwing an exception for two-point soma in H5, then we should do in the different PR. Here we need to finally describe how MorphIO interpret morphologies. |
|
Few minors for me but looks good ! Thanks for this @asanin-epfl ! |
Co-authored-by: tomdele <42337286+tomdele@users.noreply.github.com>
|
Thanks for making suggestions. No need to open IDE for me. |
that's why I suggested :D |
This PR is based on #285 , solution to #286