nsol  0.4.1
Nsol - Neuroscience Objects Library
nsol::MiniColumnStats Class Reference

This class allows to compute stats for sections. More...

#include <MiniColumnStats.h>

+ Inheritance diagram for nsol::MiniColumnStats:
+ Collaboration diagram for nsol::MiniColumnStats:

Public Types

enum  TMiniColumnStat {
  DENDRITIC_VOLUME = 0, AXON_VOLUME, NEURITIC_VOLUME, SOMA_VOLUME,
  VOLUME, DENDRITIC_SURFACE, AXON_SURFACE, NEURITIC_SURFACE,
  SOMA_SURFACE, SURFACE, DENDRITIC_LENGTH, AXON_LENGTH,
  NEURITIC_LENGTH, DENDRITIC_BIFURCATIONS, AXON_BIFURCATIONS, NEURITIC_BIFURCATIONS,
  MINI_COLUMN_NUM_STATS
}
 

Public Member Functions

 MiniColumnStats (const ColumnPtr column=nullptr, const unsigned short id=0)
 
float getStat (TMiniColumnStat stat, TAggregation agg=TOTAL) const
 
virtual MiniColumnStatsstats (void)
 Returns object as MiniColumnStats. More...
 
- Public Member Functions inherited from nsol::MiniColumn
virtual MiniColumnPtr asMiniColumn (void)
 
 MiniColumn (const ColumnPtr column=nullptr, const unsigned short id=0)
 Default constructor. More...
 
 MiniColumn (const MiniColumn &other)
 Copy constructor. More...
 
virtual ~MiniColumn ()
 Default destructur.
 
unsigned short & id (void)
 Method to get-set mini column id. More...
 
unsigned short id (void) const
 Method to get the column id as const. More...
 
void column (ColumnPtr column)
 Method to set the column of this minicolumn. More...
 
ColumnPtr column (void) const
 Method to get the column of this minicolumn. More...
 
NeuronPtr addNeuron (NeuronPtr neuron)
 Method to add a neuron. More...
 
bool removeNeuron (NeuronPtr neuron)
 Method to remove a neuron. More...
 
Neurons & neurons (void)
 Method to get neurons. More...
 
Neurons neurons (void) const
 Method to get neurons. More...
 
void clearNeurons (void)
 Method to clear the neurons container.
 
unsigned int numberOfNeurons (bool all=true, Neuron::TMorphologicalType neuronType=Neuron::PYRAMIDAL, unsigned int layer=0) const
 Method to get the number of neurons in the minicolumn. More...
 
MiniColumnoperator= (const MiniColumn &other)
 
bool operator== (MiniColumn &other) const
 
bool operator!= (MiniColumn &other) const
 
- Public Member Functions inherited from nsol::Object
virtual ColumnPtr asColumn (void)
 
virtual NeuronPtr asNeuron (void)
 
virtual NeuronMorphologyPtr asNeuronMorphology (void)
 
virtual SectionPtr asSection (void)
 
virtual NodePtr asNode (void)
 
virtual ObjectWithPropertiesproperties (void)
 
virtual ObjectPtr create (void)
 

Additional Inherited Members

- Protected Attributes inherited from nsol::MiniColumn
unsigned short _id
 id of this minicolumn
 
ColumnPtr _column
 Pointer to the column this minicolumn belogns to.
 
Neurons _neurons
 ! Container of the neurons of this minicolumn
 

Detailed Description

This class allows to compute stats for sections.

Using this class instead of MiniColumn when constructing the hierarchy allows to call the method stats from base MiniColumn class and get the corresponding volume, surface and length.

Example:

