00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef _NEURO_NODE_H
00011 #define _NEURO_NODE_H
00012
00018 class NeuroNode: public CylBase
00019 {
00020 public:
00024 NeuroNode( const CylBase& cb,
00025 unsigned int parent, const vector< unsigned int >& children,
00026 unsigned int startFid_, Id elecCompt,
00027 bool isSphere );
00032 NeuroNode( Id elecCompt );
00036 NeuroNode();
00037
00038
00039 unsigned int parent() const;
00040 unsigned int startFid() const;
00041 Id elecCompt() const;
00042
00055 bool isDummyNode() const;
00056 bool isSphere() const;
00057 bool isStartNode() const;
00058 const vector< unsigned int >& children() const;
00059
00060
00064 void addChild( unsigned int child );
00065
00069 void clearChildren();
00070
00074 void setParent( unsigned int parent );
00075
00079 void setStartFid( unsigned int f );
00080
00085 double calculateLength( const CylBase& parent );
00086
00088
00089
00090
00092
00098 void findConnectedCompartments(
00099 const map< Id, unsigned int >& nodeMap,
00100 const vector< NeuroNode >& nodes );
00101
00107 static unsigned int removeDisconnectedNodes(
00108 vector< NeuroNode >& nodes );
00109
00124 static unsigned int findStartNode(
00125 const vector< NeuroNode >& nodes );
00126
00139 static void traverse(
00140 vector< NeuroNode >& nodes, unsigned int start );
00141
00145 void innerTraverse(
00146 vector< NeuroNode >& tree,
00147 const vector< NeuroNode >& nodes,
00148 vector< unsigned int >& seen
00149 ) const;
00150
00160 static void buildTree( vector< NeuroNode >& nodes,
00161 vector< ObjId > elist );
00162 static void buildSpinyTree(
00163 vector< ObjId >& elist, vector< NeuroNode >& nodes,
00164 vector< Id >& shaftId, vector< Id >& headId,
00165 vector< unsigned int >& spineParent );
00166 void setParentAndChildren( unsigned int index, int dendParent,
00167 vector< NeuroNode >& nodes,
00168 const map< Id, unsigned int >& dendMap );
00169
00184 static void filterSpines( vector< NeuroNode >& nodes,
00185 vector< Id >& shaftId, vector< Id >& headId,
00186 vector< unsigned int >& parent );
00187 private:
00197 unsigned int parent_;
00198
00202 vector< unsigned int >children_;
00203
00208 unsigned int startFid_;
00209
00210
00212 Id elecCompt_;
00213
00218 bool isSphere_;
00219
00220
00221
00222
00223 };
00224
00225 #endif // _NEURO_NODE_H