MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Spine Class Reference

#include <Spine.h>

+ Collaboration diagram for Spine:

Public Member Functions

double getAngle (const Eref &e) const
 
Id getHead (const Eref &e) const
 
double getHeadDiameter (const Eref &e) const
 
double getHeadLength (const Eref &e) const
 
double getHeadVolume (const Eref &e) const
 
double getInclination (const Eref &e) const
 
double getMaximumSize (const Eref &e) const
 
double getMinimumSize (const Eref &e) const
 
double getPsdArea (const Eref &e) const
 
Id getShaft (const Eref &e) const
 
double getShaftDiameter (const Eref &e) const
 
double getShaftLength (const Eref &e) const
 
double getTotalLength (const Eref &e) const
 
void setAngle (const Eref &e, double theta)
 
void setHeadDiameter (const Eref &e, double dia)
 
void setHeadLength (const Eref &e, double len)
 
void setHeadVolume (const Eref &e, double vol)
 
void setInclination (const Eref &e, double phi)
 
void setMaximumSize (const Eref &e, double len)
 
void setMinimumSize (const Eref &e, double len)
 
void setPsdArea (const Eref &e, double area)
 
void setShaftDiameter (const Eref &e, double dia)
 
void setShaftLength (const Eref &e, double len)
 
void setTotalLength (const Eref &e, double len)
 
 Spine ()
 
 Spine (const Neuron *parent)
 

Static Public Member Functions

static const CinfoinitCinfo ()
 

Private Attributes

double maximumSize_
 
double minimumSize_
 
const Neuronparent_
 

Detailed Description

The Spine is a dendritic spine, typically with 2 compartments, the shaft and the head. It is a FieldElement, so it gets all its values from the parent Neuron. Later we can put in a maturation profile, so that a linear number from 0 to 1 will define all the stages of spine growth from stub to filopodium to mature spine.

Definition at line 24 of file Spine.h.

Constructor & Destructor Documentation

Spine::Spine ( )

Definition at line 160 of file Spine.cpp.

161  : parent_( 0 ),
162  minimumSize_( 20.0e-9 ), // 20 nanometres
163  maximumSize_( 10.0e-6 ) // 10 microns
164 {;}
const Neuron * parent_
Definition: Spine.h:78
double maximumSize_
Definition: Spine.h:86
double minimumSize_
Definition: Spine.h:85
Spine::Spine ( const Neuron parent)

Definition at line 166 of file Spine.cpp.

167  : parent_( parent ),
168  minimumSize_( 20.0e-9 ), // 20 nanometres
169  maximumSize_( 10.0e-6 ) // 10 microns
170 {;}
const Neuron * parent_
Definition: Spine.h:78
double maximumSize_
Definition: Spine.h:86
double minimumSize_
Definition: Spine.h:85

Member Function Documentation

double Spine::getAngle ( const Eref e) const

Definition at line 381 of file Spine.cpp.

Referenced by initCinfo().

382 {
383  return 0;
384 }

+ Here is the caller graph for this function:

Id Spine::getHead ( const Eref e) const
double Spine::getHeadDiameter ( const Eref e) const

Definition at line 280 of file Spine.cpp.

References Eref::fieldIndex(), parent_, and Neuron::spineIds().

Referenced by getHeadVolume(), getPsdArea(), and initCinfo().

281 {
282  vector< Id > sl = parent_->spineIds( e.fieldIndex() );
283  if ( sl.size() > 1 &&
284  sl[1].element()->cinfo()->isA( "CompartmentBase" ) )
285  return Field< double >::get( sl[1], "diameter" );
286  return 0.0;
287 }
const Neuron * parent_
Definition: Spine.h:78
Definition: SetGet.h:236
unsigned int fieldIndex() const
Definition: Eref.h:61
const vector< Id > & spineIds(unsigned int index) const
Definition: Neuron.cpp:2047

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double Spine::getHeadLength ( const Eref e) const

Definition at line 245 of file Spine.cpp.

References Eref::fieldIndex(), parent_, and Neuron::spineIds().

Referenced by getHeadVolume(), getTotalLength(), initCinfo(), and setTotalLength().

