MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ infer_from_segments()

std::pair< std::vector< Kakshya::DataDimension >, Kakshya::DataModality > MayaFlux::Yantra::infer_from_segments ( const std::vector< Kakshya::RegionSegment > &  segments,
const std::shared_ptr< Kakshya::SignalSourceContainer > &  container 
)

Infer structure from RegionSegments.

Definition at line 87 of file StructureIntrospection.cpp.

88{
89 if (segments.empty() || !container) {
90 return { { { Kakshya::DataDimension::time(0) } }, Kakshya::DataModality::UNKNOWN };
91 }
92
93 bool consistent_coords = std::ranges::all_of(segments,
94 [&](const auto& seg) {
95 return seg.source_region.end_coordinates.size() == segments[0].source_region.end_coordinates.size();
96 });
97
98 if (consistent_coords) {
99 return infer_from_region(segments[0].source_region, container);
100 }
101
102 auto max_coord_segment = std::ranges::max_element(segments,
103 [](const auto& a, const auto& b) {
104 return a.source_region.end_coordinates.size() < b.source_region.end_coordinates.size();
105 });
106 return infer_from_region(max_coord_segment->source_region, container);
107}
std::pair< std::vector< Kakshya::DataDimension >, Kakshya::DataModality > infer_from_region(const Kakshya::Region &region, const std::shared_ptr< Kakshya::SignalSourceContainer > &container)
Infer structure from Region (placeholder since regions are markers)

References infer_from_region(), MayaFlux::Kakshya::DataDimension::time(), and MayaFlux::Kakshya::UNKNOWN.

Referenced by infer_structure().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: