nsol
0.4.1
Nsol - Neuroscience Objects Library
|
Classes | |
struct | TReadNeuriteStackElem |
Auxiliary elements to read branching neurite sections. More... | |
struct | TSwcLine |
Contains processed information of an SWC line element. More... | |
Public Member Functions | |
NeuronPtr | readNeuron (const std::string &fileName, bool reposition_=false) |
Creates a new Neuron that contains the NeuronMorphology described in SWC file Calls readMorphology( 2 ) More... | |
NeuronMorphologyPtr | readMorphology (const std::string &fileName, bool reposition_=false) |
Creates a NeuronMorphology and loads info described in SWC file. More... | |
Protected Types | |
enum | TSwcNodeType { SWC_SOMA = 1, SWC_AXON = 2, SWC_BASAL = 3, SWC_APICAL = 4 } |
SWC element types. | |
Protected Member Functions | |
void | _ReadNeurite (NeuritePtr neuritePointer, const std::map< unsigned int, TSwcLine > &lines, unsigned int initId, NsolVector< NodePtr > *nodes_=nullptr, bool reposition_=false) |
Reads a Neurite from a processed SWC file, calls _ReadSection. More... | |
void | _ReadSection (NeuritePtr neuritePointer, NeuronMorphologySectionPtr sectionPointer, NodePtr nodePointer, std::stack< TReadNeuriteStackElem > *sectionFirstNodes, const std::map< unsigned int, TSwcLine > &lines, NsolVector< NodePtr > *nodes_, bool reposition_) |
Creates and calculates sections, as well as bifurcation and branch counts. More... | |
Definition at line 68 of file SwcReader.h.
|
protected |
Reads a Neurite from a processed SWC file, calls _ReadSection.
neuritePointer | neuritePtr where info will be loaded |
lines | processed SWC file line information stored as map |
initId | node ID of the first node in the neurite to read |
nodes_ | auxiliary vector for recalculation purposes |
reposition_ | sets soma center to ( 0.0, 0.0, 0.0 ) if true; it will only serve to add all new nodes to nodes_ for later recalculation |
Creates first Node in first Secion
Loads first Section in Neurite
Creates and loads all Sections in Neurite
Creates first Node of new Section
Loads Section and stores first Nodes of other Sections to load
Definition at line 418 of file SwcReader.h.
References nsol::SwcReaderTemplated< SWC_READER_TEMPLATE_CLASSES >::_ReadSection(), nsol::NeuronMorphologySection::addChild(), nsol::NeuronMorphologySection::addNode(), nsol::NeuronMorphologySection::firstNode(), nsol::NeuronMorphologySection::neurite(), and nsol::NeuronMorphologySection::parent().
Referenced by nsol::SwcReaderTemplated< SWC_READER_TEMPLATE_CLASSES >::readMorphology().
|
protected |
Creates and calculates sections, as well as bifurcation and branch counts.
neuritePointer | pointer to Neurite where section is located |
sectionPointer | pointer to Section where data will be loaded |
nodePointer | pointer to first Node in section |
sectionFirstNodes | pointer to stack where new first nodes for new sections found will be stored |
lines | processed SWC file line information stored as map |
nodes_ | auxiliary vector for recalculation purposes |
reposition_ | sets soma center to ( 0.0, 0.0, 0.0 ) if true; it will only serve to add all new nodes to nodes_ for later recalculation |
Stores first node for later position recalculation
Loads all nodes in section
Stores nodes for later position recalculation
End of section reached; first nodes of branching sections will be added to stack
Branch count updated
Plus new bifurcation
Adds first nodes of new branches to stack
Definition at line 467 of file SwcReader.h.
References nsol::NeuronMorphologySection::addNode(), and nsol::Node::id().
Referenced by nsol::SwcReaderTemplated< SWC_READER_TEMPLATE_CLASSES >::_ReadNeurite().
NeuronMorphologyPtr nsol::SwcReaderTemplated< SWC_READER_TEMPLATE_CLASSES >::readMorphology | ( | const std::string & | fileName, |
bool | reposition_ = false |
||
) |
Creates a NeuronMorphology and loads info described in SWC file.
fileName | path to SWC file to read |
reposition_ | sets soma center to ( 0.0, 0.0, 0.0 ) if true |
Opening file check
Reads file, line by line
Skips comment lines
Verifies there are 7 fields ( or more, if comments are present )
Loads info in struct TSwcLine
Adds children to TSwcLine elements created
Adds soma nodes to neuronMorphology->Soma
Adds nodes for later recalculation of position if reposition_ is active
Adds non-soma childrens of soma nodes to vector for later use
Initiates read process for each neurite, via first node
Moves soma center to ( 0.0, 0.0, 0.0 ) if reposition_ is active, accordingly recalculating position for all nodes
Definition at line 222 of file SwcReader.h.
References nsol::SwcReaderTemplated< SWC_READER_TEMPLATE_CLASSES >::_ReadNeurite(), nsol::NeuronMorphology::addNeurite(), nsol::Soma::addNode(), nsol::Soma::center(), nsol::Log::log(), and nsol::NeuronMorphology::soma().
Referenced by nsol::SwcReaderTemplated< SWC_READER_TEMPLATE_CLASSES >::readNeuron().
NeuronPtr nsol::SwcReaderTemplated< SWC_READER_TEMPLATE_CLASSES >::readNeuron | ( | const std::string & | fileName, |
bool | reposition_ = false |
||
) |
Creates a new Neuron that contains the NeuronMorphology described in SWC file Calls readMorphology( 2 )
fileName | path to SWC file to read |
reposition_ | sets soma center to ( 0.0, 0.0, 0.0 ) if true |
Definition at line 203 of file SwcReader.h.
References nsol::SwcReaderTemplated< SWC_READER_TEMPLATE_CLASSES >::readMorphology().