246 {
247  vector< Id > sl = parent_->spineIds( e.fieldIndex() );
248  if ( sl.size() > 1 &&
249  sl[1].element()->cinfo()->isA( "CompartmentBase" ) )
250  return Field< double >::get( sl[1], "length" );
251  return 0.0;
252 }
const Neuron * parent_
Definition: Spine.h:78
Definition: SetGet.h:236
unsigned int fieldIndex() const
Definition: Eref.h:61
const vector< Id > & spineIds(unsigned int index) const
Definition: Neuron.cpp:2047

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double Spine::getHeadVolume ( const Eref e) const

Definition at line 325 of file Spine.cpp.

References getHeadDiameter(), getHeadLength(), and PI.

Referenced by initCinfo().

326 {
327  double dia = getHeadDiameter( e );
328  return getHeadLength( e ) * dia * dia * PI / 4.0;
329 }
double getHeadDiameter(const Eref &e) const
Definition: Spine.cpp:280
const double PI
Definition: consts.cpp:12
double getHeadLength(const Eref &e) const
Definition: Spine.cpp:245

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double Spine::getInclination ( const Eref e) const

Definition at line 391 of file Spine.cpp.

Referenced by initCinfo().

392 {
393  return 0;
394 }

+ Here is the caller graph for this function:

double Spine::getMaximumSize ( const Eref e) const

Definition at line 411 of file Spine.cpp.

References maximumSize_.

Referenced by initCinfo().

412 {
413  return maximumSize_;
414 }
double maximumSize_
Definition: Spine.h:86

+ Here is the caller graph for this function:

double Spine::getMinimumSize ( const Eref e) const

Definition at line 401 of file Spine.cpp.

References minimumSize_.

Referenced by initCinfo().

402 {
403  return minimumSize_;
404 }
double minimumSize_
Definition: Spine.h:85

+ Here is the caller graph for this function:

double Spine::getPsdArea ( const Eref e) const

Definition at line 309 of file Spine.cpp.

References getHeadDiameter(), and PI.

Referenced by initCinfo().

310 {
311  double ret = getHeadDiameter( e );
312  return ret * ret * PI / 4.0;
313 }
double getHeadDiameter(const Eref &e) const
Definition: Spine.cpp:280
const double PI
Definition: consts.cpp:12

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Id Spine::getShaft ( const Eref e) const
double Spine::getShaftDiameter ( const Eref e) const

Definition at line 217 of file Spine.cpp.

References Eref::fieldIndex(), parent_, and Neuron::spineIds().

Referenced by initCinfo().

218 {
219  vector< Id > sl = parent_->spineIds( e.fieldIndex() );
220  if ( sl.size() > 0 &&
221  sl[0].element()->cinfo()->isA( "CompartmentBase" ) )
222  return Field< double >::get( sl[0], "diameter" );
223  return 0.0;
224 }
const Neuron * parent_
Definition: Spine.h:78
Definition: SetGet.h:236
unsigned int fieldIndex() const
Definition: Eref.h:61
const vector< Id > & spineIds(unsigned int index) const
Definition: Neuron.cpp:2047

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double Spine::getShaftLength ( const Eref e) const

Definition at line 176 of file Spine.cpp.

References Eref::fieldIndex(), parent_, and Neuron::spineIds().

Referenced by getTotalLength(), initCinfo(), and setTotalLength().

177 {
178  const vector< Id >& sl = parent_->spineIds( e.fieldIndex() );
179  if ( sl.size() > 0 &&
180  sl[0].element()->cinfo()->isA( "CompartmentBase" ) )
181  return Field< double >::get( sl[0], "length" );
182  return 0.0;
183 }
const Neuron * parent_
Definition: Spine.h:78
Definition: SetGet.h:236
unsigned int fieldIndex() const
Definition: Eref.h:61
const vector< Id > & spineIds(unsigned int index) const
Definition: Neuron.cpp:2047

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double Spine::getTotalLength ( const Eref e) const

Definition at line 358 of file Spine.cpp.

References getHeadLength(), and getShaftLength().

Referenced by initCinfo().

