-
Notifications
You must be signed in to change notification settings - Fork 22
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
Move NeuroM morphology specs to MorphIO #313
Conversation
doc/source/specification.rst
Outdated
------- | ||
|
||
A section is a series of one or more segments. Each section has a type associated with it. The type shows what part of | ||
the neuron a section represents. The type can be the axon, the soma, and so on. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we put here the real list of sectiontypes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
doc/source/specification.rst
Outdated
3. forking point, forking point | ||
4. starting point, end point | ||
|
||
Starting point is the first point of a section without parent. Forking point is the last point of a section that has |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would move this paragraph before the bullet point, so we know what the different points represent before we read it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitions go immediately after their usage. Putting them before, breaks the narration.
doc/source/specification.rst
Outdated
Neurite | ||
------- | ||
|
||
A neurite is essentially a tree of sections(`Section`_). The tree structure implies the following: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A neurite is essentially a tree of sections(`Section`_). The tree structure implies the following: | |
A neurite is a tree of sections(`Section`_). The tree structure implies the following: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. It is funny that I took the phrase from NeuroM docs.
doc/source/specification.rst
Outdated
the file. In the NRN simulator, the soma which is considered as a section (contrary to MorphIO) | ||
is placed first and then neurites are sorted according to their type. | ||
|
||
The final order is the following: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
final in what sense? In neuron ordering?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
doc/source/specification.rst
Outdated
In MorphIO each section is identified by an ID. By default, the section IDs will correspond to | ||
the order of section appearance while performing a depth-first traversal on every neurites. The | ||
neurite order is the order of appearance in the file. Alternatively, the NRN simulator way of | ||
ordering section can be used by specifying the flag ``morphio::Option::NRN_ID`` when opening |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I use this: options=morphio.Option.nrn_order
, is it the same as NRN_ID?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NRN_ID is a typo. Fixing this. Thank you.
doc/source/specification.rst
Outdated
*********************************** | ||
Prior to version 3.0.0, when a section had a single child section (aka unifurcation), the child section would be merged | ||
with its parent when reading or writing the file. Since version 3.0.0, merging does not happen when reading. Yet | ||
writing of such sections is not allowed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you point to remove_unifurcation
method? If you try to save, what happens, this is called? I'm not sure I tried to save with unifurcations, but I find this weird that we cannot save these as they are.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
I am checking now |
Section ordering | ||
**************** | ||
In MorphIO each section is identified by an ID. By default, the section IDs will correspond to | ||
the order of section appearance while performing a depth-first traversal on every neurites. The |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure we a have a stability guaranty with DFS. Isn't the DFS a consequence of the file formats (specially for swc or ascii) ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is DFS? Depth-first-...? I agree that this statement is wrong. I bluntly copied it from NeuroM. I need to edit it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Depth-first-search sorry
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because it depends on the ordering of the neighbors and so it depends on the graph / tree underlying implementation and/or the nodes / edges insertion.
Most extreme case: if you are using something like a adjacency sets (with unordered set) you cannot guaranty a stable iterator on the tree/graph.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please help me with clarification on this. I'm lost in the sources of MorphIO.
Should I just delete this paragraph on section ordering?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this is tricky ...
The section ids are format dependent.
- For the swc this is indeed a DFS and the sections ids are ordered using the placement of the sample inside the file. So the first neighbor is the first sample found in the file (no matter the sample id).
- For the ascii same DFS and ordered via the placement inside the file of each sections.
- For the h5 it depends on the section ordering inside the file. The sections exist already we just read them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so, I'm putting this into docs? Would it be ok for you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol actually after thinking about it and having a better understanding, I think the doc is correct...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
XD, should I put something like "verified by Tom" among the lines?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"TomDele seal of approval".
Co-authored-by: tomdele <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok after checking I think this is quite ok !
Thanks for this @asanin-epfl
Thank you for the thorough review! |
That was harder than expected for me :D |
Not finished. Still need to make two svg images.Move specs about Point, Segment, Section, Neurite from NeuroM to MorphIO.
Solution to #312