load_mobilised_matlab_format#

mobgap.data.load_mobilised_matlab_format(
path: PathLike,
*,
raw_data_sensor: Literal['SU', 'INDIP', 'INDIP2'] | None = 'SU',
reference_system: Literal['INDIP', 'Stereophoto'] | None = None,
sensor_positions: Sequence[str] = ('LowerBack',),
sensor_types: Sequence[Literal['acc', 'gyr', 'mag', 'bar']] = ('acc', 'gyr'),
missing_sensor_error_type: Literal['raise', 'warn', 'ignore'] = 'raise',
missing_reference_error_type: Literal['raise', 'warn', 'ignore'] = 'ignore',
) dict[tuple[str, ...], MobilisedTestData][source]#

Load a single data.mat file formatted according to the Mobilise-D guidelines.

Parameters:
path

Path to the data.mat file.

raw_data_sensor

Which sensor to load the raw data for. One of “SU”, “INDIP”, “INDIP2”. SU is usually the “normal” lower back sensor. INDIP and INDIP2 are only available under special circumstances for the Mobilise-D TVS data. Note, that we don’t support loading multiple sensors at once.

reference_system

When specified, reference gait parameters are loaded using the specified reference system.

sensor_positions

Which sensor positions to load the raw data for. For “SU”, only “LowerBack” is available, but for other sensors, more positions might be available. If a sensor position is not available, an error is raised.

single_sensor_position

The sensor position that is considered the “single sensor”. This is the sensor that you expect to be the input to all pipelines and algorithms. For most Mobilise-d datasets, this should be kept at “LowerBack”. But, we support using other sensors as well.

sensor_types

Which sensor types to load the raw data for. This can be used to reduce the amount of data loaded, if only e.g. acc and gyr data is required. Some sensors might only have a subset of the available sensor types. If a sensor type is not available, it is ignored.

missing_sensor_error_type

Whether to throw an error (“raise”), a warning (“warn”) or ignore (“ignore”) when a sensor is missing. In all three cases, the trial is still included in the index, but the imu-data is not available. If you want to skip the trial entirely, set this to “skip”. Then the trial will not appear in the index at all. Note, that “skip” will skip the trial, if ANY sensor position specified is missing. Specifying, “skip” will only effect the initial data loading. Changing the value after you already created a subset of the data has no effect.

missing_reference_error_type

Whether to throw an error (“raise”), a warning (“warn”) or ignore (“ignore”) when reference data is missing. If you want to skip the trial entirely when the reference data is not available, set this to “skip”. Specifying, “skip” will only effect the initial data loading. Changing the value after you already created a subset of the data has no effect.

Returns:
data_per_test

A dictionary mapping the test names to the loaded data. The name of each test is a tuple of strings, where each string is a level of the test name hierarchy (e.g. (“TimeMeasure1”, “Test1”, “Trial1”)). The number of levels can vary between datasets. The data is returned as a MobilisedTestData named-tuple, which contains the raw data, (optional) reference parameters and metadata.

Notes

This data loader does not cover the entire Mobilise-D data format spec. We focus on the loading of the raw single-sensor data and the reference parameters. Further, we don’t support data files with sensors with different sampling rates or data files that don’t specify a start time per trial (but only a start time per test).

Examples using mobgap.data.load_mobilised_matlab_format#

Loading example data

Loading example data