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 (std::shared_ptr< WarningHandler > warning_handler=nullptr)
 
 Morphology (const std::string &uri, unsigned int options=NO_MODIFIER, std::shared_ptr< WarningHandler > warning_handler=nullptr)
 
 Morphology (const HighFive::Group &group, unsigned int options=NO_MODIFIER, std::shared_ptr< WarningHandler > warning_handler=nullptr)
 Build a mutable Morphology from an HighFive::Group.
 
 Morphology (const mut::Morphology &morphology, unsigned int options=NO_MODIFIER, std::shared_ptr< WarningHandler > warning_handler=nullptr)
 Build a mutable Morphology from a mutable morphology.
 
 Morphology (const morphio::Morphology &morphology, unsigned int options=NO_MODIFIER, std::shared_ptr< WarningHandler > warning_handler=nullptr)
 Build a mutable Morphology from a read-only morphology.
 
const std::vector< std::shared_ptr< Section > > & rootSections () const noexcept
 Returns all section ids at the tree root.
 
const std::map< uint32_t, std::shared_ptr< Section > > & sections () const noexcept
 Returns the dictionary id -> Section for this tree.
 
std::shared_ptr< Soma > & soma () noexcept
 
const std::shared_ptr< Soma > & soma () const noexcept
 
Mitochondriamitochondria () noexcept
 Return the mitochondria container class.
 
const Mitochondriamitochondria () const noexcept
 Return the mitochondria container class.
 
EndoplasmicReticulumendoplasmicReticulum () noexcept
 Return the endoplasmic reticulum container class.
 
const EndoplasmicReticulumendoplasmicReticulum () const noexcept
 Return the endoplasmic reticulum container class.
 
const std::vector< Property::Annotation > & annotations () const noexcept
 Return the annotation objects.
 
const std::vector< Property::Marker > & markers () const noexcept
 Return the markers from the ASC file.
 
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)
 Append a root Section.
 
void applyModifiers (unsigned int modifierFlags)
 
SomaType somaType () const noexcept
 Return the soma type.
 
CellFamily cellFamily () const noexcept
 Return the cell family (neuron or glia)
 
MorphologyVersion version () const noexcept
 Return the version.
 
void write (const std::string &filename) const
 Write file to H5, SWC, ASC format depending on filename extension.
 
void addAnnotation (const Property::Annotation &annotation)
 
void addMarker (const Property::Marker &marker)
 
Property::Properties buildReadOnly () const
 Return the data structure used to create read-only morphologies.
 
std::unordered_map< int, std::vector< unsigned int > > connectivity ()
 
void removeUnifurcations ()
 
std::shared_ptr< WarningHandlergetWarningHandler () const
 

Public Attributes

std::shared_ptr< Soma_soma
 
std::shared_ptr< Property::CellLevel_cellProperties
 
EndoplasmicReticulum _endoplasmicReticulum
 
Property::DendriticSpine::Level _dendriticSpineLevel
 

Friends

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

Detailed Description

Mutable(editable) morphio::Morphology

Constructor & Destructor Documentation

◆ Morphology()

morphio::mut::Morphology::Morphology ( const std::string &  uri,
unsigned int  options = NO_MODIFIER,
std::shared_ptr< WarningHandler warning_handler = nullptr 
)
explicit

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);

Member Function Documentation

◆ appendRootSection() [1/2]

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/2]

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

◆ 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

◆ 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

◆ removeUnifurcations()

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

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

◆ 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.

◆ soma() [1/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

◆ soma() [2/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

Friends And Related Function Documentation

◆ diff

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

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