Skip to content
This repository was archived by the owner on Feb 26, 2025. It is now read-only.

Revise specification documentation#294

Merged
asanin-epfl merged 3 commits intomasterfrom
spec-doc
May 7, 2021
Merged

Revise specification documentation#294
asanin-epfl merged 3 commits intomasterfrom
spec-doc

Conversation

@asanin-epfl
Copy link
Contributor

@asanin-epfl asanin-epfl commented Apr 26, 2021

This PR is based on #285 , solution to #286

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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ?

Copy link
Contributor Author

@asanin-epfl asanin-epfl Apr 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

H5v1 spec does not say anything about two-point somas. According to it, two-point soma is not something illegal.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That s true indeed but also not defined. So I guess having an undefined soma then makes sense ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
Copy link
Contributor Author

@asanin-epfl asanin-epfl Apr 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@asanin-epfl asanin-epfl requested review from mgeplf and tomdele April 26, 2021 15:11
@asanin-epfl
Copy link
Contributor Author

@tomdele , @mgeplf I've put comments for discussion, please don't review the whole PR. I've pushed it only to start a discussion.

@mgeplf
Copy link
Contributor

mgeplf commented Apr 28, 2021

Not sure I'm helping or making things more confusing.

@asanin-epfl asanin-epfl self-assigned this May 5, 2021
@asanin-epfl asanin-epfl requested review from mgeplf and tomdele and removed request for mgeplf and tomdele May 5, 2021 17:53
@asanin-epfl
Copy link
Contributor Author

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.

@tomdele
Copy link
Contributor

tomdele commented May 7, 2021

Few minors for me but looks good ! Thanks for this @asanin-epfl !

Co-authored-by: tomdele <42337286+tomdele@users.noreply.github.com>
@asanin-epfl
Copy link
Contributor Author

Thanks for making suggestions. No need to open IDE for me.

@tomdele
Copy link
Contributor

tomdele commented May 7, 2021

Thanks for making suggestions. No need to open IDE for me.

that's why I suggested :D

Copy link
Contributor

@tomdele tomdele left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me

@asanin-epfl asanin-epfl merged commit 613e4f9 into master May 7, 2021
@asanin-epfl asanin-epfl deleted the spec-doc branch May 7, 2021 08:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants