Skip to content

Proposal for morphologies

romainbrette edited this page Jan 24, 2016 · 27 revisions

Morphology are used for simulation, access and plotting. For simulation, the geometry doesn't actually matter, only the electrical properties do. For access, the Morphology class is used to return the index of the compartment. Plotting should also be dealt with by the Morphology class.

I propose 1) to clearly separate properties that are relevant for simulation (i.e. electrically relevant) from others, 2) to make geometrical and electrical properties independent (ie not compute electrical properties from geometrical properties as is done currently), the relation being dealt with by the Morphology class, depending on specific implied geometry (eg truncated cone).

Core structure and properties

A morphology is a tree, each node being a branch. Each branch is a set of compartments. For each compartment, properties are:

  1. area (to calculate transmembrane currents)

  2. volume (for diffusion)

  3. curved length

  4. resistive length (for axial currents)

  5. x,y,z coordinates of electrical midpoint

Some explanations for the last two properties (4 and 5). Since the resistance depends on intracellular resistivity, which is only specified later, we instead calculate an effective length, that is, so that resistance is intracellular resistivity divided by effective length (for a cylinder, pi * d**2/4L). This gives a quantity that has units of meter, which we call the resistive length. Then, (x,y,z) coordinates correspond to the actual coordinates of all properties such as V, Im and others, i.e., the midpoint of the compartment. It makes sense (and is simpler) to choose the midpoint of the compartment as the point that splits the resistive length in two equal parts. For a cylinder, this would simply be the geometrical midpoint, but for a truncated cone, it would be biased towards the smaller end. This way, it is very easy to calculate the resistance between two successive compartments, which is just the average resistance of the two compartments. In the same way, the resistances at the two ends of the branch are just half-resistances of the corresponding compartments.

Curved length (3) is the geometrical length of the compartment, but not the Euclidian distance between the two end points. It is rather the total length along the possibly curved compartment. It is therefore decoupled from coordinates. This will make it easier for resegmenting a tree.

We may add, for convenience, a distance properties, which is the distance from the origin of the branch to the midpoint (derived from curved length). This can be useful when setting channel properties (point to think about; we might rather want distance from the soma than from origin, for example). Alternatively, we could also have a position property, which would indicate the distance relative to the total curved length (between 0 and 1). But in all cases, all properties that are state variables of the spatial neuron are meant at the electrical point.

All these properties above are considered independent. Diameter and end point coordinates are not core properties, but depend on the specific geometry (cylinder, truncated cone, sphere). The old 'distance' (in the previous version) is only used internally for access (i.e. to determine which compartment is meant when specifying a distance). We only need distance from branch origin, not from soma origin.

The properties should not be directly modifiable by the user; rather, set at construction time.

Specific morphologies

I propose the following two basic morphologies for branches:

  • Isopotential sphere. This corresponds to the Soma class. It has zero resistive length but positive area.
  • Sequence of truncated cones. This is better than a sequence of cylinders for two reasons: it is more compatible with other tools and formats, and diameter is continuous (and so we don't have the problem of what to do with the surface at junctions). This implies that n+1 diameters are needed. A cylinder is a sequence of truncated cones and therefore can simply be a subclass.

I propose that the basic Morphology class does not have a specific geometry. This might reduce some confusions. Instead, maybe we could define a Branch class, and a morphology is plotted by recursively plotting branches. Only branches have a specific geometry. This might be cleaner. Therefore we would have:

  • Branch as the base class, no implied geometry. But it could possibly be plotted by using the coordinates, although it would just be segments, and the tree would not be connected. Or we do not define plotting methods at all.
  • Soma (isopotential sphere) inherits from Branch.
  • Sequence of truncated cones inherits from Branch (but we need a name!).
  • Cylinder inherits from truncated cones.

Alternatively, Branch is a sequence of truncated cones, and then Soma redefines the relevant methods. We probably don't need other types of geometries.

Boundary surfaces

One issue is what to do with the surface at the two ends of a cylinder or truncated cones. Physically, those should be included in the calculation of area for the two compartments. I propose to do that, and when a branch is connected, the area of the end compartment of the parent branch of and of the start compartment of the child are updated. This means that Branch must define two methods that are called when either end is connected, with argument the section area of the connecting branch.

Building morphologies

Multicompartmental soma

First of all, it should be checked that simulation does not assume that the first compartment is an isopotential soma.

One problem is to build the dendritic tree when the soma has several compartments. Then how to connect branches at different ends (or even in the middle)? In the current system, connecting a branch at the start actually means that the soma is the child of a dendrite. This could be built indeed in this way, but it might not be the most elegant solution.

Loading files

Resegmenting

Resegmenting is not difficult in the context of general geometrical parameters (area, electric length), it is more challenging for coordinates. That is, to split a compartment in two, we might divide electric length, area etc by two (does that work?). Coordinate interpolation is done independently (ie we do not enforce consistence).