OpenMA / openma

Library to explore, process, and analyze movement acquisition data
Other
44 stars 8 forks source link

Issue with the EMG Elite (BTS) file format in BTK that needs to be fixed in OpenMA #47

Closed Alzathar closed 7 years ago

Alzathar commented 7 years ago

This post on the OpenMA forum mentioned an issue with the loading of the EMG data with BTK. This needs to be fixed in OpenMA. Some data are requested to improve the parser.

marnunez commented 7 years ago

Were should this be fixed? I found no IO code in OpenMA besides of c3d. Should I fork BTK? I can provide samples for any of the old BTS formats, including the .EMG files

Alzathar commented 7 years ago

Currently, the parser for the BTS file formats is not yet available in OpenMA. I created a new issue about the implementation of the parsers for the BTS file formats (see issue #49) .

It is planned to progressively integrate the old BTK parsers in OpenMA. The major work is to adapt the code used to extract the data and load them in the new data structure.

marnunez commented 7 years ago

Found the bug! For some bloody reason, all my EMG files have the channel descriptions with spaces afterwards (e.g: 'L_RF ') while the old ones you had have them stripped off ('L_RF'). Same goes for the units ('mV ' instead of 'mV'). Stripping the whitespaces with a hex editor allowed me to import the files with Mokka. Nevertheless, it should still be considered a bug. BTS EMG data structure has from byte 12 to 268 reserved for file descriptions (that's 8 chars for each one of the 32 channels available) and from 268 to 396 for units (4 chars for each channel)

Alzathar commented 7 years ago

@marnunez Can you attach a file with the extra whitespaces? I would add a unit test with the fix. If you prefer, you can fork openma-data, and create a pull request with this file.

marnunez commented 7 years ago

Sure! Here goes an entire acquisition sample. 22xxx.zip

Alzathar commented 7 years ago

@marnunez The commit 93eb11fbf3cc693c788887cd4d40c088db068fc2 fixed this issue. However, I still need to verify with you the exact number of samples in your EMG file. Is it 4522 or 4523?

Alzathar commented 7 years ago

@marnunez Any chance for you to check the number of samples in the file 22XXXC0B.EMG that returns the BTS software? We will be able to close this issue then.

marnunez commented 7 years ago

@Alzathar Sorry for the delay. Acording to BTS's software, the LRF channel for example has 4522 frames at 500 Hz. This is a text output: LRF.txt

Alzathar commented 7 years ago

@marnunez Thanks for your data. The commit e437d2f3327ad910e769f03f9f4f1c324d90da03 integrated them to verify the implementation of the BTS EMG parser.