6 #include <unordered_map>
9 #include <morphio/errorMessages.h>
10 #include <morphio/exceptions.h>
11 #include <morphio/mut/endoplasmic_reticulum.h>
12 #include <morphio/mut/mitochondria.h>
13 #include <morphio/mut/modifiers.h>
14 #include <morphio/mut/soma.h>
15 #include <morphio/properties.h>
16 #include <morphio/types.h>
21 bool _checkDuplicatePoint(
const std::shared_ptr<Section>& parent,
22 const std::shared_ptr<Section>& current);
29 : _soma(std::make_shared<Soma>())
56 const std::vector<std::shared_ptr<Section>>&
rootSections() const noexcept {
61 const std::map<uint32_t, std::shared_ptr<Section>>&
sections() const noexcept {
70 std::shared_ptr<Soma>&
soma() noexcept {
79 const std::shared_ptr<Soma>&
soma() const noexcept {
95 return _endoplasmicReticulum;
100 return _endoplasmicReticulum;
104 const std::vector<Property::Annotation>&
annotations() const noexcept {
105 return _cellProperties->_annotations;
109 const std::vector<Property::Marker>&
markers() const noexcept {
110 return _cellProperties->_markers;
118 const std::shared_ptr<Section>&
section(uint32_t
id)
const {
119 return _sections.at(
id);
162 bool recursive =
false);
168 void applyModifiers(
unsigned int modifierFlags);
172 return _soma->type();
177 return _cellProperties->_cellFamily;
182 return _cellProperties->_version;
186 void write(
const std::string& filename)
const;
189 _cellProperties->_annotations.push_back(annotation);
193 _cellProperties->_markers.push_back(marker);
204 std::unordered_map<int, std::vector<unsigned int>>
connectivity();
213 std::shared_ptr<Soma> _soma;
214 std::shared_ptr<morphio::Property::CellLevel> _cellProperties;
215 EndoplasmicReticulum _endoplasmicReticulum;
219 std::vector<std::shared_ptr<Section>> _rootSections;
220 std::map<uint32_t, std::shared_ptr<Section>> _sections;
222 Mitochondria _mitochondria;
224 std::map<uint32_t, uint32_t> _parent;
225 std::map<uint32_t, std::vector<std::shared_ptr<Section>>> _children;
227 uint32_t _counter = 0;
229 uint32_t _register(
const std::shared_ptr<Section>&);
232 void eraseByValue(std::vector<std::shared_ptr<Section>>& vec,
233 const std::shared_ptr<Section>
section);
235 friend class Section;
237 friend bool diff(
const Morphology& left,
238 const Morphology& right,
239 morphio::enums::LogLevel verbose);
const Mitochondria & mitochondria() const noexcept
Return the mitochondria container class.
Definition: morphology.h:89
SomaType
Definition: enums.h:54
Definition: section_iterators.hpp:82
SectionType
Definition: enums.h:64
const std::map< uint32_t, std::shared_ptr< Section > > & sections() const noexcept
Returns the dictionary id -> Section for this tree.
Definition: morphology.h:61
SomaType somaType() const noexcept
Return the soma type.
Definition: morphology.h:171
const EndoplasmicReticulum & endoplasmicReticulum() const noexcept
Return the endoplasmic reticulum container class.
Definition: morphology.h:99
@ NO_MODIFIER
Read morphology as is without any modification.
Definition: enums.h:14
Definition: morphology.h:20
depth_iterator depth_begin() const
Definition: properties.h:153
const std::shared_ptr< Soma > & soma() const noexcept
Definition: morphology.h:79
Definition: endoplasmic_reticulum.h:9
const std::vector< Property::Marker > & markers() const noexcept
Return the markers from the ASC file.
Definition: morphology.h:109
void deleteSection(std::shared_ptr< Section > section, bool recursive=true)
CellFamily
Definition: enums.h:47
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:176
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:56
const std::shared_ptr< Section > & section(uint32_t id) const
Definition: morphology.h:118
Definition: errorMessages.h:35
Definition: properties.h:177
MorphologyVersion version() const noexcept
Return the version.
Definition: morphology.h:181
Definition: mitochondria.h:21
Mitochondria & mitochondria() noexcept
Return the mitochondria container class.
Definition: morphology.h:84
EndoplasmicReticulum & endoplasmicReticulum() noexcept
Return the endoplasmic reticulum container class.
Definition: morphology.h:94
void removeUnifurcations()
Definition: properties.h:135
Property::Properties buildReadOnly() const
Return the data structure used to create read-only morphologies.
Definition: errorMessages.h:83
Definition: section_iterators.hpp:53
const std::vector< Property::Annotation > & annotations() const noexcept
Return the annotation objects.
Definition: morphology.h:104
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:25
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:70
Definition: properties.h:62