12 #include "../utility/Vec.h"
24 "Length of spine shaft.",
30 "Diameter of spine shaft.",
36 "Length of spine head.",
42 "Diameter of spine head, and also the diameter of the PSD. ",
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 "
52 "This is useful to scale # of surface molecules on the PSD. ",
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. ",
69 "Length of entire spine. Scales both the length of the shaft "
70 "and of the spine head, without changing any of the diameters.",
76 "Angle of spine around shaft. Longitude. 0 is away from soma. "
77 "Not yet implemented. ",
83 "inclination of spine with ref to shaft. Normal is 0. "
84 "Not yet activated. ",
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. ",
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. ",
121 static Finfo* spineFinfos[] = {
131 static string doc[] =
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. "
145 sizeof( spineFinfos ) /
sizeof (
Finfo* ),
148 sizeof(doc)/
sizeof(
string ),
162 minimumSize_( 20.0e-9 ),
163 maximumSize_( 10.0e-6 )
168 minimumSize_( 20.0e-9 ),
169 maximumSize_( 10.0e-6 )
179 if ( sl.size() > 0 &&
180 sl[0].element()->cinfo()->isA(
"CompartmentBase" ) )
192 if ( sl.size() > 1 &&
193 sl[0].element()->cinfo()->isA(
"CompartmentBase" ) )
200 sl[0],
"setGeomAndElec", len, origDia );
220 if ( sl.size() > 0 &&
221 sl[0].element()->cinfo()->isA(
"CompartmentBase" ) )
234 if ( sl.size() > 1 &&
235 sl[0].element()->cinfo()->isA(
"CompartmentBase") )
239 sl[0],
"setGeomAndElec", origLen, dia );
248 if ( sl.size() > 1 &&
249 sl[1].element()->cinfo()->isA(
"CompartmentBase" ) )
262 if ( sl.size() > 1 &&
263 sl[1].element()->cinfo()->isA(
"CompartmentBase") )
268 sl[1],
"setGeomAndElec", len, origDia );
283 if ( sl.size() > 1 &&
284 sl[1].element()->cinfo()->isA(
"CompartmentBase" ) )
296 if ( sl.size() > 1 &&
297 sl[0].element()->cinfo()->isA(
"CompartmentBase") )
302 sl[1],
"setGeomAndElec", origLen, dia );
312 return ret * ret *
PI / 4.0;
320 double dia = 2.0 * sqrt( area /
PI );
336 double dia = pow( volume * 4.0 /
PI, 1.0/3.0 );
343 if ( sl.size() > 1 &&
344 sl[0].element()->cinfo()->isA(
"CompartmentBase") )
348 double oldVolume = origLen * origDia * origDia *
PI / 4.0;
349 double ratio = pow( volume / oldVolume, 1.0/3.0 );
352 sl[1],
"setGeomAndElec", origLen * ratio, origDia * ratio );
367 double totLen = shaftLen + headLen;
369 shaftLen *= len / totLen;
370 headLen *= len / totLen;
373 if ( shaftLen < minimumSize_ || shaftLen >
maximumSize_ ||
static const Cinfo * spineCinfo
double getHeadDiameter(const Eref &e) const
void setMaximumSize(const Eref &e, double len)
void scaleHeadDiffusion(unsigned int spineNum, double len, double dia) const
Scale the diffusion parameters due to a change in the head dimensions.
double getHeadVolume(const Eref &e) const
double getInclination(const Eref &e) const
double getMinimumSize(const Eref &e) const
double getShaftDiameter(const Eref &e) const
unsigned int fieldIndex() const
void setShaftLength(const Eref &e, double len)
void setMinimumSize(const Eref &e, double len)
const vector< Id > & spineIds(unsigned int index) const
void setAngle(const Eref &e, double theta)
void setInclination(const Eref &e, double phi)
static const Cinfo * initCinfo()
void setPsdArea(const Eref &e, double area)
void scaleShaftDiffusion(unsigned int spineNum, double len, double dia) const
Scale the diffusion parameters due to a change in the shaft dimensions.
void setShaftDiameter(const Eref &e, double dia)
double getAngle(const Eref &e) const
double getTotalLength(const Eref &e) const
void setHeadLength(const Eref &e, double len)
double getPsdArea(const Eref &e) const
double getMaximumSize(const Eref &e) const
static bool set(const ObjId &dest, const string &field, A1 arg1, A2 arg2, A3 arg3)
static A get(const ObjId &dest, const string &field)
static const Cinfo * initCinfo()
void setHeadVolume(const Eref &e, double vol)
void setHeadDiameter(const Eref &e, double dia)
double getShaftLength(const Eref &e) const
void scaleBufAndRates(unsigned int spineNum, double lenScale, double diaScale) const
void setTotalLength(const Eref &e, double len)
double getHeadLength(const Eref &e) const
static bool set(const ObjId &dest, const string &field, A1 arg1, A2 arg2)