Public Member Functions | Public Attributes | Friends
morphio::mut::Morphology Class Reference

#include <morphology.h>

Inheritance diagram for morphio::mut::Morphology:
morphio::mut::DendriticSpine morphio::mut::GlialCell

Public Member Functions

 Morphology (const std::string &uri, unsigned int options=NO_MODIFIER)
 
 Morphology (const morphio::mut::Morphology &morphology, unsigned int options=NO_MODIFIER)
 
 Morphology (const morphio::Morphology &morphology, unsigned int options=NO_MODIFIER)
 
const std::vector< std::shared_ptr< Section > > & rootSections () const noexcept
 
const std::map< uint32_t, std::shared_ptr< Section > > & sections () const noexcept
 
std::shared_ptr< Soma > & soma () noexcept
 
const std::shared_ptr< Soma > & soma () const noexcept
 
Mitochondriamitochondria () noexcept
 
const Mitochondriamitochondria () const noexcept
 
EndoplasmicReticulumendoplasmicReticulum () noexcept
 
const EndoplasmicReticulumendoplasmicReticulum () const noexcept
 
const std::vector< Property::Annotation > & annotations () const noexcept
 
const std::vector< Property::Marker > & markers () const noexcept
 
const std::shared_ptr< Section > & section (uint32_t id) const
 
depth_iterator depth_begin () const
 
depth_iterator depth_end () const
 
breadth_iterator breadth_begin () const
 
breadth_iterator breadth_end () const
 
void deleteSection (std::shared_ptr< Section > section, bool recursive=true)
 
std::shared_ptr< SectionappendRootSection (const morphio::Section &, bool recursive=false)
 
std::shared_ptr< SectionappendRootSection (const std::shared_ptr< Section > &section, bool recursive=false)
 
std::shared_ptr< SectionappendRootSection (const Property::PointLevel &, SectionType sectionType)
 
void applyModifiers (unsigned int modifierFlags)
 
SomaType somaType () const noexcept
 
CellFamily cellFamily () const noexcept
 
MorphologyVersion version () const noexcept
 
void write (const std::string &filename)
 
void addAnnotation (const morphio::Property::Annotation &annotation)
 
void addMarker (const morphio::Property::Marker &marker)
 
Property::Properties buildReadOnly () const
 
std::unordered_map< int, std::vector< unsigned int > > connectivity ()
 
void removeUnifurcations ()
 
void removeUnifurcations (const morphio::readers::DebugInfo &debugInfo)
 
void _raiseIfUnifurcations ()
 
uint32_t _register (const std::shared_ptr< Section > &)
 

Public Attributes

morphio::readers::ErrorMessages _err
 
uint32_t _counter
 
std::shared_ptr< Soma_soma
 
std::shared_ptr< morphio::Property::CellLevel_cellProperties
 
std::vector< std::shared_ptr< Section > > _rootSections
 
std::map< uint32_t, std::shared_ptr< Section > > _sections
 
Mitochondria _mitochondria
 
EndoplasmicReticulum _endoplasmicReticulum
 
morphio::Property::DendriticSpine::Level _dendriticSpineLevel
 
std::map< uint32_t, uint32_t > _parent
 
std::map< uint32_t, std::vector< std::shared_ptr< Section > > > _children
 

Friends

class Section
 
void modifiers::nrn_order (morphio::mut::Morphology &morpho)
 
bool diff (const Morphology &left, const Morphology &right, morphio::enums::LogLevel verbose)
 

Detailed Description

Mutable(editable) morphio::Morphology

Constructor & Destructor Documentation

◆ Morphology() [1/3]

morphio::mut::Morphology::Morphology ( const std::string &  uri,
unsigned int  options = NO_MODIFIER 
)

Build a mutable Morphology from an on-disk morphology

options is the modifier flags to be applied. All flags are defined in their enum: morphio::enum::Option and can be composed.

Example: Morphology("neuron.asc", TWO_POINTS_SECTIONS | SOMA_SPHERE);

◆ Morphology() [2/3]

morphio::mut::Morphology::Morphology ( const morphio::mut::Morphology morphology,
unsigned int  options = NO_MODIFIER 
)

Build a mutable Morphology from a mutable morphology

◆ Morphology() [3/3]

morphio::mut::Morphology::Morphology ( const morphio::Morphology morphology,
unsigned int  options = NO_MODIFIER 
)

Build a mutable Morphology from a read-only morphology

Member Function Documentation

◆ _raiseIfUnifurcations()

void morphio::mut::Morphology::_raiseIfUnifurcations ( )

Used before writing to SWC to check that there is no unifurcation

◆ annotations()

const std::vector< Property::Annotation > & morphio::mut::Morphology::annotations ( ) const
inlinenoexcept