359 {
360  return getHeadLength( e ) + getShaftLength( e );
361 }
double getShaftLength(const Eref &e) const
Definition: Spine.cpp:176
double getHeadLength(const Eref &e) const
Definition: Spine.cpp:245

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const Cinfo * Spine::initCinfo ( )
static

Definition at line 17 of file Spine.cpp.

References getAngle(), getHeadDiameter(), getHeadLength(), getHeadVolume(), getInclination(), getMaximumSize(), getMinimumSize(), getPsdArea(), getShaftDiameter(), getShaftLength(), getTotalLength(), Neutral::initCinfo(), setAngle(), setHeadDiameter(), setHeadLength(), setHeadVolume(), setInclination(), setMaximumSize(), setMinimumSize(), setPsdArea(), setShaftDiameter(), setShaftLength(), setTotalLength(), and spineCinfo.

Referenced by Neuron::initCinfo().

18 {
20  // Field Definitions
22  static ElementValueFinfo< Spine, double > shaftLength (
23  "shaftLength",
24  "Length of spine shaft.",
27  );
28  static ElementValueFinfo< Spine, double > shaftDiameter (
29  "shaftDiameter",
30  "Diameter of spine shaft.",
33  );
34  static ElementValueFinfo< Spine, double > headLength (
35  "headLength",
36  "Length of spine head.",
39  );
40  static ElementValueFinfo< Spine, double > headDiameter (
41  "headDiameter",
42  "Diameter of spine head, and also the diameter of the PSD. ",
45  );
46  static ElementValueFinfo< Spine, double > psdArea (
47  "psdArea",
48  "Area of the Post synaptic density, PSD. This is the same as "
49  "the cross-section area of spine head, perpendicular to shaft. "
50  "Assumes that the head is a cylinder and that its length "
51  "does not change. \n"
52  "This is useful to scale # of surface molecules on the PSD. ",
55  );
56  static ElementValueFinfo< Spine, double > headVolume (
57  "headVolume",
58  "Volume of spine head, treating it as a cylinder. When this is "
59  "scaled by the user, both the diameter and the length of the "
60  "spine head scale by the cube root of the ratio to the "
61  "previous volume. The diameter of the PSD is pegged to the "
62  "diameter of the spine head. \n"
63  "This is useful to scale total # of molecules in the head. ",
66  );
67  static ElementValueFinfo< Spine, double > totalLength (
68  "totalLength",
69  "Length of entire spine. Scales both the length of the shaft "
70  "and of the spine head, without changing any of the diameters.",
73  );
75  "angle",
76  "Angle of spine around shaft. Longitude. 0 is away from soma. "
77  "Not yet implemented. ",
80  );
81  static ElementValueFinfo< Spine, double > inclination (
82  "inclination",
83  "inclination of spine with ref to shaft. Normal is 0. "
84  "Not yet activated. ",
87  );
88  static ElementValueFinfo< Spine, double > minimumSize (
89  "minimumSize",
90  "Sanity check for the smallest permitted length or diameter. "
91  "Used to avoid unreasonable physiological values, which "
92  "are all too easily reached when simulations run unbounded. "
93  "Defaults to 20 nanometers, which is somewhat smaller than the "
94  "30 nm size estimated for synaptic vesicles. "
95  "Does *not* retroactively resize anything. ",
98  );
99  static ElementValueFinfo< Spine, double > maximumSize (
100  "maximumSize",
101  "Sanity check for the largest permitted length or diameter. "
102  "Used to avoid unreasonable physiological values, which "
103  "are all too easily reached when simulations run unbounded. "
104  "Defaults to 10 microns, which is a pretty monstrous spine. "
105  "Does *not* retroactively resize anything. ",
108  );
109 
111  // MsgDest Definitions
114  // Shared definitions
116 
118  // SrcFinfo Definitions
120 
121  static Finfo* spineFinfos[] = {
122  &shaftLength, // Value
123  &shaftDiameter, // Value
124  &headLength, // Value
125  &headDiameter, // Value
126  &psdArea, // Value
127  &headVolume, // Value
128  &totalLength, // Value
129  };
130 
131  static string doc[] =
132  {
133  "Name", "Spine",
134  "Author", "Upi Bhalla",
135  "Description", "Spine wrapper, used to change its morphology "
136  "typically by a message from an adaptor. The Spine class "
137  "takes care of a lot of resultant scaling to electrical, "
138  "chemical, and diffusion properties. "
139  };
140  static Dinfo< Spine > dinfo;
141  static Cinfo spineCinfo (
142  "Spine",
144  spineFinfos,
145  sizeof( spineFinfos ) / sizeof ( Finfo* ),
146  &dinfo,
147  doc,
148  sizeof(doc)/sizeof( string ),
149  true // This IS a FieldElement, not be be created directly.
150  );
151 
152  return &spineCinfo;
153 }
static const Cinfo * spineCinfo
Definition: Spine.cpp:158
double getHeadDiameter(const Eref &e) const
Definition: Spine.cpp:280
void setMaximumSize(const Eref &e, double len)
Definition: Spine.cpp:416
double getHeadVolume(const Eref &e) const
Definition: Spine.cpp:325
Definition: Dinfo.h:60
double getInclination(const Eref &e) const
Definition: Spine.cpp:391
double getMinimumSize(const Eref &e) const
Definition: Spine.cpp:401
double getShaftDiameter(const Eref &e) const
Definition: Spine.cpp:217
void setShaftLength(const Eref &e, double len)
Definition: Spine.cpp:185
void setMinimumSize(const Eref &e, double len)
Definition: Spine.cpp:406
void setAngle(const Eref &e, double theta)
Definition: Spine.cpp:386
void setInclination(const Eref &e, double phi)
Definition: Spine.cpp:396
void setPsdArea(const Eref &e, double area)
Definition: Spine.cpp:315
void setShaftDiameter(const Eref &e, double dia)
Definition: Spine.cpp:226
double getAngle(const Eref &e) const
Definition: Spine.cpp:381
double getTotalLength(const Eref &e) const
Definition: Spine.cpp:358
void setHeadLength(const Eref &e, double len)
Definition: Spine.cpp:254
double getPsdArea(const Eref &e) const
Definition: Spine.cpp:309
double getMaximumSize(const Eref &e) const
Definition: Spine.cpp:411
static const Cinfo * initCinfo()
Definition: Neutral.cpp:16
void setHeadVolume(const Eref &e, double vol)
Definition: Spine.cpp:332
void setHeadDiameter(const Eref &e, double dia)
Definition: Spine.cpp:289
double getShaftLength(const Eref &e) const
Definition: Spine.cpp:176
Definition: Cinfo.h:18
void setTotalLength(const Eref &e, double len)
Definition: Spine.cpp:363
double getHeadLength(const Eref &e) const
Definition: Spine.cpp:245
Definition: Finfo.h:12

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Spine::setAngle ( const Eref e,
double  theta 
)

Definition at line 386 of file Spine.cpp.

Referenced by initCinfo().

387 {
388  ;
389 }

+ Here is the caller graph for this function:

void Spine::setHeadDiameter ( const Eref e,
double  dia 
)

Definition at line 289 of file Spine.cpp.

References Eref::fieldIndex(), Field< A >::get(), maximumSize_, minimumSize_, parent_, Neuron::scaleBufAndRates(), Neuron::scaleHeadDiffusion(), SetGet2< A1, A2 >::set(), and Neuron::spineIds().

Referenced by initCinfo(), and setPsdArea().

290 {
291  if ( dia < minimumSize_ )
292  dia = minimumSize_;
293  else if ( dia > maximumSize_ )
294  dia = maximumSize_;
295  vector< Id > sl = parent_->spineIds( e.fieldIndex() );
296  if ( sl.size() > 1 &&
297  sl[0].element()->cinfo()->isA( "CompartmentBase") )
298  {
299  double origLen = Field< double >::get( sl[1], "length" );
300  double origDia = Field< double >::get( sl[1], "diameter" );
302  sl[1], "setGeomAndElec", origLen, dia );
303  parent_->scaleHeadDiffusion( e.fieldIndex(), origLen, dia );
305  1.0, dia/origDia );
306  }
307 }
const Neuron * parent_
Definition: Spine.h:78
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
unsigned int fieldIndex() const
Definition: Eref.h:61
const vector< Id > & spineIds(unsigned int index) const
Definition: Neuron.cpp:2047
double maximumSize_
Definition: Spine.h:86
double minimumSize_
Definition: Spine.h:85
static A get(const ObjId &dest, const string &field)
Definition: SetGet.h:284
void scaleBufAndRates(unsigned int spineNum, double lenScale, double diaScale) const
Definition: Neuron.cpp:2055
static bool set(const ObjId &dest, const string &field, A1 arg1, A2 arg2)
Definition: SetGet.h:365

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Spine::setHeadLength ( const Eref e,
double  len 
)

