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

#include <SpineEntry.h>

+ Collaboration diagram for SpineEntry:

Public Member Functions

void apex (double &x, double &y, double &z) const
 Return coords of middle of PSD. More...
 
double diffusionLength () const
 
unsigned int fid () const
 Returns index of self. Only a single voxel. More...
 
double headArea () const
 
Id headId () const
 Returns Id of shaft electrical compartment. More...
 
void matchCubeMeshEntries (const ChemCompt *other, unsigned int myIndex, double granularity, vector< VoxelJunction > &ret)
 
void matchCubeMeshEntriesToHead (const ChemCompt *compt, unsigned int myIndex, double granularity, vector< VoxelJunction > &ret) const
 Returns Id of head electrical compartment. More...
 
void matchCubeMeshEntriesToPSD (const ChemCompt *compt, unsigned int myIndex, double granularity, vector< VoxelJunction > &ret) const
 
unsigned int matchNeuroMeshEntriesToShaft (const ChemCompt *compt, unsigned int myIndex, double &area, double &length) const
 
void mid (double &x, double &y, double &z) const
 Return coords of centre of spine head. More...
 
unsigned int parent () const
 Returns index of parent entry located on NeuroMesh. More...
 
void positionShaftBase (double x, double y, double z)
 
vector< double > psdCoords () const
 
double rootArea () const
 
void setParent (unsigned int parent)
 Assigns index of parent entry located on NeuroMesh. More...
 
void setVolume (double volume)
 
Id shaftId () const
 
 SpineEntry (Id shaft, Id head, unsigned int parent)
 
 SpineEntry ()
 
double volume () const
 Return volume of spine. Ignores shaft volume. Virtual func. More...
 

Private Attributes

CylBase head_
 Shaft cylinder. More...
 
Id headId_
 
unsigned int parent_
 head cylinder. More...
 
CylBase root_
 
CylBase shaft_
 Anchor point on dendrite. More...
 
Id shaftId_
 Id of electrical compartment in which this diffusive compt lives. More...
 

Detailed Description

Helper class for the SpineMesh. Defines a single spine.

Definition at line 17 of file SpineEntry.h.

Constructor & Destructor Documentation

SpineEntry::SpineEntry ( Id  shaft,
Id  head,
unsigned int  parent 
)

This builds the node using info from the compartment.

Helper class for the SpineMesh. Defines the geometry of the spine and provides the innter function for mapping to CubeMeshes.

Definition at line 24 of file SpineEntry.cpp.

References Field< A >::get(), head_, root_, CylBase::setDia(), CylBase::setIsCylinder(), CylBase::setLength(), CylBase::setNumDivs(), CylBase::setX(), CylBase::setY(), CylBase::setZ(), and shaft_.

25  :
26  parent_( parent ),
27  shaftId_( shaft ),
28  headId_( head )
29 {
30  double dia = Field< double >::get( shaft, "diameter" );
31  double length = Field< double >::get( shaft, "length" );
32  double x0 = Field< double >::get( shaft, "x0" );
33  double y0 = Field< double >::get( shaft, "y0" );
34  double z0 = Field< double >::get( shaft, "z0" );
35  double x1 = Field< double >::get( shaft, "x" );
36  double y1 = Field< double >::get( shaft, "y" );
37  double z1 = Field< double >::get( shaft, "z" );
38  double x2 = Field< double >::get( head, "x" );
39  double y2 = Field< double >::get( head, "y" );
40  double z2 = Field< double >::get( head, "z" );
41  double hdia = Field< double >::get( head, "diameter" );
42  double hlength = Field< double >::get( head, "length" );
43 
44  // cout << "SpineEntry: " << parent_ << " " << x0 << " " << x1 << " " << x2 << " : " << y0 << " " << y1<< " " << y2 << " : " << z0 << " " << z1 << " " << z2 << " " << hdia << endl;
45 
46  root_.setX( x0 );
47  root_.setY( y0 );
48  root_.setZ( z0 );
49  shaft_.setX( x1 );
50  shaft_.setY( y1 );
51  shaft_.setZ( z1 );
52  head_.setX( x2 );
53  head_.setY( y2 );
54  head_.setZ( z2 );
55 
56  root_.setDia( dia );
57  root_.setLength( length );
58  root_.setNumDivs( 0 );
59  root_.setIsCylinder( true );
60  shaft_.setDia( dia );
61  shaft_.setLength( length );
62  shaft_.setNumDivs( 1 );
63  shaft_.setIsCylinder( true );
64  head_.setDia( hdia );
65  head_.setLength( hlength );
66  head_.setNumDivs( 1 );
67  head_.setIsCylinder( true );
68 }
unsigned int parent_
head cylinder.
Definition: SpineEntry.h:110
void setNumDivs(unsigned int v)
Definition: CylBase.cpp:103
CylBase head_
Shaft cylinder.
Definition: SpineEntry.h:106
Id shaftId_
Id of electrical compartment in which this diffusive compt lives.
Definition: SpineEntry.h:113
unsigned int parent() const
Returns index of parent entry located on NeuroMesh.
Definition: SpineEntry.cpp:104
CylBase root_
Definition: SpineEntry.h:104
void setX(double v)
Definition: CylBase.cpp:53
void setLength(double v)
Definition: CylBase.cpp:93
CylBase shaft_
Anchor point on dendrite.
Definition: SpineEntry.h:105
void setZ(double v)
Definition: CylBase.cpp:73
void setIsCylinder(bool v)
Definition: CylBase.cpp:113
void setY(double v)
Definition: CylBase.cpp:63
void setDia(double v)
Definition: CylBase.cpp:83
static A get(const ObjId &dest, const string &field)
Definition: SetGet.h:284

