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;
86 bool diff(
const SectionLevel& other, LogLevel logLevel)
const;
94 std::vector<MitoNeuriteSectionId::Type> _sectionIds;
95 std::vector<MitoPathLength::Type> _relativePathLengths;
96 std::vector<MitoDiameter::Type> _diameters;
104 std::vector<MitoPathLength::Type> relativePathLengths,
105 std::vector<MitoDiameter::Type> diameters);
114 std::vector<Section::Type> _sections;
115 std::map<int, std::vector<unsigned int>> _children;
125 using SectionId_t = int32_t;
126 using SegmentId_t = int32_t;
127 using Offset_t = floatType;
130 SectionId_t sectionId;
131 SegmentId_t segmentId;
136 std::vector<PostSynapticDensity> _post_synaptic_density;
146 std::vector<uint32_t> _sectionIndices;
147 std::vector<morphio::floatType> _volumes;
148 std::vector<morphio::floatType> _surfaceAreas;
149 std::vector<uint32_t> _filamentCounts;
160 , _sectionId(sectionId)
161 , _points(std::move(points))
162 , _details(std::move(details))
163 , _lineNumber(lineNumber) {}
165 AnnotationType _type;
168 std::string _details;
188 MorphologyVersion _version = {
"undefined", 0, 0};
191 std::vector<Annotation> _annotations;
192 std::vector<Marker> _markers;
194 bool diff(
const CellLevel& other, LogLevel logLevel)
const;
195 bool operator==(
const CellLevel& other)
const;
196 bool operator!=(
const CellLevel& other)
const;
198 std::string fileFormat()
const {
199 return std::get<0>(_version);
201 uint32_t majorVersion() {
202 return std::get<1>(_version);
204 uint32_t minorVersion() {
205 return std::get<2>(_version);
223 template <
typename T>
224 std::vector<typename T::Type>& get_mut() noexcept;
226 template <
typename T>
227 const std::vector<typename T::Type>& get()
const noexcept;
229 const morphio::MorphologyVersion& version()
const noexcept {
230 return _cellLevel._version;
233 return _cellLevel._cellFamily;
236 return _cellLevel._somaType;
238 template <
typename T>
239 const std::map<int32_t, std::vector<uint32_t>>& children()
const noexcept;
243 std::ostream& operator<<(std::ostream& os,
const Properties& properties);
244 std::ostream& operator<<(std::ostream& os,
const PointLevel& pointLevel);
246 #define INSTANTIATE_TEMPLATE_GET(T, M) \
248 inline std::vector<T::Type>& Properties::get_mut<T>() noexcept { \
252 inline const std::vector<T::Type>& Properties::get<T>() const noexcept { \
256 INSTANTIATE_TEMPLATE_GET(
Point, _pointLevel._points)
257 INSTANTIATE_TEMPLATE_GET(
Perimeter, _pointLevel._perimeters)
258 INSTANTIATE_TEMPLATE_GET(
Diameter, _pointLevel._diameters)
259 INSTANTIATE_TEMPLATE_GET(
MitoSection, _mitochondriaSectionLevel._sections)
260 INSTANTIATE_TEMPLATE_GET(
MitoPathLength, _mitochondriaPointLevel._relativePathLengths)
262 INSTANTIATE_TEMPLATE_GET(
MitoDiameter, _mitochondriaPointLevel._diameters)
263 INSTANTIATE_TEMPLATE_GET(
Section, _sectionLevel._sections)
264 INSTANTIATE_TEMPLATE_GET(
SectionType, _sectionLevel._sectionTypes)
266 #undef INSTANTIATE_TEMPLATE_GET
269 inline const std::map<int32_t, std::vector<uint32_t>>& Properties::children<Section>() const
271 return _sectionLevel._children;
275 inline const std::map<int32_t, std::vector<uint32_t>>& Properties::children<MitoSection>() const
277 return _mitochondriaSectionLevel._children;