Definition at line 254 of file Spine.cpp.

References Eref::fieldIndex(), Field< A >::get(), maximumSize_, minimumSize_, parent_, Neuron::scaleBufAndRates(), Neuron::scaleHeadDiffusion(), SetGet2< A1, A2 >::set(), and Neuron::spineIds().

Referenced by initCinfo(), and setTotalLength().

255 {
256  if ( len < minimumSize_ )
257  len = minimumSize_;
258  else if ( len > maximumSize_ )
259  len = maximumSize_;
260 
261  vector< Id > sl = parent_->spineIds( e.fieldIndex() );
262  if ( sl.size() > 1 &&
263  sl[1].element()->cinfo()->isA( "CompartmentBase") )
264  {
265  double origDia = Field< double >::get( sl[1], "diameter" );
266  double origLen = Field< double >::get( sl[1], "length" );
268  sl[1], "setGeomAndElec", len, origDia );
269  // Here we've set the electrical and geometrical stuff. Now to
270  // do the diffusion.
271  // Assume the scaleDiffusion function propagates changes into the
272  // VoxelJunctions used by the Dsolve.
273  parent_->scaleHeadDiffusion( e.fieldIndex(), len, origDia );
274  // Now scale the chem stuff. The PSD mesh is assumed to scale only
275  // with top surface area of head, so it is not affected here.
276  parent_->scaleBufAndRates( e.fieldIndex(), len/origLen, 1.0 );
277  }
278 }
const Neuron * parent_
Definition: Spine.h:78
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
unsigned int fieldIndex() const
Definition: Eref.h:61
const vector< Id > & spineIds(unsigned int index) const
Definition: Neuron.cpp:2047
double maximumSize_
Definition: Spine.h:86
double minimumSize_
Definition: Spine.h:85
static A get(const ObjId &dest, const string &field)
Definition: SetGet.h:284
void scaleBufAndRates(unsigned int spineNum, double lenScale, double diaScale) const
Definition: Neuron.cpp:2055
static bool set(const ObjId &dest, const string &field, A1 arg1, A2 arg2)
Definition: SetGet.h:365

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Spine::setHeadVolume ( const Eref e,
double  vol 
)

Definition at line 332 of file Spine.cpp.

References Eref::fieldIndex(), Field< A >::get(), maximumSize_, minimumSize_, parent_, PI, Neuron::scaleBufAndRates(), Neuron::scaleHeadDiffusion(), SetGet2< A1, A2 >::set(), and Neuron::spineIds().

Referenced by initCinfo().

