10 #include <unordered_map>
13 #include <morphio/errorMessages.h>
14 #include <morphio/exceptions.h>
15 #include <morphio/mut/endoplasmic_reticulum.h>
16 #include <morphio/mut/mitochondria.h>
17 #include <morphio/mut/modifiers.h>
18 #include <morphio/mut/soma.h>
19 #include <morphio/properties.h>
20 #include <morphio/types.h>
25 bool _checkDuplicatePoint(
const std::shared_ptr<Section>& parent,
26 const std::shared_ptr<Section>& current);
33 : _soma(std::make_shared<Soma>())
60 const std::vector<std::shared_ptr<Section>>&
rootSections() const noexcept {
65 const std::map<uint32_t, std::shared_ptr<Section>>&
sections() const noexcept {
74 std::shared_ptr<Soma>&
soma() noexcept {
83 const std::shared_ptr<Soma>&
soma() const noexcept {
99 return _endoplasmicReticulum;
104 return _endoplasmicReticulum;
108 const std::vector<Property::Annotation>&
annotations() const noexcept {
109 return _cellProperties->_annotations;
113 const std::vector<Property::Marker>&
markers() const noexcept {
114 return _cellProperties->_markers;
122 const std::shared_ptr<Section>&
section(uint32_t
id)
const {
123 return _sections.at(
id);
166 bool recursive =
false);
172 void applyModifiers(
unsigned int modifierFlags);
176 return _soma->type();
181 return _cellProperties->_cellFamily;
186 return _cellProperties->_version;
190 void write(
const std::string& filename)
const;
193 _cellProperties->_annotations.push_back(annotation);
197 _cellProperties->_markers.push_back(marker);
208 std::unordered_map<int, std::vector<unsigned int>>
connectivity();
217 std::shared_ptr<Soma> _soma;
218 std::shared_ptr<morphio::Property::CellLevel> _cellProperties;
219 EndoplasmicReticulum _endoplasmicReticulum;
223 std::vector<std::shared_ptr<Section>> _rootSections;
224 std::map<uint32_t, std::shared_ptr<Section>> _sections;
226 Mitochondria _mitochondria;
228 std::map<uint32_t, uint32_t> _parent;
229 std::map<uint32_t, std::vector<std::shared_ptr<Section>>> _children;
231 uint32_t _counter = 0;
233 uint32_t _register(
const std::shared_ptr<Section>&);
236 void eraseByValue(std::vector<std::shared_ptr<Section>>& vec,
237 const std::shared_ptr<Section>
section);
239 friend class Section;
241 friend bool diff(
const Morphology& left,
242 const Morphology& right,
243 morphio::enums::LogLevel verbose);
const Mitochondria & mitochondria() const noexcept
Return the mitochondria container class.
Definition: morphology.h:93
SomaType
Definition: enums.h:59
Definition: section_iterators.hpp:82
SectionType
Definition: enums.h:69
const std::map< uint32_t, std::shared_ptr< Section > > & sections() const noexcept
Returns the dictionary id -> Section for this tree.
Definition: morphology.h:65
SomaType somaType() const noexcept
Return the soma type.
Definition: morphology.h:175
const EndoplasmicReticulum & endoplasmicReticulum() const noexcept
Return the endoplasmic reticulum container class.
Definition: morphology.h:103
@ NO_MODIFIER
Read morphology as is without any modification.
Definition: enums.h:18
Definition: morphology.h:24
depth_iterator depth_begin() const
Definition: properties.h:153
const std::shared_ptr< Soma > & soma() const noexcept
Definition: morphology.h:83
Definition: endoplasmic_reticulum.h:13
const std::vector< Property::Marker > & markers() const noexcept
Return the markers from the ASC file.
Definition: morphology.h:113
void deleteSection(std::shared_ptr< Section > section, bool recursive=true)
CellFamily
Definition: enums.h:52
friend bool diff(const Morphology &left, const Morphology &right, morphio::enums::LogLevel verbose)
CellFamily cellFamily() const noexcept
Return the cell family (neuron or glia)
Definition: morphology.h:180
Definition: properties.h:187
const std::vector< std::shared_ptr< Section > > & rootSections() const noexcept
Returns all section ids at the tree root.
Definition: morphology.h:60
const std::shared_ptr< Section > & section(uint32_t id) const
Definition: morphology.h:122
Definition: errorMessages.h:38
Definition: properties.h:177
MorphologyVersion version() const noexcept
Return the version.
Definition: morphology.h:185
Definition: mitochondria.h:25
Mitochondria & mitochondria() noexcept
Return the mitochondria container class.
Definition: morphology.h:88
EndoplasmicReticulum & endoplasmicReticulum() noexcept
Return the endoplasmic reticulum container class.
Definition: morphology.h:98
void removeUnifurcations()
Definition: properties.h:135
Property::Properties buildReadOnly() const
Return the data structure used to create read-only morphologies.
Definition: errorMessages.h:86
Definition: section_iterators.hpp:53
const std::vector< Property::Annotation > & annotations() const noexcept
Return the annotation objects.
Definition: morphology.h:108
void write(const std::string &filename) const
Write file to H5, SWC, ASC format depending on filename extension.
std::unordered_map< int, std::vector< unsigned int > > connectivity()
Definition: morphology.h:29
breadth_iterator breadth_begin() const
std::shared_ptr< Section > appendRootSection(const morphio::Section &, bool recursive=false)
std::shared_ptr< Soma > & soma() noexcept
Definition: morphology.h:74
Definition: properties.h:62