From c078fcea37d2b61bbdd38c673edf7acdc358f1cc Mon Sep 17 00:00:00 2001 From: Nora Abi Akar <nora.abiakar@gmail.com> Date: Fri, 15 Jan 2021 11:58:57 +0100 Subject: [PATCH] center -> centre/midpoint (#1311) --- arborio/swcio.cpp | 4 ++-- doc/concepts/labels.rst | 2 +- doc/concepts/morphology.rst | 14 +++++++------- doc/concepts/recipe.rst | 2 +- doc/math/model/formulation.tex | 4 ++-- doc/python/morphology.rst | 8 ++++---- doc/tutorial/single_cell_recipe.rst | 10 +++++----- example/lfp/neuron_lfp_example.py | 6 +++--- python/morphology.cpp | 8 ++++---- 9 files changed, 29 insertions(+), 29 deletions(-) diff --git a/arborio/swcio.cpp b/arborio/swcio.cpp index abb72967..69fa7833 100644 --- a/arborio/swcio.cpp +++ b/arborio/swcio.cpp @@ -303,7 +303,7 @@ arb::morphology load_swc_neuron(const swc_data& data) { {soma_prox.x, soma_prox.y + soma_prox.r, soma_prox.z, soma_prox.r}, soma_tag); return tree; } - // Model the soma as a 2 cylinders with total length=2*radius, extended along the y axis, centered at the sample + // Model the soma as a 2 cylinders with total length=2*radius, extended along the y axis, centred at the sample auto p = tree.append(arb::mnpos, {soma_prox.x, soma_prox.y - soma_prox.r, soma_prox.z, soma_prox.r}, {soma_prox.x, soma_prox.y, soma_prox.z, soma_prox.r}, soma_tag); tree.append(p, {soma_prox.x, soma_prox.y, soma_prox.z, soma_prox.r}, @@ -459,7 +459,7 @@ arb::morphology load_swc_allen(const swc_data& data, bool no_gaps) { if (r.tag > 4) throw swc_unsupported_tag{r.id}; } - // Translate the morphology so that the soma is centered at the origin (0,0,0) + // Translate the morphology so that the soma is centred at the origin (0,0,0) arb::mpoint sloc{records[0].x, records[0].y, records[0].z, records[0].r}; for (auto& r: records) { r.x -= sloc.x; diff --git a/doc/concepts/labels.rst b/doc/concepts/labels.rst index 62acfb13..cd6a394f 100644 --- a/doc/concepts/labels.rst +++ b/doc/concepts/labels.rst @@ -53,7 +53,7 @@ Label types Possible locsets might refer to: -* The center of the soma. +* The centre of the soma. * The locations of inhibitory synapses. * The tips of the dendritic tree. diff --git a/doc/concepts/morphology.rst b/doc/concepts/morphology.rst index b4b53a19..a72f053e 100644 --- a/doc/concepts/morphology.rst +++ b/doc/concepts/morphology.rst @@ -32,16 +32,16 @@ proper definition for a morphology. :align: center **Field**, **Type**, **Description** - ``x``, real, x coordinate of center of cable (μm). - ``y``, real, y coordinate of center of cable (μm). - ``z``, real, z coordinate of center of cable (μm). + ``x``, real, x coordinate of centre of cable (μm). + ``y``, real, y coordinate of centre of cable (μm). + ``z``, real, z coordinate of centre of cable (μm). ``radius``, real, cross sectional radius of cable (μm). .. glossary:: segment msegment - A segment is a frustum (cylinder or truncated cone), with the center and radius at each + A segment is a frustum (cylinder or truncated cone), with the centre and radius at each end defined by a pair of :term:`points <mpoint>`. In other words, in Arbor the radius between two points is interpolated linearly, resulting in either a cylinder (equal radii) or truncated cone (differing radii), centred at the line through the pair of points. @@ -51,8 +51,8 @@ proper definition for a morphology. :align: center **Field**, **Type**, **Description** - ``prox``, :term:`mpoint`, the center and radius of the proximal end. - ``dist``, :term:`mpoint`, the center and radius of the distal end. + ``prox``, :term:`mpoint`, the centre and radius of the proximal end. + ``dist``, :term:`mpoint`, the centre and radius of the distal end. ``tag``, integer, ":term:`tag` meta-data, can be used to classify segments of the same kind (ex: soma, dendrite, but also arbitrary use-defined groups" .. figure:: ../gen-images/term_segments.svg @@ -677,7 +677,7 @@ Samples with the soma as a parent start new segments, that connect to the distal or to the proximal end of the soma if they are axons or apical dendrites. Only axons, dendrites and apical dendrites (tags 2, 3 and 4 respectively) are allowed in this interpretation, in addition to the spherical soma. -Finally the Allen institute interpretation of SWC files centers the morphology around the soma at the origin (0, 0, 0) +Finally the Allen institute interpretation of SWC files centres the morphology around the soma at the origin (0, 0, 0) and all samples are translated in space towards the origin. NEURON interpretation: diff --git a/doc/concepts/recipe.rst b/doc/concepts/recipe.rst index 3883309f..95250eed 100644 --- a/doc/concepts/recipe.rst +++ b/doc/concepts/recipe.rst @@ -100,7 +100,7 @@ runtime execution environment. During model building, the recipe is queried first by a load balancer, then later when building the low-level cell groups and communication network. -The cell-centered recipe interface, whereby cell and network properties are +The cell-centred recipe interface, whereby cell and network properties are specified "per-cell", facilitates this. The steps of building a simulation from a recipe are: diff --git a/doc/math/model/formulation.tex b/doc/math/model/formulation.tex index d3eba7a6..8db5184e 100644 --- a/doc/math/model/formulation.tex +++ b/doc/math/model/formulation.tex @@ -275,7 +275,7 @@ Furthermore, because $\alpha_{i,j} > 0$, the linear system is diagonally dominan \subsubsection{The Soma} %------------------------------------------------------------------------------- We model the soma as a sphere with a centre $\vv{x}_s$ and a radius $r_s$. -The soma is conceptually treated as the center of the cell: the point from which all other parts of the cell branch. +The soma is conceptually treated as the centre of the cell: the point from which all other parts of the cell branch. It requires special treatment, because of its size relative to the radius of the dendrites and axons that branch off from it. Though the soma is usually visualized as a sphere, it is \emph{worth noting} that Neuron models the soma as a cylinder @@ -306,7 +306,7 @@ This effectivly of ``collapses'' the node that defines the start of dendrites at This requires a little slight of hand when loading the cell description from file (for example a \verb!.swc! file). In such file formats there would be 5 points used to describe the cell in \fig{fig:soma}: \begin{itemize} - \item 1 to describe the center of the soma. + \item 1 to describe the centre of the soma. \item 2 for each dendrite: 1 describing where the dendrite is attached to the soma, and 1 for the terminal end. \end{itemize} However, in the mathematical formulation there are only 3 values that are solved for: the soma and one for each of the dendrites. diff --git a/doc/python/morphology.rst b/doc/python/morphology.rst index 1dc0d913..ef9eabb5 100644 --- a/doc/python/morphology.rst +++ b/doc/python/morphology.rst @@ -375,8 +375,8 @@ Cell morphology Loads the :class:`morphology` from an SWC file according to the AllenDB and Sonata's SWC specifications. Specifically: - * The first sample (the root) is treated as the center of the soma. - * The morphology is translated such that the soma is centered at (0,0,0). + * The first sample (the root) is treated as the centre of the soma. + * The morphology is translated such that the soma is centred at (0,0,0). * The first sample has tag 1 (soma). * All other samples have tags 2, 3 or 4 (axon, apic and dend respectively) @@ -385,14 +385,14 @@ Cell morphology used to enforce this requirement. Arbor does not support modelling the soma as a sphere, so a cylinder with length - equal to the soma diameter is used. The cylinder is centered on the origin, and + equal to the soma diameter is used. The cylinder is centred on the origin, and aligned along the z axis. Axons and apical dendrites are attached to the proximal end of the cylinder, and dendrites to the distal end, with a gap between the start of each branch and the end of the soma cylinder to which it is attached. :param str filename: the name of the SWC file. - :param bool no_gaps: enforce that distance between soma center and branches attached to soma is the soma radius. + :param bool no_gaps: enforce that distance between soma centre and branches attached to soma is the soma radius. :rtype: morphology .. py:class:: place_pwlin diff --git a/doc/tutorial/single_cell_recipe.rst b/doc/tutorial/single_cell_recipe.rst index dc1f7e7b..b806c07a 100644 --- a/doc/tutorial/single_cell_recipe.rst +++ b/doc/tutorial/single_cell_recipe.rst @@ -29,16 +29,16 @@ We can immediately paste the cell description code from the tree = arbor.segment_tree() tree.append(arbor.mnpos, arbor.mpoint(-3, 0, 0, 3), arbor.mpoint(3, 0, 0, 3), tag=1) - # (2) Define the soma and its center + # (2) Define the soma and its midpoint labels = arbor.label_dict({'soma': '(tag 1)', - 'center': '(location 0 0.5)'}) + 'midpoint': '(location 0 0.5)'}) # (3) Create cell and set properties decor = arbor.decor() decor.set_property(Vm=-40) decor.paint('"soma"', 'hh') - decor.place('"center"', arbor.iclamp( 10, 2, 0.8)) - decor.place('"center"', arbor.spike_detector(-10)) + decor.place('"midpoint"', arbor.iclamp( 10, 2, 0.8)) + decor.place('"midpoint"', arbor.spike_detector(-10)) cell = arbor.cable_cell(tree, labels, decor) The recipe @@ -123,7 +123,7 @@ Step **(4.7)** returns the properties that will be applied to all cells of that More methods can be overridden if your model requires that, see :class:`arbor.recipe` for options. -Step **(5)** instantiates the recipe with the cable cell described earlier, and a single voltage probe located at "center". +Step **(5)** instantiates the recipe with the cable cell described earlier, and a single voltage probe located at "midpoint". The context and domain decomposition ------------------------------------ diff --git a/example/lfp/neuron_lfp_example.py b/example/lfp/neuron_lfp_example.py index 1d1023ac..c3db1fda 100755 --- a/example/lfp/neuron_lfp_example.py +++ b/example/lfp/neuron_lfp_example.py @@ -13,7 +13,7 @@ import numpy as np class Cell: """ - Cell class that handles interactions with NEURON. It finds the center position + Cell class that handles interactions with NEURON. It finds the centre position of each cellular compartment (cell.xmid, cell.ymid, cell.zmid), and the transmembrane currents cell.imem """ @@ -186,7 +186,7 @@ class Cell: self.yend = yendvec self.zend = zendvec - # Calculates the center position of each compartment (segment) + # Calculates the centre position of each compartment (segment) self.xmid = 0.5 * (self.xstart + self.xend) self.ymid = 0.5 * (self.ystart + self.yend) self.zmid = 0.5 * (self.zstart + self.zend) @@ -233,7 +233,7 @@ class ExtElectrode: Calculates 'mapping' of size (number of electrodes) * (number of cell compartments) Extracellular potential can then be calculated as :param cell: class containing x,y,z-positions (um) of each - compartment (segment) center as cell.xmid, cell.ymid, cell.zmid + compartment (segment) centre as cell.xmid, cell.ymid, cell.zmid """ self.mapping = np.zeros((self.num_elecs, cell.totnsegs)) diff --git a/python/morphology.cpp b/python/morphology.cpp index fb999543..06100d9f 100644 --- a/python/morphology.cpp +++ b/python/morphology.cpp @@ -77,7 +77,7 @@ void register_morphology(py::module& m) { .def_readonly("y", &arb::mpoint::y, "Y coordinate [μm].") .def_readonly("z", &arb::mpoint::z, "Z coordinate [μm].") .def_readonly("radius", &arb::mpoint::radius, - "Radius of cable at sample location centered at coordinates [μm].") + "Radius of cable at sample location centred at coordinates [μm].") .def(py::self==py::self) .def("__str__", [](const arb::mpoint& p) { @@ -281,8 +281,8 @@ void register_morphology(py::module& m) { "filename"_a, "no_gaps"_a=false, "Generate a morphology from an SWC file following the rules prescribed by AllenDB\n" " and Sonata. Specifically:\n" - "* The first sample (the root) is treated as the center of the soma.\n" - "* The first morphology is translated such that the soma is centered at (0,0,0).\n" + "* The first sample (the root) is treated as the centre of the soma.\n" + "* The first morphology is translated such that the soma is centred at (0,0,0).\n" "* The first sample has tag 1 (soma).\n" "* All other samples have tags 2, 3 or 4 (axon, apic and dend respectively)\n" "SONATA prescribes that there should be no gaps, however the models in AllenDB\n" @@ -290,7 +290,7 @@ void register_morphology(py::module& m) { "used to enforce this requirement.\n" "\n" "Arbor does not support modelling the soma as a sphere, so a cylinder with length\n" - "equal to the soma diameter is used. The cylinder is centered on the origin, and\n" + "equal to the soma diameter is used. The cylinder is centred on the origin, and\n" "aligned along the z axis.\n" "Axons and apical dendrites are attached to the proximal end of the cylinder, and\n" "dendrites to the distal end, with a gap between the start of each branch and the\n" -- GitLab