333 {
334  if ( volume < 0 )
335  volume = 0.0;
336  double dia = pow( volume * 4.0 / PI, 1.0/3.0 );
337  if ( dia < minimumSize_ )
338  volume = pow( minimumSize_, 3.0 ) * PI / 4.0;
339  else if ( dia > maximumSize_ )
340  volume = pow( maximumSize_, 3.0 ) * PI / 4.0;
341 
342  vector< Id > sl = parent_->spineIds( e.fieldIndex() );
343  if ( sl.size() > 1 &&
344  sl[0].element()->cinfo()->isA( "CompartmentBase") )
345  {
346  double origLen = Field< double >::get( sl[1], "length" );
347  double origDia = Field< double >::get( sl[1], "diameter" );
348  double oldVolume = origLen * origDia * origDia * PI / 4.0;
349  double ratio = pow( volume / oldVolume, 1.0/3.0 );
350 
352  sl[1], "setGeomAndElec", origLen * ratio, origDia * ratio );
353  parent_->scaleHeadDiffusion( e.fieldIndex(), origLen * ratio, origDia * ratio );
354  parent_->scaleBufAndRates( e.fieldIndex(), ratio, ratio );
355  }
356 }
const Neuron * parent_
Definition: Spine.h:78
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
unsigned int fieldIndex() const
Definition: Eref.h:61
const vector< Id > & spineIds(unsigned int index) const
Definition: Neuron.cpp:2047
double maximumSize_
Definition: Spine.h:86
const double PI
Definition: consts.cpp:12
double minimumSize_
Definition: Spine.h:85
static A get(const ObjId &dest, const string &field)
Definition: SetGet.h:284
void scaleBufAndRates(unsigned int spineNum, double lenScale, double diaScale) const
Definition: Neuron.cpp:2055
static bool set(const ObjId &dest, const string &field, A1 arg1, A2 arg2)
Definition: SetGet.h:365

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Spine::setInclination ( const Eref e,
double  phi 
)

Definition at line 396 of file Spine.cpp.

Referenced by initCinfo().

397 {
398  ;
399 }

+ Here is the caller graph for this function:

void Spine::setMaximumSize ( const Eref e,
double  len 
)

Definition at line 416 of file Spine.cpp.

References maximumSize_.

Referenced by initCinfo().

417 {
418  maximumSize_ = len;
419 }
double maximumSize_
Definition: Spine.h:86

+ Here is the caller graph for this function:

void Spine::setMinimumSize ( const Eref e,
double  len 
)

Definition at line 406 of file Spine.cpp.

References minimumSize_.

Referenced by initCinfo().

407 {
408  minimumSize_ = len;
409 }
double minimumSize_
Definition: Spine.h:85

+ Here is the caller graph for this function:

void Spine::setPsdArea ( const Eref e,
double  area 
)

Definition at line 315 of file Spine.cpp.

References minimumSize_, PI, and setHeadDiameter().

Referenced by initCinfo().

316 {
317  if ( area < 0 ) {
319  } else {
320  double dia = 2.0 * sqrt( area / PI );
321  setHeadDiameter( e, dia );
322  }
323 }
const double PI
Definition: consts.cpp:12
double minimumSize_
Definition: Spine.h:85
void setHeadDiameter(const Eref &e, double dia)
Definition: Spine.cpp:289

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Spine::setShaftDiameter ( const Eref e,
double  dia 
)

Definition at line 226 of file Spine.cpp.

References Eref::fieldIndex(), Field< A >::get(), maximumSize_, minimumSize_, parent_, Neuron::scaleShaftDiffusion(), SetGet2< A1, A2 >::set(), and Neuron::spineIds().

Referenced by initCinfo().

227 {
228  if ( dia < minimumSize_ )
229  dia = minimumSize_;
230  else if ( dia > maximumSize_ )
231  dia = maximumSize_;
232 
233  vector< Id > sl = parent_->spineIds( e.fieldIndex() );
234  if ( sl.size() > 1 &&
235  sl[0].element()->cinfo()->isA( "CompartmentBase") )
236  {
237  double origLen = Field< double >::get( sl[0], "length" );
239  sl[0], "setGeomAndElec", origLen, dia );
240  // Dia is changing, leave the coords alone.
241  parent_->scaleShaftDiffusion( e.fieldIndex(), origLen, dia );
242  }
243 }
const Neuron * parent_
Definition: Spine.h:78
unsigned int fieldIndex() const
Definition: Eref.h:61
const vector< Id > & spineIds(unsigned int index) const
Definition: Neuron.cpp:2047
double maximumSize_
Definition: Spine.h:86
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 minimumSize_
Definition: Spine.h:85
static A get(const ObjId &dest, const string &field)
Definition: SetGet.h:284
static bool set(const ObjId &dest, const string &field, A1 arg1, A2 arg2)
Definition: SetGet.h:365

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Spine::setShaftLength ( const Eref e,
double  len 
)

