ReUseX  0.0.5
3D Point Cloud Processing for Building Reuse
Loading...
Searching...
No Matches
rux::database::LabelRouter Class Reference

Router for segmentation_images (read-only). More...

#include <label_router.hpp>

Inheritance diagram for rux::database::LabelRouter:
Collaboration diagram for rux::database::LabelRouter:

Public Member Functions

DataPayload get (const std::vector< PathComponent > &components) override
 Get resource data at the given path.
void set (const std::vector< PathComponent > &components, const DataPayload &data) override
 Set resource data at the given path.
void del (const std::vector< PathComponent > &components) override
 Delete resource at the given path.
std::vector< std::string > list () const override
 List all items in this collection.
 ResourceRouter (std::shared_ptr< reusex::ProjectDB > db)
Public Member Functions inherited from rux::database::ResourceRouter
 ResourceRouter (std::shared_ptr< reusex::ProjectDB > db)
virtual ~ResourceRouter ()=default
std::optional< std::string > resolve_index (int index) const
 Resolve array index to item name/id.

Additional Inherited Members

Protected Attributes inherited from rux::database::ResourceRouter
std::shared_ptr< reusex::ProjectDBdb_

Detailed Description

Router for segmentation_images (read-only).

Each entry is a per-frame semantic label raster keyed by sensor-frame node_id. The in-memory format is CV_32S with -1 for background and 0+ for class ids.

Handles paths like:

  • labels → list all node_ids (JSON array)
  • labels.<id> → PNG of the raster, stored CV_16U +1 offset (background = 0). Use .metadata for headers.
  • labels[N] → same as above, by index
  • labels.<id>.metadata → JSON with node_id, width, height, num_classes
  • labels.<id>.image → PNG of the raster (same as default)

Definition at line 26 of file label_router.hpp.

Member Function Documentation

◆ del()

void rux::database::LabelRouter::del ( const std::vector< PathComponent > & components)
overridevirtual

Delete resource at the given path.

Parameters
componentsParsed path components (after collection)
Exceptions
std::runtime_errorif operation fails

Implements rux::database::ResourceRouter.

◆ get()

DataPayload rux::database::LabelRouter::get ( const std::vector< PathComponent > & components)
overridevirtual

Get resource data at the given path.

Parameters
componentsParsed path components (after collection)
Returns
Data payload
Exceptions
std::runtime_errorif path is invalid or resource not found

Implements rux::database::ResourceRouter.

◆ list()

std::vector< std::string > rux::database::LabelRouter::list ( ) const
overridevirtual

List all items in this collection.

Used for wildcard expansion and array indexing. Returns items in deterministic order (see MEMORY.md).

Returns
Ordered list of item names/ids

Implements rux::database::ResourceRouter.

◆ ResourceRouter()

rux::database::ResourceRouter::ResourceRouter ( std::shared_ptr< reusex::ProjectDB > db)
inlineexplicit

Definition at line 28 of file resource_router.hpp.

◆ set()

void rux::database::LabelRouter::set ( const std::vector< PathComponent > & components,
const DataPayload & data )
overridevirtual

Set resource data at the given path.

Parameters
componentsParsed path components (after collection)
dataInput data
Exceptions
std::runtime_errorif operation fails

Implements rux::database::ResourceRouter.


The documentation for this class was generated from the following file: