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

#include <SwcSegment.h>

+ Inheritance diagram for SwcSegment:
+ Collaboration diagram for SwcSegment:

Public Member Functions

void addChild (unsigned int kid)
 
double distance (const SwcSegment &other) const
 
void figureOutType ()
 
double getElecDistFromSoma () const
 
double getGeomDistFromSoma () const
 
double getPathDistFromSoma () const
 
const vector< int > & kids () const
 
double L () const
 
double length () const
 
unsigned int myIndex () const
 
bool OK () const
 
unsigned int parent () const
 
double radius () const
 
void replaceKids (const vector< int > &kids)
 
void setBad ()
 
void setCumulativeDistance (double len, double L, double pSoma, double eSoma)
 
void setGeometricalDistanceFromSoma (const SwcSegment &soma)
 
void setParent (unsigned int pa)
 
 SwcSegment ()
 
 SwcSegment (const string &line)
 
 SwcSegment (int i, short type, double x, double y, double z, double r, int parent)
 
unsigned short type () const
 
const Vec & vec () const
 

Static Public Attributes

static const short APICAL = 4
 
static const short APICAL_END = 13
 
static const short APICAL_FORK = 12
 
static const short AXON = 2
 
static const short AXON_END = 11
 
static const short AXON_FORK = 10
 
static const short BadSegment = 8
 
static const short CUSTOM = 7
 
static const short DEND = 3
 
static const short END = 6
 
static const short FORK = 5
 
static const short SOMA = 1
 
static const string typeName []
 
static const short UNDEF = 0
 

Protected Attributes

double electrotonicDistanceFromSoma_
 electrotonic dist from soma, summed along dend. More...
 
double geometricalDistanceFromSoma_
 geometrical distance from soma. More...
 
vector< int > kids_
 
double L_
 Length of segment. More...
 
double length_
 Radius of segment. More...
 
unsigned int myIndex_
 
unsigned int parent_
 Number of length constants in segment. More...
 
double pathDistanceFromSoma_
 Index of parent. Is ~0 for soma. More...
 
double radius_
 coordinates of end of segment More...
 
short type_
 Index of self. More...
 
Vec v_
 

Detailed Description

This defines a single segment in an SWC file used in NeuroMorpho Note that this is not going to work well for dendritic spines which come off in the middle of a parent compartment, and which have to be started from the surface rather than the axis of the dendrite.

Definition at line 18 of file SwcSegment.h.

Constructor & Destructor Documentation

SwcSegment::SwcSegment ( )
inline

Definition at line 21 of file SwcSegment.h.

22  : myIndex_( 0 ), type_( 0 ), radius_( 0.0 ),
23  length_( 0.0 ), L_( 0.0 ),
24  parent_( ~0U ),
27  {;}
double electrotonicDistanceFromSoma_
electrotonic dist from soma, summed along dend.
Definition: SwcSegment.h:167
unsigned int myIndex_
Definition: SwcSegment.h:140
double L_
Length of segment.
Definition: SwcSegment.h:157
double length_
Radius of segment.
Definition: SwcSegment.h:156
double radius_
coordinates of end of segment
Definition: SwcSegment.h:155
short type_
Index of self.
Definition: SwcSegment.h:153
unsigned int parent_
Number of length constants in segment.
Definition: SwcSegment.h:158
double geometricalDistanceFromSoma_
geometrical distance from soma.
Definition: SwcSegment.h:164
SwcSegment::SwcSegment ( const string &  line)
SwcSegment::SwcSegment ( int  i,
short  type,
double  x,
double  y,
double  z,
double  r,
int  parent 
)

Definition at line 69 of file SwcSegment.cpp.

References parent(), and parent_.

72  :
73  myIndex_( i ),
74  type_( type ),
75  v_( x, y, z ),
76  radius_( r ),
77  length_( 0.0 ),
78  L_( 0.0 ),
81 {
82  if ( parent >= 0 )
83  parent_ = parent;
84  else
85  parent_ = ~0U;
86 }
unsigned short type() const
Definition: SwcSegment.h:72
unsigned int parent() const
Definition: SwcSegment.h:44
double electrotonicDistanceFromSoma_
electrotonic dist from soma, summed along dend.
Definition: SwcSegment.h:167
unsigned int myIndex_
Definition: SwcSegment.h:140
double L_
Length of segment.
Definition: SwcSegment.h:157
double length_
Radius of segment.
Definition: SwcSegment.h:156
double radius_
coordinates of end of segment
Definition: SwcSegment.h:155
short type_
Index of self.
Definition: SwcSegment.h:153
unsigned int parent_
Number of length constants in segment.
Definition: SwcSegment.h:158
double geometricalDistanceFromSoma_
geometrical distance from soma.
Definition: SwcSegment.h:164

