MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
NeuroNode.h
Go to the documentation of this file.
1 /**********************************************************************
2 ** This program is part of 'MOOSE', the
3 ** Messaging Object Oriented Simulation Environment.
4 ** Copyright (C) 2012 Upinder S. Bhalla. and NCBS
5 ** It is made available under the terms of the
6 ** GNU Lesser General Public License version 2.1
7 ** See the file COPYING.LIB for the full notice.
8 **********************************************************************/
9 
10 #ifndef _NEURO_NODE_H
11 #define _NEURO_NODE_H
12 
18 class NeuroNode: public CylBase
19 {
20  public:
24  NeuroNode( const CylBase& cb,
25  unsigned int parent, const vector< unsigned int >& children,
26  unsigned int startFid_, Id elecCompt,
27  bool isSphere );
32  NeuroNode( Id elecCompt );
36  NeuroNode();
37 
38 
39  unsigned int parent() const;
40  unsigned int startFid() const;
41  Id elecCompt() const;
42 
55  bool isDummyNode() const; // True if CylBase::numDivs is zero.
56  bool isSphere() const;
57  bool isStartNode() const; // True if startFid_ == 0
58  const vector< unsigned int >& children() const;
59 
60 
64  void addChild( unsigned int child );
65 
69  void clearChildren();
70 
74  void setParent( unsigned int parent );
75 
79  void setStartFid( unsigned int f );
80 
85  double calculateLength( const CylBase& parent );
86 
88  // A set of calls for safely generating a tree by traversing
89  // compartment messages. Designed to be somewhat resilient, even
90  // when given a badly set up neuron.
92 
99  const map< Id, unsigned int >& nodeMap,
100  const vector< NeuroNode >& nodes );
101 
107  static unsigned int removeDisconnectedNodes(
108  vector< NeuroNode >& nodes );
109 
124  static unsigned int findStartNode(
125  const vector< NeuroNode >& nodes );
126 
139  static void traverse(
140  vector< NeuroNode >& nodes, unsigned int start );
141 
145  void innerTraverse(
146  vector< NeuroNode >& tree,
147  const vector< NeuroNode >& nodes,
148  vector< unsigned int >& seen
149  ) const;
150 
160  static void buildTree( vector< NeuroNode >& nodes,
161  vector< ObjId > elist );
162  static void buildSpinyTree(
163  vector< ObjId >& elist, vector< NeuroNode >& nodes,
164  vector< Id >& shaftId, vector< Id >& headId,
165  vector< unsigned int >& spineParent );
166  void setParentAndChildren( unsigned int index, int dendParent,
167  vector< NeuroNode >& nodes,
168  const unordered_map< Id, unsigned int >& dendMap );
169 
184  static void filterSpines( vector< NeuroNode >& nodes,
185  vector< Id >& shaftId, vector< Id >& headId,
186  vector< unsigned int >& parent );
187  private:
197  unsigned int parent_;
198 
202  vector< unsigned int >children_;
203 
208  unsigned int startFid_;
209 
210 
213 
218  bool isSphere_;
219 
220  // For spines we will also need a double to indicate position along
221  // parent dendrite.
222  //
223 };
224 
225 #endif // _NEURO_NODE_H
Id elecCompt() const
Definition: NeuroNode.cpp:79
static void buildSpinyTree(vector< ObjId > &elist, vector< NeuroNode > &nodes, vector< Id > &shaftId, vector< Id > &headId, vector< unsigned int > &spineParent)
Definition: NeuroNode.cpp:491
void setParent(unsigned int parent)
Definition: NeuroNode.cpp:111
static void traverse(vector< NeuroNode > &nodes, unsigned int start)
Definition: NeuroNode.cpp:332
static void filterSpines(vector< NeuroNode > &nodes, vector< Id > &shaftId, vector< Id > &headId, vector< unsigned int > &parent)
Definition: NeuroNode.cpp:620
static void buildTree(vector< NeuroNode > &nodes, vector< ObjId > elist)
Definition: NeuroNode.cpp:558
static unsigned int findStartNode(const vector< NeuroNode > &nodes)
Definition: NeuroNode.cpp:270
unsigned int startFid() const
Definition: NeuroNode.cpp:74
const vector< unsigned int > & children() const
Definition: NeuroNode.cpp:96
void innerTraverse(vector< NeuroNode > &tree, const vector< NeuroNode > &nodes, vector< unsigned int > &seen) const
Definition: NeuroNode.cpp:351
unsigned int parent_
Definition: NeuroNode.h:197
bool isStartNode() const
Definition: NeuroNode.cpp:91
bool isSphere() const
Definition: NeuroNode.cpp:87
unsigned int startFid_
Definition: NeuroNode.h:208
double calculateLength(const CylBase &parent)
Definition: NeuroNode.cpp:121
bool isSphere_
Definition: NeuroNode.h:218
Id elecCompt_
Id of electrical compartment in which this diffusive compt lives.
Definition: NeuroNode.h:212
unsigned int parent() const
Definition: NeuroNode.cpp:69
void findConnectedCompartments(const map< Id, unsigned int > &nodeMap, const vector< NeuroNode > &nodes)
Definition: NeuroNode.cpp:198
bool isDummyNode() const
Definition: NeuroNode.cpp:83
Definition: Id.h:17
void setStartFid(unsigned int f)
Definition: NeuroNode.cpp:116
void setParentAndChildren(unsigned int index, int dendParent, vector< NeuroNode > &nodes, const unordered_map< Id, unsigned int > &dendMap)
Definition: NeuroNode.cpp:533
static unsigned int removeDisconnectedNodes(vector< NeuroNode > &nodes)
Definition: NeuroNode.cpp:227
vector< unsigned int > children_
Definition: NeuroNode.h:202
void clearChildren()
Definition: NeuroNode.cpp:106
void addChild(unsigned int child)
Definition: NeuroNode.cpp:101