0.1.8
A morphology is the data representation of a neurone's anatomy. It is composed of one soma (cell body) and sections. Sections can be axons, dendrites, etc. A Morphology instance can be built from scratch (though it can be a bit tedious) but will generally be built using a JSON description.
Build a morphology from a raw dataset, that usually comes from a JSON file.
Note that some files do not provide any data about the soma. In this case, the Soma
instance remains null
(Object)
a flat tree description of a morphology
A section is a list of 3D points and some metadata. A section can have one parent and multiple children when the dendrite or axone divide into mutliple dendrites and axons. A section instance can be built from scratch of it can be built using a raw object, usually from a JSON description.
To construct a section, we need a reference to the morphology instance that 'hosts' them. This may seem a bit a bit counter intuitive to have a reference in that direction but it can be very convenient, when knowing a section, to know to which morphology it belongs (i.e. raycasting a section)
(Morphology
= null
)
the Morphology instance that host
this
section
Defines the id of this seciton.
Note: should probably not be used after initWithRawSection
because then
sections already have ids and chance to messup the id game are pretty high.
Get the id of this section
(String | Number)
:
Define the typename, like in the SWC spec. Must be one of:
(String)
the typename
Get the typename as a String
String
:
Defnies the typevalue, which is the integer that goes in pair with the type name. According to SWC spec. Must be one of:
(Number)
the type value
Get the type value
Number
:
Add a point to this current section
Get all the points of this section as an array
Array
:
each element are of form
[x: Number, y: Number, y: Number]
Get all the radiuses of the point in this section
Array
:
Build a section using a raw section object.
(Object)
usually comes from a JSON file
Define the parent section of this section, as an object reference. The only verification perfomed by this method is that a section is not added as its own parent.
(Section)
the section that is the parent of this one
Boolean
:
true if parent was successfully defined, false if not.
Get the parent section of this section
Section
:
the parent
Make a given section the child of this one. Two verifications are perfomed before: ids must be diferent so that we are not allowing a section to be the child of itself, and that this section does not already have the given section as a children (=> avoid doublons)
(Section)
The section to add as a child
Boolean
:
true if successfully added (of if already has the given child),
false if the candidate cannot be a child
Checks if a given section is already one of the children of this section
(Section)
a section to test
Boolean
:
true if the given section is already a child of
this
section, false if not.
Get the size of this section
Number
:
Get the morphology object that contains this section
Morphology
:
Get all the children as an Array
Array
:
The soma is the cell body of a neurone and thus is sort of a simplified version of a Section, in term of datastructure. A soma can be made of a single point (then it's just a center point) or of several, then it's a more accurate description of a soma. When described with several points, the representation is usually as a 2D polygon (even though it's in a 3D space)
Return the center of the soma. If the soma is made of a single point and a radius, this method returns the single point. If the soma is made of several points, this method returns the average.
(Array | null)
:
coordinate of the center as
[x: Number, y: Number, z: Number]