MOOSE - Multiscale Object Oriented Simulation Environment
|
#include <NeuroNode.h>
Public Member Functions | |
void | addChild (unsigned int child) |
double | calculateLength (const CylBase &parent) |
const vector< unsigned int > & | children () const |
void | clearChildren () |
Id | elecCompt () const |
void | findConnectedCompartments (const map< Id, unsigned int > &nodeMap, const vector< NeuroNode > &nodes) |
void | innerTraverse (vector< NeuroNode > &tree, const vector< NeuroNode > &nodes, vector< unsigned int > &seen) const |
bool | isDummyNode () const |
bool | isSphere () const |
bool | isStartNode () const |
NeuroNode (const CylBase &cb, unsigned int parent, const vector< unsigned int > &children, unsigned int startFid_, Id elecCompt, bool isSphere) | |
NeuroNode (Id elecCompt) | |
NeuroNode () | |
unsigned int | parent () const |
void | setParent (unsigned int parent) |
void | setParentAndChildren (unsigned int index, int dendParent, vector< NeuroNode > &nodes, const unordered_map< Id, unsigned int > &dendMap) |
void | setStartFid (unsigned int f) |
unsigned int | startFid () const |
![]() | |
CylBase (double x, double y, double z, double dia, double length, unsigned int numDivs) | |
CylBase () | |
vector< double > | getCoordinates (const CylBase &parent, unsigned int entry) const |
double | getDia () const |
double | getDiffusionArea (const CylBase &parent, unsigned int index) const |
bool | getIsCylinder () const |
double | getLength () const |
double | getMiddleArea (const CylBase &parent, unsigned int index) const |
Return cross-section area of middle of specified voxel. More... | |
unsigned int | getNumDivs () const |
double | getVoxelLength () const |
Return length of voxel. All are equal. More... | |
double | getX () const |
double | getY () const |
double | getZ () const |
void | matchCubeMeshEntries (const ChemCompt *other, const CylBase &parent, unsigned int startIndex, double granularity, vector< VoxelJunction > &ret, bool useCylinderCurve, bool useCylinderCap) const |
double | nearest (double x, double y, double z, const CylBase &parent, double &linePos, double &r) const |
double | nearest (double x, double y, double z, const CylBase &parent, unsigned int &index) const |
double | selectGridSize (double h, double dia1, double granularity) const |
void | setDia (double v) |
void | setIsCylinder (bool v) |
void | setLength (double v) |
void | setNumDivs (unsigned int v) |
void | setX (double v) |
void | setY (double v) |
void | setZ (double v) |
double | volume (const CylBase &parent) const |
Returns vol of current node. Usually needs to refer to parent. More... | |
double | voxelVolume (const CylBase &parent, unsigned int fid) const |
Static Public Member Functions | |
static void | buildSpinyTree (vector< ObjId > &elist, vector< NeuroNode > &nodes, vector< Id > &shaftId, vector< Id > &headId, vector< unsigned int > &spineParent) |
static void | buildTree (vector< NeuroNode > &nodes, vector< ObjId > elist) |
static void | filterSpines (vector< NeuroNode > &nodes, vector< Id > &shaftId, vector< Id > &headId, vector< unsigned int > &parent) |
static unsigned int | findStartNode (const vector< NeuroNode > &nodes) |
static unsigned int | removeDisconnectedNodes (vector< NeuroNode > &nodes) |
static void | traverse (vector< NeuroNode > &nodes, unsigned int start) |
Private Attributes | |
vector< unsigned int > | children_ |
Id | elecCompt_ |
Id of electrical compartment in which this diffusive compt lives. More... | |
bool | isSphere_ |
unsigned int | parent_ |
unsigned int | startFid_ |
Helper class for the NeuroMesh. Defines the geometry of the branching neuron.
Definition at line 18 of file NeuroNode.h.
NeuroNode::NeuroNode | ( | const CylBase & | cb, |
unsigned int | parent, | ||
const vector< unsigned int > & | children, | ||
unsigned int | startFid, | ||
Id | elecCompt, | ||
bool | isSphere | ||
) |
This function explicitly fills in all fields of the NeuroNode
Helper class for the NeuroMesh. Defines the geometry of the branching neuron.
Definition at line 28 of file NeuroNode.cpp.
NeuroNode::NeuroNode | ( | Id | elecCompt | ) |
This builds the node using info from the compartment. But the parent and children have to be filled in later
Definition at line 41 of file NeuroNode.cpp.
References Field< A >::get(), CylBase::setDia(), CylBase::setLength(), CylBase::setX(), CylBase::setY(), and CylBase::setZ().
NeuroNode::NeuroNode | ( | ) |
Empty constructor for vectors
Definition at line 61 of file NeuroNode.cpp.
void NeuroNode::addChild | ( | unsigned int | child | ) |
Fills in child vector
Definition at line 101 of file NeuroNode.cpp.
References children_.
Referenced by NeuroMesh::insertSingleDummy().
|
static |
This function takes a list of elements and builds a tree. Info on any attached spines are placed in the shaft_, head_, and parent_ vectors. The list of elements can be discontiguous. This is meant to be insensitive to vagaries in how the user has set up the compartment messaging, provided that there is at least one recognized message between connected compartments.
static function.
Definition at line 491 of file NeuroNode.cpp.
References isPartOfDend(), setParentAndChildren(), sortByShaftIds(), and spinyTraverse().
Referenced by NeuroMesh::setSubTree().
This function takes a list of elements that include connected compartments, and constructs a tree of nodes out of them. The generated nodes vector starts with the soma, and is a depth-first sequence of nodes. This is meant to be insensitive to vagaries in how the user has set up the compartment messaging, provided that there is at least one recognized message between connected compartments.
This function takes a list of elements that include connected compartments, and constructs a tree of nodes out of them. The generated nodes vector starts with the soma, and is a depth-first sequence of nodes. This is meant to be insensitive to vagaries in how the user has set up the compartment messaging, provided that there is at least one recognized message between connected compartments.
static function.
Definition at line 558 of file NeuroNode.cpp.
References findConnectedCompartments(), findStartNode(), removeDisconnectedNodes(), and traverse().
Referenced by NeuroMesh::setSubTree().
double NeuroNode::calculateLength | ( | const CylBase & | parent | ) |
Calculates and returns compartment length, from parent xyz to self xyz. Assigns own length as a side-effect.
Definition at line 121 of file NeuroNode.cpp.
References CylBase::getLength(), CylBase::getX(), CylBase::getY(), CylBase::getZ(), and CylBase::setLength().
const vector< unsigned int > & NeuroNode::children | ( | ) | const |
void NeuroNode::clearChildren | ( | ) |
Zeroes out the child vector
Definition at line 106 of file NeuroNode.cpp.
References children_.
Referenced by NeuroMesh::insertSingleDummy().
Id NeuroNode::elecCompt | ( | ) | const |
Definition at line 79 of file NeuroNode.cpp.
References elecCompt_.
Referenced by filterSpines().
|
static |
Trims off all spines from tree. Does so by identifying a set of reasonable names: shaft, head, spine, and variants in capitals. Having done this it builds two matching vectors of vector of shafts and heads, which is a hack that assumes that there are no sub-branches in spines. The returned nodes vector has non spine/shaft compartments only. The returned shaftId vector has all the shaft compartments. The returned headId vector has all the shaft compartments. The returned parent vector has the indices of the parent node for each shaft. There should be exactly the same number of entries in the shaftId, headId and parent vectors.
Trims off all spines from tree. Does so by identifying a set of reasonable names: shaft, head, spine, and variants in capitals. Having done this it builds two matching vectors of vector of shafts and heads, which is a hack that assumes that there are no sub-branches in spines. Then there is an index for parent NeuroNode entry. Static function
Definition at line 620 of file NeuroNode.cpp.
References elecCompt(), elecCompt_, Id::element(), Element::getName(), name, parent(), and reassignNodeIndices().
void NeuroNode::findConnectedCompartments | ( | const map< Id, unsigned int > & | nodeMap, |
const vector< NeuroNode > & | nodes | ||
) |
Finds all the compartments connected to current node, put them all into the 'children' vector even if they may be 'parent' by the messaging. This is because this function has to be robust enough to sort this out
Definition at line 198 of file NeuroNode.cpp.
References children_, elecCompt_, and findAllConnectedCompartments().
Referenced by buildTree().
|
static |
Find the start node, typically the soma, of a model. In terms of the solution, this should be the node at the root of the tree. Returns index in nodes vector. Technically the matrix solution could begin from any terminal branch, but it helps to keep the soma identical to the root of the tree.
Uses two heuristics to locate the start node: Looks for the node with the largest diameter, and also looks for node(s) with 'soma' in their name. If these disagree then it goes with the 'soma' node. If there are many of the soma nodes, it goes with the fattest.
Find the start node, typically the soma, of a model. In terms of the solution, this should be the node at the root of the tree. Returns index in nodes vector. Technically the matrix solution could begin from any terminal branch, but it helps to keep the soma identical to the root of the tree.
Uses two heuristics to locate the start node: Looks for the node with the largest diameter, and also looks for node(s) with 'soma' in their name. If these disagree then it goes with the 'soma' node. If there are many of the soma nodes, it goes with the fattest.
static func
Definition at line 270 of file NeuroNode.cpp.
References CylBase::getDia(), name, and moose::strncasecmp().
Referenced by buildTree().
void NeuroNode::innerTraverse | ( | vector< NeuroNode > & | tree, |
const vector< NeuroNode > & | nodes, | ||
vector< unsigned int > & | seen | ||
) | const |
Helper recursive function for traversing nodes to build tree.
Definition at line 351 of file NeuroNode.cpp.
References children_.
bool NeuroNode::isDummyNode | ( | ) | const |
True when this is a dummy node to represent the coordinates of the start end of a compartment. For example, the start coords of a compartment sitting on a spherical soma, or the start coords of a spine neck along a longer dendritic compartment. In all other cases the start coordinates are just those of the end of the parent compartment.
When the isDummyNode is true, the elecCompt represents the Id of the compartment whose start it is.
Definition at line 83 of file NeuroNode.cpp.
References CylBase::getNumDivs().
Referenced by NeuroMesh::getAdx(), NeuroMesh::matchCubeMeshEntries(), NeuroMesh::nearest(), NeuroMesh::updateCoords(), and NeuroMesh::vGetVoxelMidpoint().
bool NeuroNode::isSphere | ( | ) | const |
Definition at line 87 of file NeuroNode.cpp.
References isSphere_.
bool NeuroNode::isStartNode | ( | ) | const |
unsigned int NeuroNode::parent | ( | ) | const |
Definition at line 69 of file NeuroNode.cpp.
References parent_.
Referenced by filterSpines(), NeuroMesh::getAdx(), NeuroMesh::indexToSpace(), NeuroMesh::matchCubeMeshEntries(), NeuroMesh::nearest(), setParent(), NeuroMesh::updateCoords(), NeuroMesh::updateShaftParents(), and NeuroMesh::vGetVoxelMidpoint().
|
static |
Go through nodes vector and eliminate entries that have zero children, that is, are not connected to any others. Need to clean up 'children_' list after this is called.
Go through nodes vector and eliminate entries that have zero children, that is, are not connected to any others. Need to clean up 'children_' list.
static func
Definition at line 227 of file NeuroNode.cpp.
References children_.
Referenced by buildTree().
void NeuroNode::setParent | ( | unsigned int | parent | ) |
Assigns parent node info
Definition at line 111 of file NeuroNode.cpp.
References parent(), and parent_.
Referenced by NeuroMesh::insertSingleDummy().
void NeuroNode::setParentAndChildren | ( | unsigned int | index, |
int | dendParent, | ||
vector< NeuroNode > & | nodes, | ||
const unordered_map< Id, unsigned int > & | dendMap | ||
) |
Definition at line 533 of file NeuroNode.cpp.
References elecCompt_, and parent_.
Referenced by buildSpinyTree().
void NeuroNode::setStartFid | ( | unsigned int | f | ) |
unsigned int NeuroNode::startFid | ( | ) | const |
Definition at line 74 of file NeuroNode.cpp.
References startFid_.
Referenced by NeuroMesh::getAdx(), NeuroMesh::indexToSpace(), NeuroMesh::matchCubeMeshEntries(), NeuroMesh::nearest(), NeuroMesh::updateCoords(), and NeuroMesh::updateShaftParents().
|
static |
Traverses the nodes list starting from the 'start' node, and sets up correct parent-child information. This involves removing the identified 'parent' node from the 'children_' vector and assigning it to the parent_ field. Then it redoes the entire nodes vector (with due care for indexing of children and parents) so that it is in the correct order for a depth-first traversal. This means that you can take any entry in the list, and the immediately following entries will be all the descendants, if any.
Traverses the nodes list starting from the 'start' node, and sets up correct parent-child information. This involves removing the identified 'parent' node from the 'children_' vector and assigning it to the parent_ field. Then it redoes the entire nodes vector (with due care for indexing of children and parents) so that it is in the correct order for a depth-first traversal. This means that you can take any entry in the list, and the immediately following entries will be all the descendants, if any.
Static func
Definition at line 332 of file NeuroNode.cpp.
References diagnoseTree().
Referenced by buildTree().
|
private |
Index of children of this NeuroNode.
Definition at line 202 of file NeuroNode.h.
Referenced by addChild(), children(), clearChildren(), findConnectedCompartments(), innerTraverse(), and removeDisconnectedNodes().
|
private |
Id of electrical compartment in which this diffusive compt lives.
Definition at line 212 of file NeuroNode.h.
Referenced by elecCompt(), filterSpines(), findConnectedCompartments(), and setParentAndChildren().
|
private |
Special case for soma, perhaps for spine heads. When true, xyz are centre, and dia is dia.
Definition at line 218 of file NeuroNode.h.
Referenced by isSphere().
|
private |
Index of parent NeuroNode, typically a diffusive compartment. In the special case where the junction to the parent electrical compartment is NOT at the end of the parent compartment, this refers instead to a dummy NeuroNode which has the coordinates.
One of the nodes, typically the soma, will have no parent. This is indicated by the value ~0U.
Definition at line 197 of file NeuroNode.h.
Referenced by parent(), setParent(), and setParentAndChildren().
|
private |
Index of starting MeshEntry handled by this NeuroNode. Assumes a block of contiguous fids are handled by each NeuroNode.
Definition at line 208 of file NeuroNode.h.
Referenced by isStartNode(), setStartFid(), and startFid().