MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Neuron.h
Go to the documentation of this file.
1 /**********************************************************************
2 ** This program is part of 'MOOSE', the
3 ** Messaging Object Oriented Simulation Environment,
4 ** also known as GENESIS 3 base code.
5 ** copyright (C) 2003-2006 Upinder S. Bhalla. and NCBS
6 ** It is made available under the terms of the
7 ** GNU Lesser General Public License version 2.1
8 ** See the file COPYING.LIB for the full notice.
9 **********************************************************************/
10 
11 #ifndef _NEURON_H
12 #define _NEURON_H
13 
18 class Neuron
19 {
20 public:
21  Neuron();
22  Neuron( const Neuron& other );
23  void setRM( double v );
24  double getRM() const;
25  void setRA( double v );
26  double getRA() const;
27  void setCM( double v );
28  double getCM() const;
29  void setEm( double v );
30  double getEm() const;
31  void setTheta( double v );
32  double getTheta() const;
33  void setPhi( double v );
34  double getPhi() const;
35  void setSourceFile( string v );
36  string getSourceFile() const;
37  void setCompartmentLengthInLambdas( double v );
38  double getCompartmentLengthInLambdas() const;
39  unsigned int getNumCompartments() const;
40  unsigned int getNumBranches() const;
41  vector< double> getPathDistFromSoma() const;
42  vector< double> getGeomDistFromSoma() const;
43  vector< double> getElecDistFromSoma() const;
44  vector< ObjId > getCompartments() const;
45  vector< ObjId > getExprElist( const Eref& e, string line ) const;
46  vector< double > getExprVal( const Eref& e, string line ) const;
47  vector< ObjId > getSpinesFromExpression(
48  const Eref& e, string line ) const;
49  vector< ObjId > getSpinesOnCompartment(
50  const Eref& e, ObjId compt ) const;
51  ObjId getParentCompartmentOfSpine( const Eref& e, ObjId compt )
52  const;
53  vector< ObjId > getSpineIdsFromCompartmentIds(
54  const Eref& e, vector< ObjId > compt ) const;
55  void setChannelDistribution( const Eref& e, vector< string > v );
56  vector< string > getChannelDistribution( const Eref& e ) const;
57  void setPassiveDistribution( const Eref& e, vector< string > v );
58  vector< string > getPassiveDistribution( const Eref& e ) const;
59  void setSpineDistribution( const Eref& e, vector< string > v );
60  vector< string > getSpineDistribution( const Eref& e ) const;
61 
62  void buildSegmentTree( const Eref& e );
63  void setSpineAndPsdMesh( Id spineMesh, Id psdMesh );
64  void setSpineAndPsdDsolve( Id spineDsolve, Id psdDsolve );
65 
67  // MechSpec set
69  void updateSegmentLengths();
70  void installSpines( const vector< ObjId >& elist,
71  const vector< double >& val, const vector< string >& line );
72  void makeSpacingDistrib(
73  const vector< ObjId >& elist, const vector< double >& val,
74  vector< unsigned int >& seglistIndex,
75  vector< unsigned int >& elistIndex,
76  vector< double >& pos,
77  const vector< string >& line ) const;
78  void parseMechSpec( const Eref& e );
79  void installMechanism( const string& name,
80  const vector< ObjId >& elist, const vector< double >& val,
81  const vector< string >& line );
82  void buildElist(
83  const Eref& e,
84  const vector< string >& line, vector< ObjId >& elist,
85  vector< double >& val );
86 
87  void evalExprForElist( const vector< ObjId >& elist,
88  const string& expn, vector< double >& val ) const;
89 
91  // Interface for Spine class, used mostly in resizing spines.
93  Spine* lookupSpine( unsigned int index );
94  void setNumSpines( unsigned int num );
95  unsigned int getNumSpines() const;
96 
97  const vector< Id >& spineIds( unsigned int index ) const;
98  void scaleBufAndRates( unsigned int spineNum,
99  double lenScale, double diaScale ) const;
100  void scaleShaftDiffusion( unsigned int spineNum,
101  double len, double dia) const;
102  void scaleHeadDiffusion( unsigned int spineNum,
103  double len, double dia) const;
104 
108  static const Cinfo* initCinfo();
109 private:
110  double RM_;
111  double RA_;
112  double CM_;
113  double Em_;
114  double theta_;
115  double phi_;
116  double maxP_; // Maximum value of path dist from soma for this cell
117  double maxG_; // Maximum value of geom dist from soma for this cell
118  double maxL_; // Maximum value of elec dist from soma for this cell
120  string sourceFile_;
122  vector< string > channelDistribution_;
123  vector< string > passiveDistribution_;
124  vector< string > spineDistribution_;
125 
127  map< Id, unsigned int > segIndex_;
129  vector< unsigned int > spineParentSegIndex_;
130  vector< vector< Id > > spines_;
131 
133  vector< vector< Id > > allSpinesPerCompt_;
134 
136  vector< Id > spineStoich_;
138  vector< Id > psdStoich_;
140  vector< unsigned int > spineToMeshOrdering_;
141 
144  // looks up spine/psd Dsolve::DiffJunction::VoxelJunction index
145  //from FieldIndex of selected spine.
146  // Turns out this is the same as spineToMeshOrdering.
147  //vector< unsigned int > spineToVoxelJunctionOrdering_;
148 
151 
152  vector< Id > segId_;
153  vector< SwcSegment > segs_;
154  vector< SwcBranch > branches_;
155 
156 };
157 
158 //
159 
160 #endif //
unsigned int getNumCompartments() const
Definition: Neuron.cpp:904
Id soma_
Definition: Neuron.h:119
vector< unsigned int > spineToMeshOrdering_
looks up spine/psd mesh index from FieldIndex of selected spine.
Definition: Neuron.h:140
void setPassiveDistribution(const Eref &e, vector< string > v)
Definition: Neuron.cpp:1163
double Em_
Definition: Neuron.h:113
Definition: Neuron.h:18
void setCM(double v)
Definition: Neuron.cpp:838
void scaleHeadDiffusion(unsigned int spineNum, double len, double dia) const
Scale the diffusion parameters due to a change in the head dimensions.
Definition: Neuron.cpp:2106
double RM_
Definition: Neuron.h:110
double compartmentLengthInLambdas_
Definition: Neuron.h:121
void setSpineAndPsdDsolve(Id spineDsolve, Id psdDsolve)
Definition: Neuron.cpp:1462
void setRA(double v)
Definition: Neuron.cpp:826
Neuron()
Definition: Neuron.cpp:542
string sourceFile_
Definition: Neuron.h:120
void makeSpacingDistrib(const vector< ObjId > &elist, const vector< double > &val, vector< unsigned int > &seglistIndex, vector< unsigned int > &elistIndex, vector< double > &pos, const vector< string > &line) const
Definition: Neuron.cpp:1841
vector< double > getPathDistFromSoma() const
Definition: Neuron.cpp:921
vector< string > channelDistribution_
Definition: Neuron.h:122
unsigned int getNumBranches() const
Definition: Neuron.cpp:916
double phi_
Definition: Neuron.h:115
vector< string > passiveDistribution_
Definition: Neuron.h:123
void installSpines(const vector< ObjId > &elist, const vector< double > &val, const vector< string > &line)
Definition: Neuron.cpp:1974
vector< ObjId > getExprElist(const Eref &e, string line) const
Definition: Neuron.cpp:959
void buildElist(const Eref &e, const vector< string > &line, vector< ObjId > &elist, vector< double > &val)
Definition: Neuron.cpp:1116
double RA_
Definition: Neuron.h:111
void setSourceFile(string v)
Definition: Neuron.cpp:883
double maxL_
Definition: Neuron.h:118
Spine * lookupSpine(unsigned int index)
Definition: Neuron.cpp:2028
vector< vector< Id > > allSpinesPerCompt_
Id of each compt in each spine.
Definition: Neuron.h:133
Definition: ObjId.h:20
void evalExprForElist(const vector< ObjId > &elist, const string &expn, vector< double > &val) const
Definition: Neuron.cpp:1478
Id headDsolve_
Definition: Neuron.h:142
map< Id, unsigned int > segIndex_
Map to look up Seg index from Id of associated compt.
Definition: Neuron.h:127
static const Cinfo * initCinfo()
Definition: Neuron.cpp:106
void parseMechSpec(const Eref &e)
vector< Id > psdStoich_
Id of stoich associated with each PSD. Typically all the same.
Definition: Neuron.h:138
Spine spineEntry_
Id of the Dsolve for the PSD compt.
Definition: Neuron.h:150
const vector< Id > & spineIds(unsigned int index) const
Definition: Neuron.cpp:2047
vector< string > getChannelDistribution(const Eref &e) const
Definition: Neuron.cpp:1158
double getRM() const
Definition: Neuron.cpp:821
double theta_
Definition: Neuron.h:114
double getCompartmentLengthInLambdas() const
Definition: Neuron.cpp:899
double getPhi() const
Definition: Neuron.cpp:877
void setPhi(double v)
Definition: Neuron.cpp:872
double getRA() const
Definition: Neuron.cpp:833
void setSpineAndPsdMesh(Id spineMesh, Id psdMesh)
Fills up vector of segments. First entry is soma.
Definition: Neuron.cpp:1410
double getEm() const
Definition: Neuron.cpp:855
double getCM() const
Definition: Neuron.cpp:845
double maxG_
Definition: Neuron.h:117
void scaleShaftDiffusion(unsigned int spineNum, double len, double dia) const
Scale the diffusion parameters due to a change in the shaft dimensions.
Definition: Neuron.cpp:2094
double maxP_
Definition: Neuron.h:116
vector< ObjId > getSpinesFromExpression(const Eref &e, string line) const
Definition: Neuron.cpp:1009
void setTheta(double v)
Definition: Neuron.cpp:861
string getSourceFile() const
Definition: Neuron.cpp:889
Definition: Eref.h:26
vector< vector< Id > > spines_
Definition: Neuron.h:130
vector< double > getExprVal(const Eref &e, string line) const
Definition: Neuron.cpp:991
vector< Id > segId_
Definition: Neuron.h:152
vector< string > getSpineDistribution(const Eref &e) const
Definition: Neuron.cpp:1205
vector< string > getPassiveDistribution(const Eref &e) const
Definition: Neuron.cpp:1183
double getTheta() const
Definition: Neuron.cpp:866
ObjId getParentCompartmentOfSpine(const Eref &e, ObjId compt) const
Definition: Neuron.cpp:1066
void setSpineDistribution(const Eref &e, vector< string > v)
Definition: Neuron.cpp:1188
void setChannelDistribution(const Eref &e, vector< string > v)
Definition: Neuron.cpp:1132
vector< SwcBranch > branches_
Definition: Neuron.h:154
static char name[]
Definition: mfield.cpp:401
vector< ObjId > getSpineIdsFromCompartmentIds(const Eref &e, vector< ObjId > compt) const
Definition: Neuron.cpp:1079
vector< ObjId > getCompartments() const
Definition: Neuron.cpp:945
void setCompartmentLengthInLambdas(double v)
Definition: Neuron.cpp:895
Id psdDsolve_
Id of the Dsolve for the head compt.
Definition: Neuron.h:143
vector< unsigned int > spineParentSegIndex_
Look up seg index of parent compartment, from index of spine.
Definition: Neuron.h:129
void setNumSpines(unsigned int num)
Definition: Neuron.cpp:2033
Definition: Id.h:17
void buildSegmentTree(const Eref &e)
Fills up vector of segments. First entry is soma.
Definition: Neuron.cpp:1362
unsigned int getNumSpines() const
Definition: Neuron.cpp:2039
void updateSegmentLengths()
Definition: Neuron.cpp:1333
vector< ObjId > getSpinesOnCompartment(const Eref &e, ObjId compt) const
Definition: Neuron.cpp:1050
void installMechanism(const string &name, const vector< ObjId > &elist, const vector< double > &val, const vector< string > &line)
vector< Id > spineStoich_
Id of stoich associated with each spine. Typically all the same.
Definition: Neuron.h:136
void setRM(double v)
Definition: Neuron.cpp:814
void scaleBufAndRates(unsigned int spineNum, double lenScale, double diaScale) const
Definition: Neuron.cpp:2055
Definition: Spine.h:24
double CM_
Definition: Neuron.h:112
vector< SwcSegment > segs_
Id of compartment in each Seg entry, below.
Definition: Neuron.h:153
Definition: Cinfo.h:18
vector< string > spineDistribution_
Definition: Neuron.h:124
void setEm(double v)
Definition: Neuron.cpp:851
vector< double > getGeomDistFromSoma() const
Definition: Neuron.cpp:929
vector< double > getElecDistFromSoma() const
Definition: Neuron.cpp:937