+ Here is the call graph for this function:

SpineEntry::SpineEntry ( )

Empty constructor for vectors

Definition at line 71 of file SpineEntry.cpp.

References head_, root_, CylBase::setDia(), CylBase::setIsCylinder(), CylBase::setLength(), CylBase::setNumDivs(), CylBase::setX(), CylBase::setY(), CylBase::setZ(), and shaft_.

72  :
73  parent_( 0 ),
74  shaftId_( Id() ),
75  headId_( Id() )
76 {
77  const double defaultLength = 1e-6;
78  root_.setX( 0 );
79  root_.setY( 0 );
80  root_.setZ( 0 );
81  shaft_.setX( defaultLength );
82  shaft_.setY( 0 );
83  shaft_.setZ( 0 );
84  head_.setX( defaultLength * 2 );
85  head_.setY( 0 );
86  head_.setZ( 0 );
87 
88 
89 
90  root_.setDia( defaultLength );
91  root_.setLength( defaultLength );
92  root_.setNumDivs( 0 );
93  root_.setIsCylinder( true );
94  shaft_.setDia( defaultLength );
95  shaft_.setLength( defaultLength );
96  shaft_.setNumDivs( 1 );
97  shaft_.setIsCylinder( true );
98  head_.setDia( defaultLength );
99  head_.setLength( defaultLength );
100  head_.setNumDivs( 1 );
101  head_.setIsCylinder( true );
102 }
unsigned int parent_
head cylinder.
Definition: SpineEntry.h:110
void setNumDivs(unsigned int v)
Definition: CylBase.cpp:103
CylBase head_
Shaft cylinder.
Definition: SpineEntry.h:106
Id shaftId_
Id of electrical compartment in which this diffusive compt lives.
Definition: SpineEntry.h:113
CylBase root_
Definition: SpineEntry.h:104
void setX(double v)
Definition: CylBase.cpp:53
void setLength(double v)
Definition: CylBase.cpp:93
CylBase shaft_
Anchor point on dendrite.
Definition: SpineEntry.h:105
void setZ(double v)
Definition: CylBase.cpp:73
void setIsCylinder(bool v)
Definition: CylBase.cpp:113
void setY(double v)
Definition: CylBase.cpp:63
void setDia(double v)
Definition: CylBase.cpp:83
Definition: Id.h:17

+ Here is the call graph for this function:

Member Function Documentation

void SpineEntry::apex ( double &  x,
double &  y,
double &  z 
) const

Return coords of middle of PSD.

double SpineEntry::diffusionLength ( ) const

Definition at line 179 of file SpineEntry.cpp.

References CylBase::getLength(), and shaft_.

180 {
181  // I've simplified this because a) it doesn't make much sense to add
182  // a diffusion length with a different axial size and b) it makes the
183  // resizing hugely complicated.
184  // return shaft_.getLength() + 0.5 * head_.getLength();
185  return shaft_.getLength();
186 }
double getLength() const
Definition: CylBase.cpp:98
CylBase shaft_
Anchor point on dendrite.
Definition: SpineEntry.h:105

