Morphology#
A morphology is the geometry of a neuron: the branching tree of cable
segments, each with a length, radius, and position in space. In braincell
this is represented by braincell.Morphology, built from
braincell.Branch segments.
A morphology is required only for multi-compartment Cell
models. Single-compartment models have no geometry.
The pieces#
Object |
Role |
|---|---|
An immutable geometric cable segment: sample points (x, y, z, radius) and the topology connecting them. Typed subclasses tag what part of the neuron a branch is. |
|
The tree of branches with parent/child connectivity. The object you
pass to |
Typed branches#
Branches carry a type so that mechanisms can target anatomically meaningful regions (“paint sodium channels on the soma”). The built-in types are:
Dendrite, withBasalDendriteandApicalDendriteCustomBranchfor anything else
These map onto the standard SWC structure identifiers, so loading an SWC file assigns types automatically.
Where morphologies come from#
You almost never type coordinates by hand. Instead you load a reconstruction:
import braincell
# from a local SWC file
morpho = braincell.Morphology.from_swc("neuron.swc")
# from a Neurolucida ASC file
morpho = braincell.Morphology.from_asc("neuron.asc")
# directly from NeuroMorpho.Org (downloaded and cached)
morpho = braincell.Morphology.from_neuromorpho("cnic_001")
See File Formats & IO for the full set of readers, reader options, and validation reports.
Inspecting and visualizing#
Once loaded, a morphology can be explored and rendered:
import braincell.vis as vis
vis.plot2d(morpho) # 2-D dendrogram / tree layout (matplotlib)
vis.plot3d(morpho) # 3-D rendering (PyVista or Plotly)
The braincell.vis layer also provides morphometry plots (Sholl analysis,
branch-order histograms, topology) — see the braincell.vis module reference.
The mutable analysis tree (braincell.morph)#
braincell.Morphology is the immutable object you simulate. For
programmatic construction and analysis there is a richer, mutable tree in
braincell.morph:
MorphoBranch/MorphoEdge— editable branch and edge views.MorphoMetric— a whole-morphology metric snapshot (total length, surface area, branch counts, …).
Use braincell.morph when you need to modify or measure a
reconstruction; use Morphology when you are ready to build a
cell.
See also#
Discretization — how the continuous geometry becomes control volumes.
Regions & Locsets — selecting parts of a morphology to decorate.
File Formats & IO — loading and saving morphologies.