bci.parsers package

Submodules

bci.parsers.color_image module

bci.parsers.color_image.parse_color_image(context, snapshot)

Collects the color image of what the user was seeing at a given timestamp from snapshot. The image itself is stored to disk.

Parameters
  • context (bci.protocol.utils.Context) – Context in the application.

  • snapshot (dict) – Snapshot as consumed from the message queue and converted to dictionary representation.

Returns

A dictionary containing snapshot’s color image metadata.

Return type

dict

bci.parsers.depth_image module

bci.parsers.depth_image.parse_depth_image(context, snapshot)

Collects the depth image of what the user was seeing at a given timestamp from snapshot. The image itself is stored to disk.

Parameters
  • context (bci.protocol.utils.Context) – Context in the application.

  • snapshot (dict) – Snapshot as consumed from the message queue and converted to dictionary representation.

Returns

A dictionary containing snapshot’s depth image metadata.

Return type

dict

bci.parsers.feelings module

bci.parsers.feelings.parse_feelings(context, snapshot)

Collects the feelings the user was experiencing at a given timestamp from snapshot.

Parameters
  • context (bci.protocol.utils.Context) – Context in the application.

  • snapshot (dict) – Snapshot as consumed from the message queue and converted to dictionary representation.

Returns

A dictionary containing snapshot’s feeling field.

Return type

dict

bci.parsers.pose module

bci.parsers.pose.parse_pose(context, snapshot)

Collects the translation and the rotation of the user’s head at a given timestamp from snapshot.

Parameters
  • context (bci.protocol.utils.Context) – Context in the application.

  • snapshot (dict) – Snapshot as consumed from the message queue and converted to dictionary representation.

Returns

A dictionary containing snapshot’s translation and rotation fields.

Return type

dict

bci.parsers.runner module

bci.parsers.runner.get_fields()

Gets the available parser names

bci.parsers.runner.load_parsers()

Imports all submodules of parsers, and creates a dictionary mapping a parser’s field to its function or class.

Returns

A dictionary mapping a parser’s field to its function or class.

Return type

dict

bci.parsers.runner.parse(field, data)

Parses data on field.

Parameters
  • field (str) – Snapshot field to parse.

  • data (str) – JSON-formatted raw data, as consumed from the message queue. The data contains one snapshot alongside the user information.

Returns

The parser result dumped as a JSON-formatted string.

Return type

str

Module contents

bci.parsers.load_parsers()

Imports all submodules of parsers, and creates a dictionary mapping a parser’s field to its function or class.

Returns

A dictionary mapping a parser’s field to its function or class.

Return type

dict

bci.parsers.get_fields()

Gets the available parser names

bci.parsers.parse(field, data)

Parses data on field.

Parameters
  • field (str) – Snapshot field to parse.

  • data (str) – JSON-formatted raw data, as consumed from the message queue. The data contains one snapshot alongside the user information.

Returns

The parser result dumped as a JSON-formatted string.

Return type

str