+ Here is the call graph for this function:

unsigned int SpineEntry::fid ( ) const

Returns index of self. Only a single voxel.

double SpineEntry::headArea ( ) const
Id SpineEntry::headId ( ) const

Returns Id of shaft electrical compartment.

Definition at line 114 of file SpineEntry.cpp.

References headId_.

115 {
116  return headId_;
117 }
void SpineEntry::matchCubeMeshEntries ( const ChemCompt other,
unsigned int  myIndex,
double  granularity,
vector< VoxelJunction > &  ret 
)

Definition at line 131 of file SpineEntry.cpp.

References head_, CylBase::matchCubeMeshEntries(), and shaft_.

134 {
135  // First flag is for curve, second is for cap of cylinder.
136  head_.matchCubeMeshEntries( compt, shaft_, myIndex,
137  granularity, ret, true, true );
138 }
CylBase head_
Shaft cylinder.
Definition: SpineEntry.h:106
CylBase shaft_
Anchor point on dendrite.
Definition: SpineEntry.h:105
void matchCubeMeshEntries(const ChemCompt *other, const CylBase &parent, unsigned int startIndex, double granularity, vector< VoxelJunction > &ret, bool useCylinderCurve, bool useCylinderCap) const
Definition: CylBase.cpp:320

+ Here is the call graph for this function:

void SpineEntry::matchCubeMeshEntriesToHead ( const ChemCompt compt,
unsigned int  myIndex,
double  granularity,
vector< VoxelJunction > &  ret 
) const

Returns Id of head electrical compartment.

Generate list of matching CubeMesh entries to the single Head entry.

Definition at line 145 of file SpineEntry.cpp.

References head_, CylBase::matchCubeMeshEntries(), and shaft_.

Referenced by SpineMesh::matchCubeMeshEntries().

148 {
149  head_.matchCubeMeshEntries( compt, shaft_, myIndex,
150  granularity, ret, true, false );
151 }
CylBase head_
Shaft cylinder.
Definition: SpineEntry.h:106
CylBase shaft_
Anchor point on dendrite.
Definition: SpineEntry.h:105
void matchCubeMeshEntries(const ChemCompt *other, const CylBase &parent, unsigned int startIndex, double granularity, vector< VoxelJunction > &ret, bool useCylinderCurve, bool useCylinderCap) const
Definition: CylBase.cpp:320

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void SpineEntry::matchCubeMeshEntriesToPSD ( const ChemCompt compt,
unsigned int  myIndex,
double  granularity,
vector< VoxelJunction > &  ret 
) const

Generate list of matching CubeMeshEntries to the single PSD.

Definition at line 153 of file SpineEntry.cpp.

References head_, CylBase::matchCubeMeshEntries(), and shaft_.

156 {
157  // First flag is for curve, second is for cap of cylinder.
158  head_.matchCubeMeshEntries( compt, shaft_, myIndex,
159  granularity, ret, false, true );
160 }
CylBase head_
Shaft cylinder.
Definition: SpineEntry.h:106
CylBase shaft_
Anchor point on dendrite.
Definition: SpineEntry.h:105
void matchCubeMeshEntries(const ChemCompt *other, const CylBase &parent, unsigned int startIndex, double granularity, vector< VoxelJunction > &ret, bool useCylinderCurve, bool useCylinderCap) const
Definition: CylBase.cpp:320

+ Here is the call graph for this function:

unsigned int SpineEntry::matchNeuroMeshEntriesToShaft ( const ChemCompt compt,
unsigned int  myIndex,
double &  area,
double &  length 
) const

Find the matching matching NeuroMesh entry index to the root of the shaft of this spine. Also compute the area and diffusion length of the shaft.

Find the matching NeuroMesh entry index to the root of the shaft of this spine. Also compute the area and diffusion length of the shaft.

Definition at line 167 of file SpineEntry.cpp.

170 {
171  return 0;
172 }
void SpineEntry::mid ( double &  x,
double &  y,
double &  z 
) const

Return coords of centre of spine head.

Definition at line 124 of file SpineEntry.cpp.

References CylBase::getX(), CylBase::getY(), CylBase::getZ(), head_, and shaft_.

Referenced by SpineMesh::nearest(), and psdCoords().

