Brion  1.9.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...
 
CellFamily getCellFamily () const
 
Vector4fsPtr readPoints (MorphologyRepairStage stage=MORPHOLOGY_UNDEFINED) const
 Read points of morphology, representing x,y,z coordinates + diameter. More...
 
Vector2isPtr readSections (MorphologyRepairStage stage=MORPHOLOGY_UNDEFINED) 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...
 
floatsPtr readPerimeters () const
 
MorphologyVersion getVersion () const
 
Write API
 Morphology (const std::string &target, MorphologyVersion version, bool overwrite=false)
 Open the given morphology file for write access. More...
 
 Morphology (const std::string &file, CellFamily family)
 Open the given morphology file for write access. More...
 
void writePoints (const Vector4fs &points, MorphologyRepairStage stage=MORPHOLOGY_UNDEFINED)
 Write points of morphology, representing x,y,z coordinates + diameter. More...
 
void writeSections (const Vector2is &sections, MorphologyRepairStage stage=MORPHOLOGY_UNDEFINED)
 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 writePerimeters (const floats &perimeters)
 Write perimeters of morphology. 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 brion/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,
MorphologyVersion  version,
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
Deprecated:
brion::Morphology::Morphology ( const std::string &  file,
CellFamily  family 
)

Open the given morphology file for write access.

Parameters
filefilename of the output morphology file
familythe cell family that this morphology represents
Exceptions
std::runtime_errorif file could not be created
Version
1.8

Member Function Documentation

void brion::Morphology::flush ( )

Flush data to output.

Version
1.0
CellFamily brion::Morphology::getCellFamily ( ) const
Returns
the cell family of that morphology.
Version
1.8
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
floatsPtr brion::Morphology::readPerimeters ( ) const
Returns
perimeters of the cross sections for each point of the morphology in micrometers.
Exceptions
std::runtime_errorif empty for FAMILY_GLIA
Version
1.8
Vector4fsPtr brion::Morphology::readPoints ( MorphologyRepairStage  stage = MORPHOLOGY_UNDEFINED) 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 ( MorphologyRepairStage  stage = MORPHOLOGY_UNDEFINED) 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
First point and parent indices of all the 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 not supported by implementation
Version
1.0
Deprecated:
void brion::Morphology::writePerimeters ( const floats &  perimeters)

Write perimeters of morphology.

Parameters
perimetersperimeters of the cross sections for each point of the morphology in micrometers
Exceptions
std::runtime_errorif object not writable
std::runtime_errorperimeters already written
std::runtime_errornumber of points does not match number of perimeters
std::runtime_errorif not supported by implementation
Version
1.8
void brion::Morphology::writePoints ( const Vector4fs &  points,
MorphologyRepairStage  stage = MORPHOLOGY_UNDEFINED 
)

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 writable
std::runtime_errorpoints already written
std::runtime_errornumber of points does not match number of perimeters
Version
1.0
void brion::Morphology::writeSections ( const Vector2is &  sections,
MorphologyRepairStage  stage = MORPHOLOGY_UNDEFINED 
)

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 writable
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 writable
Version
1.0

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