Brion  1.5.0
The Blue Brain C++ I/O library
brion::Morphology Class Reference

Read & write access to a Morphology file. More...

#include <morphology.h>

+ Inheritance diagram for brion::Morphology:
+ Collaboration diagram for brion::Morphology:

Public Member Functions

 ~Morphology ()
 Close morphology file. More...
 
Read API
 Morphology (const std::string &source)
 Open the given source to a morphology file for reading. More...
 
Vector4fsPtr readPoints (const MorphologyRepairStage stage) const
 Read points of morphology, representing x,y,z coordinates + diameter. More...
 
Vector2isPtr readSections (const MorphologyRepairStage stage) const
 Read sections of morphology, representing section start index and index of the parent section. More...
 
SectionTypesPtr readSectionTypes () const
 Read section types of morphology. More...
 
Vector2isPtr readApicals () const
 Read apical points of morphology, representing section and point index. More...
 
MorphologyVersion getVersion () const
 
Write API
 Morphology (const std::string &target, const MorphologyVersion version, const bool overwrite=false)
 Open the given morphology file for write access. More...
 
void writePoints (const Vector4fs &points, const MorphologyRepairStage stage)
 Write points of morphology, representing x,y,z coordinates + diameter. More...
 
void writeSections (const Vector2is &sections, const MorphologyRepairStage stage)
 Write sections of morphology, representing section start index and index of parent the section. More...
 
void writeSectionTypes (const SectionTypes &types)
 Write section types of morphology. More...
 
void writeApicals (const Vector2is &apicals)
 Write apical points of morphology, representing section and point index. More...
 
void flush ()
 Flush data to output. More...
 

Detailed Description

Read & write access to a Morphology file.

Following RAII, this class is ready to use after the creation and will ensure release of resources upon destruction.

Definition at line 36 of file morphology.h.

Constructor & Destructor Documentation

brion::Morphology::~Morphology ( )

Close morphology file.

Version
1.0
brion::Morphology::Morphology ( const std::string &  source)
explicit

Open the given source to a morphology file for reading.

Parameters
sourcefilepath to morphology file
Exceptions
std::runtime_errorif file is not a valid morphology file
Version
1.0
brion::Morphology::Morphology ( const std::string &  target,
const MorphologyVersion  version,
const bool  overwrite = false 
)

Open the given morphology file for write access.

Parameters
targetfilepath of the output morphology file
versionthe output file format version, automatically chosen if undefined.
overwritetrue to allow overwrite of existing file
Exceptions
std::runtime_errorif file could not be created
Version
1.0

Member Function Documentation

void brion::Morphology::flush ( )

Flush data to output.

Version
1.0
Vector2isPtr brion::Morphology::readApicals ( ) const

Read apical points of morphology, representing section and point index.

Returns
section and point index of all apical points in the morphology
Version
1.0
Vector4fsPtr brion::Morphology::readPoints ( const MorphologyRepairStage  stage) const

Read points of morphology, representing x,y,z coordinates + diameter.

Parameters
stagethe repair stage to take the points from
Returns
x,y,z coords + diameter of all points of the morphology
Version
1.0
Vector2isPtr brion::Morphology::readSections ( const MorphologyRepairStage  stage) const

Read sections of morphology, representing section start index and index of the parent section.

Parameters
stagethe repair stage to take the section information from
Returns
index and parent index of all sections of the morphology
Version
1.0
SectionTypesPtr brion::Morphology::readSectionTypes ( ) const

Read section types of morphology.

Returns
type of all sections of the morphology
Version
1.0
void brion::Morphology::writeApicals ( const Vector2is &  apicals)

Write apical points of morphology, representing section and point index.

Parameters
apicalssection and point index of all apical points
Exceptions
std::runtime_errorif object not created with write ctor
std::runtime_errorif called for version 1 files
Version
1.0
void brion::Morphology::writePoints ( const Vector4fs &  points,
const MorphologyRepairStage  stage 
)

Write points of morphology, representing x,y,z coordinates + diameter.

Parameters
pointsx,y,z coords + diameter of all points of the morphology
stagethe repair stage to save those points to
Exceptions
std::runtime_errorif object not created with write ctor
Version
1.0
void brion::Morphology::writeSections ( const Vector2is &  sections,
const MorphologyRepairStage  stage 
)

Write sections of morphology, representing section start index and index of parent the section.

Parameters
sectionsindex and parent index of all sections of the morphology
stagethe repair stage to save those sections to
Exceptions
std::runtime_errorif object not created with write ctor
Version
1.0
void brion::Morphology::writeSectionTypes ( const SectionTypes &  types)

Write section types of morphology.

Parameters
typestype of each section of the morphology
Exceptions
std::runtime_errorif object not created with write ctor
Version
1.0

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