Return the annotation object

◆ appendRootSection() [1/3]

std::shared_ptr<Section> morphio::mut::Morphology::appendRootSection ( const morphio::Section ,
bool  recursive = false 
)

Append the existing morphio::Section as a root section

If recursive == true, all descendent will be appended as well

◆ appendRootSection() [2/3]

std::shared_ptr<Section> morphio::mut::Morphology::appendRootSection ( const std::shared_ptr< Section > &  section,
bool  recursive = false 
)

Append an existing Section as a root section

If recursive == true, all descendent will be appended as well

◆ appendRootSection() [3/3]

std::shared_ptr<Section> morphio::mut::Morphology::appendRootSection ( const Property::PointLevel ,
SectionType  sectionType 
)

Append a root Section

◆ breadth_begin()

breadth_iterator morphio::mut::Morphology::breadth_begin ( ) const

Breadth first iterator

If id == -1, the iteration will be successively performed starting at each root section

◆ buildReadOnly()

Property::Properties morphio::mut::Morphology::buildReadOnly ( ) const

Return the data structure used to create read-only morphologies

◆ cellFamily()

CellFamily morphio::mut::Morphology::cellFamily ( ) const
inlinenoexcept

Return the cell family (neuron or glia)

◆ connectivity()

std::unordered_map<int, std::vector<unsigned int> > morphio::mut::Morphology::connectivity ( )

Return the graph connectivity of the morphology where each section is seen as a node Note: -1 is the soma node

◆ deleteSection()

void morphio::mut::Morphology::deleteSection ( std::shared_ptr< Section section,
bool  recursive = true 
)

Delete the given section

Will silently fail if the section is not part of the tree

If recursive == true, all descendent sections will be deleted as well Else, children will be re-attached to their grand-parent

◆ depth_begin()

depth_iterator morphio::mut::Morphology::depth_begin ( ) const

Depth first iterator starting at a given section id

If id == -1, the iteration will start at each root section, successively

◆ endoplasmicReticulum() [1/2]

EndoplasmicReticulum & morphio::mut::Morphology::endoplasmicReticulum ( )
inlinenoexcept

Return the endoplasmic reticulum container class

◆ endoplasmicReticulum() [2/2]

const EndoplasmicReticulum & morphio::mut::Morphology::endoplasmicReticulum ( ) const
inlinenoexcept

Return the endoplasmic reticulum container class

◆ markers()

const std::vector< Property::Marker > & morphio::mut::Morphology::markers ( ) const
inlinenoexcept

Return the markers from the ASC file

◆ mitochondria() [1/2]

Mitochondria & morphio::mut::Morphology::mitochondria ( )
inlinenoexcept

Return the mitochondria container class

◆ mitochondria() [2/2]

const Mitochondria & morphio::mut::Morphology::mitochondria ( ) const
inlinenoexcept

Return the mitochondria container class

◆ removeUnifurcations()

void morphio::mut::Morphology::removeUnifurcations ( )

Fixes the morphology single child sections and issues warnings if the section starts and ends are inconsistent

◆ rootSections()

const std::vector< std::shared_ptr< Section > > & morphio::mut::Morphology::rootSections ( ) const
inlinenoexcept

Returns all section ids at the tree root

◆ section()

const std::shared_ptr< Section > & morphio::mut::Morphology::section ( uint32_t  id) const
inline

Get the shared pointer for the given section

Note: multiple morphologies can share the same Section instances.

◆ sections()

const std::map< uint32_t, std::shared_ptr< Section > > & morphio::mut::Morphology::sections ( ) const
inlinenoexcept

Returns the dictionary id -> Section for this tree

◆ soma() [1/2]

std::shared_ptr< Soma > & morphio::mut::Morphology::soma ( )
inlinenoexcept

Returns a shared pointer on the Soma

Note: multiple morphologies can share the same Soma instance

◆ soma() [2/2]

const std::shared_ptr< Soma > & morphio::mut::Morphology::soma ( ) const
inlinenoexcept

Returns a shared pointer on the Soma

Note: multiple morphologies can share the same Soma instance

◆ somaType()

SomaType morphio::mut::Morphology::somaType ( ) const
inlinenoexcept

Return the soma type

◆ version()

MorphologyVersion morphio::mut::Morphology::version ( ) const
inlinenoexcept

Return the version

◆ write()

void morphio::mut::Morphology::write ( const std::string &  filename)

Write file to H5, SWC, ASC format depending on filename extension

Friends And Related Function Documentation

◆ diff

bool diff ( const Morphology left,
const Morphology right,
morphio::enums::LogLevel  verbose 
)
friend

Perform a diff on 2 morphologies, returns True if items differ