BEL-Public/mffpy

Multiple .bin files

Closed this issue · 5 comments

If extra channels are added to the montage (e.g. EMG, ECG, Respiration) these are saved into the .mff directory as a separate .bin file. For example, if two channels are added to record EMG, the signal data from these channel will show up in signal2.bin, while the rest of the signals will be in signal1.bin. When I try to read in signal data from an .mff with multiple .bin files with get_physical_samples or get_physical_samples_from_epoch it attempts to read in the signals from signal2.bin instead of signal1.bin. A short-term fix would be to make it just always read from signal1.bin and ignore extra channels, but it would also be good to support multiple .bin files, as we now record sleep data with an EMG channel.

I'm going to label this as a bug as we would expect to read all signal files correctly. The suggestion above is a good short-term fix, agreed - but we'll want to achieve a place where we can read all the signals included in an MFF.

@ViridianForge how should we go about resolving this? I can try to find an example .mff with multiple .bin files. Do you think this will end up as a sprint item?

@ephathaway I think for the November BELCO Sprint (context provided since this is a public repository) it will. That said - providing an example file with multiple .bin files would be very useful and much appreciated.

When providing such an example, please make sure that the data therein contains no PIIA or otherwise HIPAA / IRB protected data.

Necro'ing this old thread. @ephathaway and I discussed this issue today and have agreed, that a first short term solution is to implement a simple method to identify what .bin files are present in the candidate .mff. As we believe signal1.bin always corresponds to the EEG data, the approach would be to add a sub-file based identifier that took specific reading actions based on the sub-file name encountered.

An additional feature we should implement that goes along with this issue is ability to handle pnsSet.xml files. These files are generated when recording with the Physio16 kit and contain info about the sensors included. This file is very similar to sensorLayout.xml, so we could potentially create a superclass that encompasses all "sensor files" and then create subclasses for SensorLayout and PNSSet.