125 {
126  x = ( shaft_.getX() + head_.getX() ) / 2.0;
127  y = ( shaft_.getY() + head_.getY() ) / 2.0;
128  z = ( shaft_.getZ() + head_.getZ() ) / 2.0;
129 }
CylBase head_
Shaft cylinder.
Definition: SpineEntry.h:106
double getX() const
Definition: CylBase.cpp:58
double getY() const
Definition: CylBase.cpp:68
CylBase shaft_
Anchor point on dendrite.
Definition: SpineEntry.h:105
double getZ() const
Definition: CylBase.cpp:78

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

unsigned int SpineEntry::parent ( ) const

Returns index of parent entry located on NeuroMesh.

Definition at line 104 of file SpineEntry.cpp.

References parent_.

Referenced by setParent().

105 {
106  return parent_;
107 }
unsigned int parent_
head cylinder.
Definition: SpineEntry.h:110

+ Here is the caller graph for this function:

void SpineEntry::positionShaftBase ( double  x,
double  y,
double  z 
)

moves Spine entry so that shaft base is now positioned at xyz.

Definition at line 230 of file SpineEntry.cpp.

References CylBase::getX(), CylBase::getY(), CylBase::getZ(), head_, root_, CylBase::setX(), CylBase::setY(), CylBase::setZ(), and shaft_.

231 {
232  double dx = x - root_.getX();
233  double dy = y - root_.getY();
234  double dz = y - root_.getZ();
235  root_.setX( x );
236  root_.setY( y );
237  root_.setZ( z );
238  shaft_.setX( dx + shaft_.getX() );
239  shaft_.setY( dy + shaft_.getY() );
240  shaft_.setZ( dz + shaft_.getZ() );
241  head_.setX( dx + head_.getX() );
242  head_.setY( dy + head_.getY() );
243  head_.setZ( dz + head_.getZ() );
244 }
CylBase head_
Shaft cylinder.
Definition: SpineEntry.h:106
CylBase root_
Definition: SpineEntry.h:104
void setX(double v)
Definition: CylBase.cpp:53
double getX() const
Definition: CylBase.cpp:58
double getY() const
Definition: CylBase.cpp:68
CylBase shaft_
Anchor point on dendrite.
Definition: SpineEntry.h:105
void setZ(double v)
Definition: CylBase.cpp:73
void setY(double v)
Definition: CylBase.cpp:63
double getZ() const
Definition: CylBase.cpp:78

+ Here is the call graph for this function:

vector< double > SpineEntry::psdCoords ( ) const

psdCoords is used to build the PsdMesh. The function returns 8 coords to define the psd: centre xyz direction xyz dia, diffusion distance to middle of spine Head.

Definition at line 188 of file SpineEntry.cpp.

References CylBase::getDia(), CylBase::getX(), CylBase::getY(), CylBase::getZ(), head_, and mid().

Referenced by NeuroMesh::transmitSpineInfo().

189 {
190  vector< double > ret( 8, 0.0 );
191  double m0, m1, m2;
192  mid( m0, m1, m2 );
193  ret[0] = m0;
194  ret[1] = m1;
195  ret[2] = m2;
196  ret[3] = head_.getX() - m0;
197  ret[4] = head_.getY() - m1;
198  ret[5] = head_.getZ() - m2;
199  /*
200  ret[0] = head_.getX();
201  ret[1] = head_.getY();
202  ret[2] = head_.getZ();
203  double m0, m1, m2;
204  mid( m0, m1, m2 );
205  ret[3] = ret[0] - m0;
206  ret[4] = ret[1] - m1;
207  ret[5] = ret[2] - m2;
208  */
209  ret[6] = head_.getDia();
210  ret[7] = sqrt( ret[3] * ret[3] + ret[4] * ret[4] + ret[5] * ret[5] );
211 
212  return ret;
213 }
CylBase head_
Shaft cylinder.
Definition: SpineEntry.h:106
double getX() const
Definition: CylBase.cpp:58
void mid(double &x, double &y, double &z) const
Return coords of centre of spine head.
Definition: SpineEntry.cpp:124
double getY() const
Definition: CylBase.cpp:68
double getDia() const
Definition: CylBase.cpp:88
double getZ() const
Definition: CylBase.cpp:78

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double SpineEntry::rootArea ( ) const

Definition at line 174 of file SpineEntry.cpp.

References CylBase::getDia(), PI, and root_.

175 {
176  return root_.getDia() * root_.getDia() * PI * 0.25;
177 }
CylBase root_
Definition: SpineEntry.h:104
double getDia() const
Definition: CylBase.cpp:88
const double PI
Definition: consts.cpp:12