+ Here is the call graph for this function:

Member Function Documentation

void SwcSegment::addChild ( unsigned int  kid)
inline

Definition at line 56 of file SwcSegment.h.

References kids_.

56  {
57  kids_.push_back( kid );
58  }
vector< int > kids_
Definition: SwcSegment.h:169
double SwcSegment::distance ( const SwcSegment &  other) const
inline

Definition at line 87 of file SwcSegment.h.

References Vec::distance(), and v_.

Referenced by ReadSwc::cleanZeroLength(), makeCompt(), ReadSwc::traverseBranch(), and traverseCumulativeDistance().

87  {
88  return v_.distance( other.v_ );
89  }
double distance(const Vec &other) const
Definition: Vec.cpp:81

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void SwcSegment::figureOutType ( )

Definition at line 88 of file SwcSegment.cpp.

References APICAL, APICAL_END, APICAL_FORK, AXON, AXON_END, AXON_FORK, DEND, END, FORK, kids_, SOMA, and type_.

89 {
90  if ( type_ == SOMA ) // already defined as soma
91  return;
92  if ( type_ == DEND ) {
93  if ( kids_.size() > 1 )
94  type_ = FORK; // Dend fork point
95  else if ( kids_.size() == 0 )
96  type_ = END; // end point
97  } else if ( type_ == APICAL ) {
98  if ( kids_.size() > 1 )
99  type_ = APICAL_FORK; // apical Dend fork point
100  else if ( kids_.size() == 0 )
101  type_ = APICAL_END; // apical end point
102  } else if ( type_ == AXON ) {
103  if ( kids_.size() > 1 )
104  type_ = AXON_FORK; // apical Dend fork point
105  else if ( kids_.size() == 0 )
106  type_ = AXON_END; // apical end point
107  }
108 }
static const short FORK
Definition: SwcSegment.h:127
static const short END
Definition: SwcSegment.h:128
static const short SOMA
Definition: SwcSegment.h:123
static const short AXON_END
Definition: SwcSegment.h:133
static const short DEND
Definition: SwcSegment.h:125
vector< int > kids_
Definition: SwcSegment.h:169
static const short APICAL_FORK
Definition: SwcSegment.h:134
static const short APICAL_END
Definition: SwcSegment.h:135
short type_
Index of self.
Definition: SwcSegment.h:153
static const short APICAL
Definition: SwcSegment.h:126
static const short AXON
Definition: SwcSegment.h:124
static const short AXON_FORK
Definition: SwcSegment.h:132
double SwcSegment::getElecDistFromSoma ( ) const
inline

Definition at line 117 of file SwcSegment.h.

References electrotonicDistanceFromSoma_.

117  {
119  }
double electrotonicDistanceFromSoma_
electrotonic dist from soma, summed along dend.
Definition: SwcSegment.h:167
double SwcSegment::getGeomDistFromSoma ( ) const
inline

Definition at line 113 of file SwcSegment.h.

References geometricalDistanceFromSoma_.

113  {
115  }
double geometricalDistanceFromSoma_
geometrical distance from soma.
Definition: SwcSegment.h:164
double SwcSegment::getPathDistFromSoma ( ) const
inline

Definition at line 109 of file SwcSegment.h.

References pathDistanceFromSoma_.

109  {
110  return pathDistanceFromSoma_;
111  }
double pathDistanceFromSoma_
Index of parent. Is ~0 for soma.
Definition: SwcSegment.h:161
const vector< int >& SwcSegment::kids ( ) const
inline

Definition at line 62 of file SwcSegment.h.

References kids_.

Referenced by ReadSwc::cleanZeroLength(), ReadSwc::parseBranches(), replaceKids(), and ReadSwc::traverseBranch().

63  {
64  return kids_;
65  }
vector< int > kids_
Definition: SwcSegment.h:169

+ Here is the caller graph for this function:

double SwcSegment::L ( ) const
inline

Definition at line 83 of file SwcSegment.h.

References L_.

Referenced by setCumulativeDistance(), and ReadSwc::traverseBranch().

83  {
84  return L_;
85  }
double L_
Length of segment.
Definition: SwcSegment.h:157

+ Here is the caller graph for this function:

double SwcSegment::length ( ) const
inline

Definition at line 79 of file SwcSegment.h.

References length_.

79  {
80  return length_;
81  }
double length_
Radius of segment.
Definition: SwcSegment.h:156
unsigned int SwcSegment::myIndex ( ) const
inline

Definition at line 52 of file SwcSegment.h.

References myIndex_.

