mito_section.h
1 #pragma once
2 
3 #include <cstdint> // uint32_t
4 #include <memory> // std::shared_ptr
5 #include <vector> // std::vector
6 
7 #include <morphio/properties.h> // Property
8 
9 namespace morphio {
10 namespace mut {
11 
14 {
15  public:
16  MitoSection(Mitochondria* mitochondria,
17  unsigned int id,
18  const Property::MitochondriaPointLevel& pointProperties);
19  MitoSection(Mitochondria* mitochondria, unsigned int id, const morphio::MitoSection& section);
20  MitoSection(Mitochondria* mitochondria, unsigned int id, const MitoSection& section);
21 
22  std::shared_ptr<MitoSection> appendSection(const Property::MitochondriaPointLevel& points);
23 
24  std::shared_ptr<MitoSection> appendSection(const std::shared_ptr<MitoSection>& original_section,
25  bool recursive);
26 
27  std::shared_ptr<MitoSection> appendSection(const morphio::MitoSection& section, bool recursive);
28 
29  std::shared_ptr<MitoSection> parent() const;
30  bool isRoot() const;
31  const std::vector<std::shared_ptr<MitoSection>>& children() const;
32 
36  bool hasSameShape(const MitoSection& other) const noexcept;
37 
41  inline uint32_t id() const noexcept;
42 
46  inline const std::vector<morphio::floatType>& diameters() const noexcept;
47  inline std::vector<morphio::floatType>& diameters() noexcept;
53  inline const std::vector<uint32_t>& neuriteSectionIds() const noexcept;
54  inline std::vector<uint32_t>& neuriteSectionIds() noexcept;
62  inline const std::vector<morphio::floatType>& pathLengths() const noexcept;
63  inline std::vector<morphio::floatType>& pathLengths() noexcept;
66  private:
67  uint32_t id_;
68 
69  Mitochondria* mitochondria_;
70 
71  public:
72  // TODO: make private
74 };
75 
76 inline uint32_t MitoSection::id() const noexcept {
77  return id_;
78 }
79 
80 inline const std::vector<morphio::floatType>& MitoSection::diameters() const noexcept {
81  return _mitoPoints._diameters;
82 }
83 
84 inline const std::vector<uint32_t>& MitoSection::neuriteSectionIds() const noexcept {
85  return _mitoPoints._sectionIds;
86 }
87 
88 inline const std::vector<morphio::floatType>& MitoSection::pathLengths() const noexcept {
89  return _mitoPoints._relativePathLengths;
90 }
91 
92 inline std::vector<morphio::floatType>& MitoSection::diameters() noexcept {
93  return _mitoPoints._diameters;
94 }
95 
96 inline std::vector<uint32_t>& MitoSection::neuriteSectionIds() noexcept {
97  return _mitoPoints._sectionIds;
98 }
99 
100 inline std::vector<morphio::floatType>& MitoSection::pathLengths() noexcept {
101  return _mitoPoints._relativePathLengths;
102 }
103 
104 void friendDtorForSharedPtrMito(MitoSection* section);
105 
106 } // namespace mut
107 } // namespace morphio
morphio::mut::MitoSection::hasSameShape
bool hasSameShape(const MitoSection &other) const noexcept
morphio::MitoSection
Definition: mito_section.h:17
morphio::Property::MitochondriaPointLevel
Definition: properties.h:93
morphio::mut::MitoSection::neuriteSectionIds
const std::vector< uint32_t > & neuriteSectionIds() const noexcept
Definition: mito_section.h:84
morphio::mut::MitoSection::diameters
const std::vector< morphio::floatType > & diameters() const noexcept
Definition: mito_section.h:80
morphio::mut::MitoSection::id
uint32_t id() const noexcept
Definition: mito_section.h:76
morphio::mut::Mitochondria
Definition: mitochondria.h:21
morphio::mut::MitoSection
Definition: mito_section.h:13
morphio::mut::MitoSection::pathLengths
const std::vector< morphio::floatType > & pathLengths() const noexcept
Definition: mito_section.h:88