9 #include <morphio/types.h>
10 #include <morphio/vector_types.h>
11 #include <morphio/version.h>
25 using Type = std::array<int, 2>;
30 using Type = std::array<int, 2>;
34 using Type = morphio::Point;
42 using Type = floatType;
46 using Type = floatType;
50 using Type = floatType;
54 using Type = floatType;
58 using Type = uint32_t;
63 std::vector<Point::Type> _points;
64 std::vector<Diameter::Type> _diameters;
65 std::vector<Perimeter::Type> _perimeters;
69 std::vector<Diameter::Type> diameters,
70 std::vector<Perimeter::Type> perimeters = {});
78 std::vector<Section::Type> _sections;
79 std::vector<SectionType::Type> _sectionTypes;
80 std::map<int, std::vector<unsigned int>> _children;
93 std::vector<MitoNeuriteSectionId::Type> _sectionIds;
94 std::vector<MitoPathLength::Type> _relativePathLengths;
95 std::vector<MitoDiameter::Type> _diameters;
103 std::vector<MitoPathLength::Type> relativePathLengths,
104 std::vector<MitoDiameter::Type> diameters);
113 std::vector<Section::Type> _sections;
114 std::map<int, std::vector<unsigned int>> _children;
124 using SectionId_t = int32_t;
125 using SegmentId_t = int32_t;
126 using Offset_t = floatType;
129 SectionId_t sectionId;
130 SegmentId_t segmentId;
135 std::vector<PostSynapticDensity> _post_synaptic_density;
145 std::vector<uint32_t> _sectionIndices;
146 std::vector<morphio::floatType> _volumes;
147 std::vector<morphio::floatType> _surfaceAreas;
148 std::vector<uint32_t> _filamentCounts;
159 , _sectionId(sectionId)
160 , _points(std::move(points))
161 , _details(std::move(details))
162 , _lineNumber(lineNumber) {}
164 AnnotationType _type;
167 std::string _details;
187 MorphologyVersion _version = {
"undefined", 0, 0};
190 std::vector<Annotation> _annotations;
191 std::vector<Marker> _markers;
194 bool operator==(
const CellLevel& other)
const;
195 bool operator!=(
const CellLevel& other)
const;
197 std::string fileFormat()
const {
198 return std::get<0>(_version);
200 uint32_t majorVersion() {
201 return std::get<1>(_version);
203 uint32_t minorVersion() {
204 return std::get<2>(_version);
222 template <
typename T>
223 std::vector<typename T::Type>& get_mut() noexcept;
225 template <
typename T>
226 const std::vector<typename T::Type>& get()
const noexcept;
228 const morphio::MorphologyVersion& version()
const noexcept {
229 return _cellLevel._version;
232 return _cellLevel._cellFamily;
235 return _cellLevel._somaType;
237 template <
typename T>
238 const std::map<int32_t, std::vector<uint32_t>>& children()
const noexcept;
242 std::ostream& operator<<(std::ostream& os,
const Properties& properties);
243 std::ostream& operator<<(std::ostream& os,
const PointLevel& pointLevel);
245 #define INSTANTIATE_TEMPLATE_GET(T, M) \
247 inline std::vector<T::Type>& Properties::get_mut<T>() noexcept { \
251 inline const std::vector<T::Type>& Properties::get<T>() const noexcept { \
255 INSTANTIATE_TEMPLATE_GET(
Point, _pointLevel._points)
256 INSTANTIATE_TEMPLATE_GET(
Perimeter, _pointLevel._perimeters)
257 INSTANTIATE_TEMPLATE_GET(
Diameter, _pointLevel._diameters)
258 INSTANTIATE_TEMPLATE_GET(
MitoSection, _mitochondriaSectionLevel._sections)
259 INSTANTIATE_TEMPLATE_GET(
MitoPathLength, _mitochondriaPointLevel._relativePathLengths)
261 INSTANTIATE_TEMPLATE_GET(
MitoDiameter, _mitochondriaPointLevel._diameters)
262 INSTANTIATE_TEMPLATE_GET(
Section, _sectionLevel._sections)
263 INSTANTIATE_TEMPLATE_GET(
SectionType, _sectionLevel._sectionTypes)
265 #undef INSTANTIATE_TEMPLATE_GET
268 inline const std::map<int32_t, std::vector<uint32_t>>& Properties::children<Section>() const
270 return _sectionLevel._children;
274 inline const std::map<int32_t, std::vector<uint32_t>>& Properties::children<MitoSection>() const
276 return _mitochondriaSectionLevel._children;