Referenced by ReadSwc::assignKids(), ReadSwc::build(), ReadSwc::cleanZeroLength(), SwcBranch::printDiagnostics(), ReadSwc::traverseBranch(), and ReadSwc::validate().

52  {
53  return myIndex_;
54  }
unsigned int myIndex_
Definition: SwcSegment.h:140

+ Here is the caller graph for this function:

bool SwcSegment::OK ( ) const
inline

Definition at line 34 of file SwcSegment.h.

References BadSegment, CUSTOM, type_, and UNDEF.

Referenced by ReadSwc::parseBranches(), and ReadSwc::ReadSwc().

35  {
36  return type_!=BadSegment && type_!=UNDEF && type_!=CUSTOM;
37  }
static const short BadSegment
Definition: SwcSegment.h:131
static const short CUSTOM
Definition: SwcSegment.h:129
static const short UNDEF
Definition: SwcSegment.h:122
short type_
Index of self.
Definition: SwcSegment.h:153

+ Here is the caller graph for this function:

unsigned int SwcSegment::parent ( ) const
inline

Definition at line 44 of file SwcSegment.h.

References parent_.

Referenced by ReadSwc::assignKids(), ReadSwc::build(), ReadSwc::cleanZeroLength(), makeCompt(), SwcBranch::printDiagnostics(), SwcSegment(), ReadSwc::traverseBranch(), and ReadSwc::validate().

44  {
45  return parent_;
46  }
unsigned int parent_
Number of length constants in segment.
Definition: SwcSegment.h:158

+ Here is the caller graph for this function:

double SwcSegment::radius ( ) const
inline

Definition at line 76 of file SwcSegment.h.

References radius_.

Referenced by makeCompt(), ReadSwc::traverseBranch(), and ReadSwc::validate().

76  {
77  return radius_;
78  }
double radius_
coordinates of end of segment
Definition: SwcSegment.h:155

+ Here is the caller graph for this function:

void SwcSegment::replaceKids ( const vector< int > &  kids)
inline

Definition at line 67 of file SwcSegment.h.

References kids(), and kids_.

Referenced by ReadSwc::cleanZeroLength().

68  {
69  kids_ = kids;
70  }
const vector< int > & kids() const
Definition: SwcSegment.h:62
vector< int > kids_
Definition: SwcSegment.h:169

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void SwcSegment::setBad ( )
inline

Definition at line 39 of file SwcSegment.h.

References BadSegment, and type_.

Referenced by ReadSwc::cleanZeroLength().

39  {
40  type_ = BadSegment;
41  }
static const short BadSegment
Definition: SwcSegment.h:131
short type_
Index of self.
Definition: SwcSegment.h:153

+ Here is the caller graph for this function:

void SwcSegment::setCumulativeDistance ( double  len,
double  L,
double  pSoma,
double  eSoma 
)
inline

Definition at line 100 of file SwcSegment.h.

References electrotonicDistanceFromSoma_, L(), L_, length_, and pathDistanceFromSoma_.

102  {
103  length_ = len;
104  L_ = L;
105  pathDistanceFromSoma_ = pSoma;
107  }
double L() const
Definition: SwcSegment.h:83
double electrotonicDistanceFromSoma_
electrotonic dist from soma, summed along dend.
Definition: SwcSegment.h:167
double pathDistanceFromSoma_
Index of parent. Is ~0 for soma.
Definition: SwcSegment.h:161
double L_
Length of segment.
Definition: SwcSegment.h:157
double length_
Radius of segment.
Definition: SwcSegment.h:156

+ Here is the call graph for this function:

void SwcSegment::setGeometricalDistanceFromSoma ( const SwcSegment &  soma)
inline

Definition at line 95 of file SwcSegment.h.

References Vec::distance(), geometricalDistanceFromSoma_, and v_.

96  {
98  }
double distance(const Vec &other) const
Definition: Vec.cpp:81
double geometricalDistanceFromSoma_
geometrical distance from soma.
Definition: SwcSegment.h:164

+ Here is the call graph for this function:

void SwcSegment::setParent ( unsigned int  pa)
inline

Definition at line 48 of file SwcSegment.h.

References parent_.

Referenced by ReadSwc::cleanZeroLength().

48  {
49  parent_ = pa;
50  }
unsigned int parent_
Number of length constants in segment.
Definition: SwcSegment.h:158

+ Here is the caller graph for this function:

unsigned short SwcSegment::type ( ) const
inline

Definition at line 72 of file SwcSegment.h.

References type_.

Referenced by ReadSwc::diagnostics(), and makeCompt().

72  {
73  return type_;
74  }
short type_
Index of self.
Definition: SwcSegment.h:153

+ Here is the caller graph for this function:

