Input / Output

Warning

File types .sto, .trc, .csv are not tested yet.

This module provides classes for reading biomechanical file-types.

class gaitalytics.io.AnalogsInputFileReader(file_path: Path)

A class for handling analog data in an easy and convenient way.

Uses the pyomeca.Analogs class to read analog data from a file.

__init__(file_path: Path)

Initializes a new instance of the AnalogsInputFileReader class.

Parameters:

file_path – The path to the analog data file.

get_analogs() DataArray

Gets the analog data from the input file.

Returns:

An xarray DataArray containing the analog data.

class gaitalytics.io.AnalysisInputReader(file_path: Path, configs: MappingConfigs)

Read out data from modelled data form different input format.

__init__(file_path: Path, configs: MappingConfigs)

Initializes a new instance of the AnalysisInputReader class.

Parameters:
  • file_path – The path to the input file.

  • configs – The mapping configurations.

get_analysis() DataArray

Gets the analysis data from the input file.

Returns:

An xarray DataArray containing the analysis data.

class gaitalytics.io.C3dEventFileWriter(file_path: Path)

A class for handling C3D files in an easy and convenient way.

write_events(events: DataFrame, file_path: Path | None = None)

Write the events to the output file.

Parameters:
  • events – The events to write to the output file.

  • file_path – The path to the output file if deviating from the input file.

class gaitalytics.io.C3dEventInputFileReader(file_path: Path)

A class for handling C3D files in an easy and convenient way.

Implements the EventInputFileReader interface to read events from C3D files.

__init__(file_path: Path)

Initializes a new instance of the EzC3dFileHandler class.

Parameters:

file_path – The path to the C3D file.

get_events() DataFrame | None

Gets the events from the input file sorted by time.

Returns:

pd.DataFrame A DataFrame containing the events. None if there are no events in the C3D file.

class gaitalytics.io.MarkersInputFileReader(file_path: Path)

A class for handling marker data in an easy and convenient way.

Uses the pyomeca.Markers class to read marker data from a file.

__init__(file_path: Path)

Initializes a new instance of the MarkersInputFileReader class.

Parameters:

file_path – The path to the marker data file.

get_markers() DataArray

Gets the markers from the input file.

Returns:

An xarray DataArray containing the markers.

class gaitalytics.io.NetCDFTrialExporter(file_path: Path)

A class for exporting trial data to NetCDF files.

export_trial(trial: Trial | TrialCycles)

Export the trial to the output folder.

Parameters:
  • trial – The trial to export.

  • folder_path – The path to the output folder.