/*
* Copyright (c) 2014-2017 GMRV/URJC.
*
* This file is part of nsol <https://github.com/gmrvvis/nsol>
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License version 3.0 as published
* by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
/*
* Example to show how to use stats and cached stats
*/
#include <nsol/nsol.h>
void computeMiniColumnStats( nsol::MiniColumnPtr column );
void printMiniColumnStats( nsol::MiniColumnPtr column );
#ifndef NSOL_USE_BRION
int main ( int /* argc */, char ** /* argv */ )
{
std::cout << "Brion support not built-in" << std::endl;
return 0;
}
#else
#include <sys/time.h>
int main ( int argc, char ** argv )
{
std::cout << std::endl;
if ( argc < 3 )
{
std::cerr << "Error. Usage: " << argv[0]
<< " blue_config_input_file target" << std::endl;
return -1;
}
brion::BlueConfig blueConfig( argv[1] );
nsol::BrionReaderStats readerWithStats;
nsol::Columns columnsWithStats;
nsol::NeuronsMap neuronsWithStats;
readerWithStats.loadBlueConfigHierarchy( columnsWithStats, neuronsWithStats,
blueConfig, argv[2] );
nsol::MiniColumnPtr miniColumnWithStats =
columnsWithStats[0]->miniColumns( )[0];
nsol::BrionReaderCachedStats readerWithCachedStats;
nsol::Columns columnsWithCachedStats;
nsol::NeuronsMap neuronsWithCachedStats;
readerWithCachedStats.loadBlueConfigHierarchy( columnsWithCachedStats,
neuronsWithCachedStats,
blueConfig, argv[2] );
nsol::MiniColumnPtr miniColumnWithCachedStats =
columnsWithCachedStats[0]->miniColumns( )[0];
NSOL_CHECK_THROW( miniColumnWithStats->stats( ),
"no stats in minicolumn" );
NSOL_CHECK_THROW( miniColumnWithCachedStats->stats( ),
"no stats in minicolumn" );
std::cout << "Number of neurons: "
<< miniColumnWithStats->neurons().size() << std::endl;
std::cout << std::endl;
for ( unsigned int layer = 0 ; layer < 7; layer++ )
{
std::cout << layer << " pyr: " <<
miniColumnWithStats->numberOfNeurons( false,
layer )
<< " inter: " <<
miniColumnWithStats->numberOfNeurons( false,
layer )
<< std::endl;
}
return 0;
}
void computeMiniColumnStats( nsol::MiniColumnPtr miniColumn )
{
NSOL_DEBUG_CHECK( miniColumn , "miniColumn is null" );
NSOL_DEBUG_CHECK( miniColumn->stats( ) , "no stats" );
miniColumn->stats( )->getStat( nsol::MiniColumnStats::DENDRITIC_VOLUME );
miniColumn->stats( )->getStat( nsol::MiniColumnStats::AXON_VOLUME );
miniColumn->stats( )->getStat( nsol::MiniColumnStats::NEURITIC_VOLUME );
miniColumn->stats( )->getStat( nsol::MiniColumnStats::SOMA_VOLUME );
miniColumn->stats( )->getStat( nsol::MiniColumnStats::VOLUME );
// Surface
miniColumn->stats( )->getStat( nsol::MiniColumnStats::DENDRITIC_SURFACE );
miniColumn->stats( )->getStat( nsol::MiniColumnStats::AXON_SURFACE );
miniColumn->stats( )->getStat( nsol::MiniColumnStats::NEURITIC_SURFACE );
miniColumn->stats( )->getStat( nsol::MiniColumnStats::SOMA_SURFACE );
miniColumn->stats( )->getStat( nsol::MiniColumnStats::SURFACE );
// Length
miniColumn->stats( )->getStat( nsol::MiniColumnStats::DENDRITIC_LENGTH );
miniColumn->stats( )->getStat( nsol::MiniColumnStats::AXON_LENGTH );
miniColumn->stats( )->getStat( nsol::MiniColumnStats::NEURITIC_LENGTH
);
// Bifurcations
miniColumn->stats( )->getStat( nsol::MiniColumnStats::DENDRITIC_BIFURCATIONS );
miniColumn->stats( )->getStat( nsol::MiniColumnStats::AXON_BIFURCATIONS );
miniColumn->stats( )->getStat( nsol::MiniColumnStats::NEURITIC_BIFURCATIONS );
}
#define COMPUTE_AND_PRINT2( __MSG__, __METHOD__ ) \
std::cout << __MSG__ \
<< miniColumn->stats( )->__METHOD__( nsol::TAggregation::TOTAL ) \
<< std::endl; \
#define COMPUTE_AND_PRINT( __MSG__, _S_ ) \
std::cout << __MSG__ \
<< miniColumn->stats( )->getStat( _S_, nsol::TAggregation::TOTAL ) \
<< "\tmin: " \
<< miniColumn->stats( )->getStat( _S_, nsol::TAggregation::MIN ) \
<< "\tmax: " \
<< miniColumn->stats( )->getStat( _S_, nsol::TAggregation::MAX ) \
<< "\tmean: " \
<< miniColumn->stats( )->getStat( _S_, nsol::TAggregation::MEAN ) \
<< "\tvariance: " \
<< miniColumn->stats( )->getStat( _S_, nsol::TAggregation::VARIANCE ) \
<< "\tstd dev.: " \
<< miniColumn->stats( )->getStat( _S_, nsol::TAggregation::STD_DEV ) \
<< std::endl; \
void printMiniColumnStats( nsol::MiniColumnPtr miniColumn )
{
NSOL_DEBUG_CHECK( miniColumn , "miniColumn is null" );
NSOL_DEBUG_CHECK( miniColumn->stats( ) , "no stats" );
COMPUTE_AND_PRINT( "\tDendritic surface:\t",
nsol::MiniColumnStats::DENDRITIC_SURFACE );
COMPUTE_AND_PRINT( "\tAxon surface:\t\t",
nsol::MiniColumnStats::AXON_SURFACE );
COMPUTE_AND_PRINT( "\tNeuritic surface:\t",
nsol::MiniColumnStats::NEURITIC_SURFACE );
COMPUTE_AND_PRINT( "\tSoma surface:\t\t",
nsol::MiniColumnStats::SOMA_SURFACE );
COMPUTE_AND_PRINT( "\tMiniColumn surface:\t",
nsol::MiniColumnStats::SURFACE );
std::cout << std::endl;
COMPUTE_AND_PRINT( "\tDendritic volume:\t",
nsol::MiniColumnStats::DENDRITIC_SURFACE );
COMPUTE_AND_PRINT( "\tAxon volume:\t\t",
nsol::MiniColumnStats::AXON_VOLUME );
COMPUTE_AND_PRINT( "\tNeuritic volume:\t",
nsol::MiniColumnStats::NEURITIC_VOLUME );
COMPUTE_AND_PRINT( "\tSoma volume:\t\t",
nsol::MiniColumnStats::SOMA_VOLUME );
COMPUTE_AND_PRINT( "\tMiniColumn volume:\t",
nsol::MiniColumnStats::VOLUME );
std::cout << std::endl;
COMPUTE_AND_PRINT( "\tDendritic length:\t",
nsol::MiniColumnStats::DENDRITIC_LENGTH );
COMPUTE_AND_PRINT( "\tAxon length:\t\t",
nsol::MiniColumnStats::AXON_LENGTH );
COMPUTE_AND_PRINT( "\tNeuritic length:\t",
nsol::MiniColumnStats::NEURITIC_LENGTH );
std::cout << std::endl;
COMPUTE_AND_PRINT( "\tDendritic bifurcations:\t",
nsol::MiniColumnStats::DENDRITIC_BIFURCATIONS );
COMPUTE_AND_PRINT( "\tAxon bifurcations:\t",
nsol::MiniColumnStats::AXON_BIFURCATIONS );
COMPUTE_AND_PRINT( "\tNeuritic bifurcations:\t",
nsol::MiniColumnStats::NEURITIC_BIFURCATIONS );
std::cout << std::endl;
}
#endif // NSOL_USE_BRION

Definition at line 39 of file MiniColumnStats.h.

Member Function Documentation

virtual MiniColumnStats* nsol::MiniColumnStats::stats ( void  )
virtual

Returns object as MiniColumnStats.

Returns
pointer to MiniColumnStats object

Reimplemented from nsol::MiniColumn.


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