const Vec& SwcSegment::vec ( ) const
inline

Definition at line 91 of file SwcSegment.h.

References v_.

Referenced by makeCompt().

91  {
92  return v_;
93  }

+ Here is the caller graph for this function:

Member Data Documentation

const short SwcSegment::APICAL = 4
static

Definition at line 126 of file SwcSegment.h.

Referenced by figureOutType().

const short SwcSegment::APICAL_END = 13
static

Definition at line 135 of file SwcSegment.h.

Referenced by figureOutType().

const short SwcSegment::APICAL_FORK = 12
static

Definition at line 134 of file SwcSegment.h.

Referenced by figureOutType().

const short SwcSegment::AXON = 2
static

Definition at line 124 of file SwcSegment.h.

Referenced by figureOutType().

const short SwcSegment::AXON_END = 11
static

Definition at line 133 of file SwcSegment.h.

Referenced by figureOutType().

const short SwcSegment::AXON_FORK = 10
static

Definition at line 132 of file SwcSegment.h.

Referenced by figureOutType().

const short SwcSegment::BadSegment = 8
static

Definition at line 131 of file SwcSegment.h.

Referenced by OK(), and setBad().

const short SwcSegment::CUSTOM = 7
static

Definition at line 129 of file SwcSegment.h.

Referenced by OK().

const short SwcSegment::DEND = 3
static

Definition at line 125 of file SwcSegment.h.

Referenced by figureOutType().

double SwcSegment::electrotonicDistanceFromSoma_
protected

electrotonic dist from soma, summed along dend.

Definition at line 167 of file SwcSegment.h.

Referenced by getElecDistFromSoma(), and setCumulativeDistance().

const short SwcSegment::END = 6
static

Definition at line 128 of file SwcSegment.h.

Referenced by figureOutType().

const short SwcSegment::FORK = 5
static

Definition at line 127 of file SwcSegment.h.

Referenced by figureOutType().

double SwcSegment::geometricalDistanceFromSoma_
protected

geometrical distance from soma.

Definition at line 164 of file SwcSegment.h.

Referenced by getGeomDistFromSoma(), and setGeometricalDistanceFromSoma().

vector< int > SwcSegment::kids_
protected

Definition at line 169 of file SwcSegment.h.

Referenced by addChild(), figureOutType(), kids(), replaceKids(), and SwcBranch::SwcBranch().

double SwcSegment::L_
protected

Length of segment.

Definition at line 157 of file SwcSegment.h.

Referenced by L(), and setCumulativeDistance().

double SwcSegment::length_
protected

Radius of segment.

Definition at line 156 of file SwcSegment.h.

Referenced by length(), and setCumulativeDistance().

unsigned int SwcSegment::myIndex_
protected

Definition at line 140 of file SwcSegment.h.

Referenced by myIndex(), and SwcBranch::SwcBranch().

unsigned int SwcSegment::parent_
protected

Number of length constants in segment.

Definition at line 158 of file SwcSegment.h.

Referenced by parent(), setParent(), SwcBranch::SwcBranch(), and SwcSegment().

double SwcSegment::pathDistanceFromSoma_
protected

Index of parent. Is ~0 for soma.

dist from soma: not direct, but threaded along dend

Definition at line 161 of file SwcSegment.h.

Referenced by getPathDistFromSoma(), and setCumulativeDistance().

double SwcSegment::radius_
protected

coordinates of end of segment

Definition at line 155 of file SwcSegment.h.

Referenced by radius().

const short SwcSegment::SOMA = 1
static

Definition at line 123 of file SwcSegment.h.

Referenced by figureOutType().

short SwcSegment::type_
protected

Index of self.

The type of the segment is supposedly as below for SWC files. Seems to be honored in the breach in actual files. 0 = undefined 1 = soma 2 = axon 3 = dendrite 4 = apical dendrite 5 = fork point 6 = end point 7 = custom

Definition at line 153 of file SwcSegment.h.

Referenced by figureOutType(), OK(), setBad(), and type().

const string SwcSegment::typeName
static
Initial value:
= {
"undef", "soma", "axon", "dend", "apical", "dend_f", "dend_e",
"custom", "bad", "undef",
"axon_f", "axon_e", "apical_f", "apical_e" }

Definition at line 137 of file SwcSegment.h.

Referenced by ReadSwc::diagnostics(), and makeCompt().

const short SwcSegment::UNDEF = 0
static

Definition at line 122 of file SwcSegment.h.

Referenced by OK().

Vec SwcSegment::v_
protected

Definition at line 154 of file SwcSegment.h.

Referenced by distance(), setGeometricalDistanceFromSoma(), and vec().


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