nsol
0.4.1
Nsol - Neuroscience Objects Library
|
Public Member Functions | |
NeuronPtr | readNeuron (const std::string &fileName, bool reposition_=false) |
Creates a new Neuron that contains the NeuronMorphology described in an ASC file Calls readMorphology( 2 ) More... | |
NeuronMorphologyPtr | readMorphology (const std::string &fileName, bool reposition_=false) |
Creates a NeuronMorphology and loads info described in ASC file. More... | |
Protected Member Functions | |
void | _ReadNeurite (NeuritePtr neuritePointer, NsolVector< NodePtr > *repositionNodes_, bool reposition_) |
Reads a Neurite from an ASC file. More... | |
void | _ReadSoma (NeuronMorphologyPtr neuronMorphology, NsolVector< NodePtr > *repositionNodes_, bool reposition_) |
Reads soma points from an ASC file. More... | |
int | _countBrackets (const std::string &line) |
Calculates the total amount of opening minus closing brackets. More... | |
void | _eraseComent (std::string &line) |
Modifies a string by removing any comments there may be (after ';' character) More... | |
NodePtr | _parseDataLine (const std::string &line) |
Creates a new NodePtr using the information contained in a data line. More... | |
Protected Attributes | |
unsigned int | nodeId |
std::ifstream | inFile |
Definition at line 67 of file AscReader.h.
|
protected |
Calculates the total amount of opening minus closing brackets.
line | string to be analysed |
Definition at line 520 of file AscReader.h.
Referenced by nsol::AscReaderTemplated< ASC_READER_TEMPLATE_CLASSES >::_ReadNeurite(), and nsol::AscReaderTemplated< ASC_READER_TEMPLATE_CLASSES >::_ReadSoma().
|
protected |
Modifies a string by removing any comments there may be (after ';' character)
line | reference to string to be modified |
Erases all characters from the first instance of ';' onwards
Definition at line 543 of file AscReader.h.
Referenced by nsol::AscReaderTemplated< ASC_READER_TEMPLATE_CLASSES >::_ReadNeurite(), nsol::AscReaderTemplated< ASC_READER_TEMPLATE_CLASSES >::_ReadSoma(), and nsol::AscReaderTemplated< ASC_READER_TEMPLATE_CLASSES >::readMorphology().
|
protected |
Creates a new NodePtr using the information contained in a data line.
line | string to be analysed |
Pareses data line into auxiliary variables
Removes opening bracket
Creates a new node with the info that was gathered
Definition at line 497 of file AscReader.h.
Referenced by nsol::AscReaderTemplated< ASC_READER_TEMPLATE_CLASSES >::_ReadNeurite(), and nsol::AscReaderTemplated< ASC_READER_TEMPLATE_CLASSES >::_ReadSoma().
|
protected |
Reads a Neurite from an ASC file.
neuritePointer | neuritePtr where info will be loaded |
repositionNodes_ | 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 repositionNodes_ for later recalculation |
Reads file, line by line, until end of current neurite is reached
Removes comment
Checks whether the line contains node info
Parses the line and creates a new node
Adds nodes for later recalculation of position if reposition_ is active
Adds first node to the first section of the neurite
Adds new node to the current section
Lines with character '|' mark the beginning of a new section at the same level in the hierarchy.
Creates a new section, updates the parent section stack, and increments branch count by one
Checks whether the line contains spine data (not implemented)
Updates parent section stack whenever hierarchy level is changed
Skips markers (not implemented)
If end of hierarchy level is reached, updates parent Section stack, branch and bifurcation counters, and creates the new section to be worked on
Definition at line 321 of file AscReader.h.
References nsol::AscReaderTemplated< ASC_READER_TEMPLATE_CLASSES >::_countBrackets(), nsol::AscReaderTemplated< ASC_READER_TEMPLATE_CLASSES >::_eraseComent(), nsol::AscReaderTemplated< ASC_READER_TEMPLATE_CLASSES >::_parseDataLine(), nsol::NeuronMorphologySection::addChild(), nsol::NeuronMorphologySection::addNode(), nsol::NeuronMorphologySection::firstNode(), nsol::Log::log(), nsol::NeuronMorphologySection::neurite(), and nsol::NeuronMorphologySection::parent().
Referenced by nsol::AscReaderTemplated< ASC_READER_TEMPLATE_CLASSES >::readMorphology().
|
protected |
Reads soma points from an ASC file.
neuronMorphology | NeuronMorphologyPtr where soma nodes will be added |
repositionNodes_ | 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 repositionNodes_ for later recalculation |
Reads file, line by line, until end of current Soma contour is reached
Removes comment
Updates current hierarchy level
Detection of data lines
Parses line to a new node
Adds nodes for later recalculation of position if reposition_ is active
Adds the new node to the soma
Definition at line 455 of file AscReader.h.
References nsol::AscReaderTemplated< ASC_READER_TEMPLATE_CLASSES >::_countBrackets(), nsol::AscReaderTemplated< ASC_READER_TEMPLATE_CLASSES >::_eraseComent(), nsol::AscReaderTemplated< ASC_READER_TEMPLATE_CLASSES >::_parseDataLine(), nsol::Soma::addNode(), and nsol::NeuronMorphology::soma().
Referenced by nsol::AscReaderTemplated< ASC_READER_TEMPLATE_CLASSES >::readMorphology().
NeuronMorphologyPtr nsol::AscReaderTemplated< ASC_READER_TEMPLATE_CLASSES >::readMorphology | ( | const std::string & | fileName, |
bool | reposition_ = false |
||
) |
Creates a NeuronMorphology and loads info described in ASC file.
fileName | path to ASC file to be read |
reposition_ | sets soma center to ( 0.0, 0.0, 0.0 ) if true |
Opening file check
Reads file, line by line
Removes commentaries
Puts line in lower letters to match the line types
Checks whether a new basal dendrite is being declared
Creates a pointer to a new basal dendrite and loads all corresponding info from the ASC file
Checks whether a new apical dendrite is being declared
Creates a pointer to a new apical dendrite and loads all corresponding info from the ASC file
Checks whether a new soma has been declared If multiple soma contours are present, their points will be loaded into a single soma
Checks whether a new axon has been declared
Creates a pointer to a new axon and loads all corresponding info from the ASC file
All other bracketed directives are ignored
Moves soma center to ( 0.0, 0.0, 0.0 ) if reposition_ is active, accordingly recalculating position for all nodes
Definition at line 212 of file AscReader.h.
References nsol::AscReaderTemplated< ASC_READER_TEMPLATE_CLASSES >::_eraseComent(), nsol::AscReaderTemplated< ASC_READER_TEMPLATE_CLASSES >::_ReadNeurite(), nsol::AscReaderTemplated< ASC_READER_TEMPLATE_CLASSES >::_ReadSoma(), nsol::NeuronMorphology::addNeurite(), nsol::Soma::center(), nsol::Log::log(), and nsol::NeuronMorphology::soma().
Referenced by nsol::AscReaderTemplated< ASC_READER_TEMPLATE_CLASSES >::readNeuron().
NeuronPtr nsol::AscReaderTemplated< ASC_READER_TEMPLATE_CLASSES >::readNeuron | ( | const std::string & | fileName, |
bool | reposition_ = false |
||
) |
Creates a new Neuron that contains the NeuronMorphology described in an ASC file Calls readMorphology( 2 )
fileName | path to ASC file to read |
reposition_ | sets soma center to ( 0.0, 0.0, 0.0 ) if true |
Definition at line 194 of file AscReader.h.
References nsol::AscReaderTemplated< ASC_READER_TEMPLATE_CLASSES >::readMorphology().