+ Here is the call graph for this function:

void SpineEntry::setParent ( unsigned int  parent)

Assigns index of parent entry located on NeuroMesh.

Definition at line 119 of file SpineEntry.cpp.

References parent(), and parent_.

120 {
121  parent_ = parent;
122 }
unsigned int parent_
head cylinder.
Definition: SpineEntry.h:110
unsigned int parent() const
Returns index of parent entry located on NeuroMesh.
Definition: SpineEntry.cpp:104

+ Here is the call graph for this function:

void SpineEntry::setVolume ( double  volume)

Resizes SpineEntry. Takes original shaft base and scales up from there. Retains original shaft dimensions, only the head is scaled.

Definition at line 216 of file SpineEntry.cpp.

References CylBase::getDia(), CylBase::getLength(), CylBase::getX(), CylBase::getY(), CylBase::getZ(), head_, CylBase::setDia(), CylBase::setLength(), CylBase::setX(), CylBase::setY(), CylBase::setZ(), shaft_, and CylBase::volume().

217 {
218  double volscale = volume / head_.volume( shaft_ );
219  double linscale = pow( volscale, 1.0 / 3.0 );
220  head_.setLength( head_.getLength() * linscale );
221  head_.setDia( head_.getDia() * linscale );
222  double dx = head_.getX() - shaft_.getX();
223  double dy = head_.getY() - shaft_.getY();
224  double dz = head_.getZ() - shaft_.getZ();
225  head_.setX( dx * linscale + shaft_.getX() );
226  head_.setY( dy * linscale + shaft_.getY() );
227  head_.setZ( dz * linscale + shaft_.getZ() );
228 }
double getLength() const
Definition: CylBase.cpp:98
CylBase head_
Shaft cylinder.
Definition: SpineEntry.h:106
double volume() const
Return volume of spine. Ignores shaft volume. Virtual func.
Definition: SpineEntry.cpp:140
void setX(double v)
Definition: CylBase.cpp:53
double getX() const
Definition: CylBase.cpp:58
double volume(const CylBase &parent) const
Returns vol of current node. Usually needs to refer to parent.
Definition: CylBase.cpp:135
void setLength(double v)
Definition: CylBase.cpp:93
double getY() const
Definition: CylBase.cpp:68
CylBase shaft_
Anchor point on dendrite.
Definition: SpineEntry.h:105
void setZ(double v)
Definition: CylBase.cpp:73
void setY(double v)
Definition: CylBase.cpp:63
double getDia() const
Definition: CylBase.cpp:88
double getZ() const
Definition: CylBase.cpp:78
void setDia(double v)
Definition: CylBase.cpp:83

+ Here is the call graph for this function:

Id SpineEntry::shaftId ( ) const

Definition at line 109 of file SpineEntry.cpp.

References shaftId_.

110 {
111  return shaftId_;
112 }
Id shaftId_
Id of electrical compartment in which this diffusive compt lives.
Definition: SpineEntry.h:113
double SpineEntry::volume ( ) const

Return volume of spine. Ignores shaft volume. Virtual func.

Definition at line 140 of file SpineEntry.cpp.

References head_, shaft_, and CylBase::volume().

141 {
142  return head_.volume( shaft_ );
143 }
CylBase head_
Shaft cylinder.
Definition: SpineEntry.h:106
double volume(const CylBase &parent) const
Returns vol of current node. Usually needs to refer to parent.
Definition: CylBase.cpp:135
CylBase shaft_
Anchor point on dendrite.
Definition: SpineEntry.h:105

+ Here is the call graph for this function:

Member Data Documentation

CylBase SpineEntry::head_
private
Id SpineEntry::headId_
private

Definition at line 114 of file SpineEntry.h.

Referenced by headId().

unsigned int SpineEntry::parent_
private

head cylinder.

Index of parent entry on NeuroMesh.

Definition at line 110 of file SpineEntry.h.

Referenced by parent(), and setParent().

CylBase SpineEntry::root_
private

Definition at line 104 of file SpineEntry.h.

Referenced by positionShaftBase(), rootArea(), and SpineEntry().

CylBase SpineEntry::shaft_
private
Id SpineEntry::shaftId_
private

Id of electrical compartment in which this diffusive compt lives.

Definition at line 113 of file SpineEntry.h.

Referenced by shaftId().


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