Definition at line 185 of file Spine.cpp.

References Eref::fieldIndex(), Field< A >::get(), maximumSize_, minimumSize_, parent_, Neuron::scaleShaftDiffusion(), SetGet2< A1, A2 >::set(), SetGet3< A1, A2, A3 >::set(), and Neuron::spineIds().

Referenced by initCinfo(), and setTotalLength().

186 {
187  if ( len < minimumSize_ )
188  len = minimumSize_;
189  else if ( len > maximumSize_ )
190  len = maximumSize_;
191  vector< Id > sl = parent_->spineIds( e.fieldIndex() );
192  if ( sl.size() > 1 &&
193  sl[0].element()->cinfo()->isA( "CompartmentBase" ) )
194  {
195  double origDia = Field< double >::get( sl[0], "diameter" );
196  double dx = Field< double >::get( sl[0], "x" );
197  double dy = Field< double >::get( sl[0], "y" );
198  double dz = Field< double >::get( sl[0], "z" );
200  sl[0], "setGeomAndElec", len, origDia );
201 
202  dx = Field< double >::get( sl[0], "x" ) - dx;
203  dy = Field< double >::get( sl[0], "y" ) - dy;
204  dz = Field< double >::get( sl[0], "z" ) - dz;
205 
206  SetGet3< double, double, double >::set( sl[1], "displace",
207  dx, dy, dz );
208  // Here we've set the electrical and geometrical stuff. Now to
209  // do the diffusion. Chem doesn't come into the picture for the
210  // spine shaft.
211  // Assume the scaleDiffusion function propagates changes into the
212  // VoxelJunctions used by the Dsolve.
213  parent_->scaleShaftDiffusion( e.fieldIndex(), len, origDia );
214  }
215 }
const Neuron * parent_
Definition: Spine.h:78
unsigned int fieldIndex() const
Definition: Eref.h:61
const vector< Id > & spineIds(unsigned int index) const
Definition: Neuron.cpp:2047
double maximumSize_
Definition: Spine.h:86
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
static bool set(const ObjId &dest, const string &field, A1 arg1, A2 arg2, A3 arg3)
Definition: SetGet.h:626
double minimumSize_
Definition: Spine.h:85
static A get(const ObjId &dest, const string &field)
Definition: SetGet.h:284
static bool set(const ObjId &dest, const string &field, A1 arg1, A2 arg2)
Definition: SetGet.h:365

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Spine::setTotalLength ( const Eref e,
double  len 
)

Don't set this if either of them is out of range.

Definition at line 363 of file Spine.cpp.

References getHeadLength(), getShaftLength(), maximumSize_, setHeadLength(), and setShaftLength().

Referenced by initCinfo().

364 {
365  double shaftLen = getShaftLength( e );
366  double headLen = getHeadLength( e );
367  double totLen = shaftLen + headLen;
368 
369  shaftLen *= len / totLen;
370  headLen *= len / totLen;
371 
373  if ( shaftLen < minimumSize_ || shaftLen > maximumSize_ ||
374  headLen < minimumSize_ || headLen > maximumSize_ )
375  return;
376 
377  setShaftLength( e, shaftLen );
378  setHeadLength( e, headLen );
379 }
void setShaftLength(const Eref &e, double len)
Definition: Spine.cpp:185
double maximumSize_
Definition: Spine.h:86
void setHeadLength(const Eref &e, double len)
Definition: Spine.cpp:254
double getShaftLength(const Eref &e) const
Definition: Spine.cpp:176
double getHeadLength(const Eref &e) const
Definition: Spine.cpp:245

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

double Spine::maximumSize_
private
double Spine::minimumSize_
private

Used as a sanity check for assigning dimensions, to avoid unreasonable physiological values. Defaults to 20 nanometers, which is somewhat smaller than the 30 nm size estimated for synaptic vesicles.

Definition at line 85 of file Spine.h.

Referenced by getMinimumSize(), setHeadDiameter(), setHeadLength(), setHeadVolume(), setMinimumSize(), setPsdArea(), setShaftDiameter(), and setShaftLength().


The documentation for this class was generated from the following files: