neurogeriatricskiel / KielMAT

Python based toolbox for processing motion data
https://neurogeriatricskiel.github.io/KielMAT/
Other
6 stars 1 forks source link

Adapt algorithms to the work on the dataclasses #21

Closed JuliusWelzel closed 11 months ago

JuliusWelzel commented 12 months ago

As discussed, we should hand our own data classes to the functions @masoud translated.

Anyone has comments on this?

rmndrs89 commented 12 months ago

In principle the data loaders should just return an instance of a MotionData object. In the first lines of the main loop, the user should then extract the relevant sensor data. In our case this is the acceleration data from the lower back. In pseudo-code that would look like:

motion_data = some_dataset.load_file(file_name)  # MotionData object

# Loop over the list of recordings
for idx, recording_data in enumerate(motion_data.data):
    sampling_frequency = recording_data.sampling_frequency

    # Extract acceleration from the lower back sensor
    lower_back_acc = ...
JuliusWelzel commented 12 months ago

I think it depends if an importer returns a RecordingData or MotionData class. But in general, it should work that way.

rmndrs89 commented 11 months ago

Works for now as expected!