5 #include <unordered_map>
8 #include <morphio/errorMessages.h>
9 #include <morphio/exceptions.h>
10 #include <morphio/mut/endoplasmic_reticulum.h>
11 #include <morphio/mut/mitochondria.h>
12 #include <morphio/mut/modifiers.h>
13 #include <morphio/mut/soma.h>
14 #include <morphio/properties.h>
15 #include <morphio/types.h>
20 bool _checkDuplicatePoint(
const std::shared_ptr<Section>& parent,
21 const std::shared_ptr<Section>& current);
28 : _soma(std::make_shared<Soma>())
58 inline const std::vector<std::shared_ptr<Section>>&
rootSections()
const noexcept;
63 inline const std::map<uint32_t, std::shared_ptr<Section>>&
sections()
const noexcept;
70 inline std::shared_ptr<Soma>&
soma() noexcept;
77 inline const std::shared_ptr<Soma>&
soma()
const noexcept;
100 inline const std::vector<Property::Annotation>&
annotations()
const noexcept;
105 inline const std::vector<Property::Marker>&
markers()
const noexcept;
112 inline const std::shared_ptr<Section>&
section(uint32_t
id)
const;
160 bool recursive =
false);
168 void applyModifiers(
unsigned int modifierFlags);
183 inline MorphologyVersion
version()
const noexcept;
188 void write(
const std::string& filename);
203 std::unordered_map<int, std::vector<unsigned int>>
connectivity();
222 morphio::enums::LogLevel verbose);
225 uint32_t _register(
const std::shared_ptr<Section>&);
227 uint32_t _counter = 0;
228 std::shared_ptr<Soma> _soma;
229 std::shared_ptr<morphio::Property::CellLevel> _cellProperties;
230 std::vector<std::shared_ptr<Section>> _rootSections;
231 std::map<uint32_t, std::shared_ptr<Section>> _sections;
237 std::map<uint32_t, uint32_t> _parent;
238 std::map<uint32_t, std::vector<std::shared_ptr<Section>>> _children;
241 void eraseByValue(std::vector<std::shared_ptr<Section>>& vec,
242 const std::shared_ptr<Section>
section);
246 return _rootSections;
262 return _mitochondria;
266 return _mitochondria;
270 return _endoplasmicReticulum;
274 return _endoplasmicReticulum;
278 return _sections.at(
id);
282 return _soma->type();
286 return _cellProperties->_annotations;
290 return _cellProperties->_markers;
294 return _cellProperties->_cellFamily;
298 return _cellProperties->_version;
302 _cellProperties->_annotations.push_back(annotation);
306 _cellProperties->_markers.push_back(marker);
const std::vector< Property::Annotation > & annotations() const noexcept
Definition: morphology.h:285
Definition: properties.h:210
SomaType
Definition: enums.h:52
const std::vector< Property::Marker > & markers() const noexcept
Definition: morphology.h:289
Definition: section_iterators.hpp:81
SectionType
Definition: enums.h:62
SomaType somaType() const noexcept
Definition: morphology.h:281
const std::shared_ptr< Section > & section(uint32_t id) const
Definition: morphology.h:277
@ NO_MODIFIER
Read morphology as is without any modification.
Definition: enums.h:14
Definition: morphology.h:20
depth_iterator depth_begin() const
const std::vector< std::shared_ptr< Section > > & rootSections() const noexcept
Definition: morphology.h:245
Definition: properties.h:153
Definition: endoplasmic_reticulum.h:9
void deleteSection(std::shared_ptr< Section > section, bool recursive=true)
CellFamily
Definition: enums.h:45
friend bool diff(const Morphology &left, const Morphology &right, morphio::enums::LogLevel verbose)
CellFamily cellFamily() const noexcept
Definition: morphology.h:293
Mitochondria & mitochondria() noexcept
Definition: morphology.h:261
Definition: properties.h:187
Definition: errorMessages.h:35
Definition: properties.h:177
const std::map< uint32_t, std::shared_ptr< Section > > & sections() const noexcept
Definition: morphology.h:249
MorphologyVersion version() const noexcept
Definition: morphology.h:297
void write(const std::string &filename)
Definition: mitochondria.h:21
void removeUnifurcations()
Definition: properties.h:135
Property::Properties buildReadOnly() const
Definition: errorMessages.h:105
void _raiseIfUnifurcations()
Definition: section_iterators.hpp:53
std::unordered_map< int, std::vector< unsigned int > > connectivity()
EndoplasmicReticulum & endoplasmicReticulum() noexcept
Definition: morphology.h:269
Definition: morphology.h:24
breadth_iterator breadth_begin() const
std::shared_ptr< Section > appendRootSection(const morphio::Section &, bool recursive=false)
Definition: properties.h:62
std::shared_ptr< Soma > & soma() noexcept
Definition: morphology.h:253