-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP : add support for EMG data #1129
base: main
Are you sure you want to change the base?
Conversation
here is quick script to test: import mne
from mne.datasets import eegbci
from mne_bids import write_raw_bids, BIDSPath
subject = 1
run = 2
eegbci.load_data(subject=subject, runs=run, update_path=True)
# Load the data from "2 minutes eyes closed rest"
edf_path = eegbci.load_data(subject=subject, runs=run)[0]
raw = mne.io.read_raw_edf(edf_path, preload=False)
raw.info['line_freq'] = 50 # specify power line frequency as required by BIDS
raw.set_channel_types({ch: "emg" for ch in raw.ch_names})
# zero padding to account for >100 subjects in this dataset
subject_id = '001'
bids_root = "./test_data"
bids_path = BIDSPath(subject=subject_id, task="task", root=bids_root)
write_raw_bids(raw, bids_path, overwrite=True) |
Thanks for initiating this effort. I think there are quite a few distinctions between EMG and EEG (or other electrophysiology data currently in BIDS) that require more attention. Probably, the first issue is which data files/extensions should be allowed. This may seem straightforward, but each manufacturer has quite an obscure data type for themselves. For example, Delsys (.hpf) is not a transparent data file and exclusively requires Delsys File Utility to convert to C3D, CSV etc. OT Bioelecttronica, Noarxon, and TSMi hardware also seem to handle data within their software best. EDF and BDF seem good choices (open source, reach availability across program languages, and fast read-write). The next issue that comes to mind is the sensor placement (anatomical location, inter-electrode distance, number of electrodes, etc.). For EMG (not the high-density version), SENIAM has been the longstanding guideline. But there should also be a feature to allow the user to define custom sensor placement. This can't be handled in the BIDS guidelines for Other differences, such as signal quality metrics, make EMG more distinct from EEG. Instead of Overall, I believe EMG requires more than carrying over the EEG-BIDS specs. Also, a decision should be made on whether to include HDsEMG, iEMG, and iEMG arrays in bids-standard/bids-specification#1371. We will circulate the first draft of the arguments for 1-including all EMG modalities under one BIDS specification proposal and 2-HDsEMG metadata information that is not covered by other modalities this week. Given the active development of EMG interfaces at Reality Labs, It would be great if folks at MRL could join the effort here and in BIDS. |
In the development of previous BEPs we experienced that being able to jointly look at an example was very helpful. @neuromechanist can you share a HD-sEMG dataset? Data from a single subject will do. Converting that to a draft BIDS dataset will reveal the challenges to be addressed. |
happy to serve as the interface with folks at Meta Reality Labs !
yes EMG is a bit different but I see a lot of similarities too. I really
see the EEG standard as the building block for EMG
and I would seek for concept reuse as much as possible.
let me know how I could help
…On Mon, Apr 10, 2023 at 1:21 PM Robert Oostenveld ***@***.***> wrote:
In the development of previous BEPs we experienced that being able to
jointly look at an example was very helpful. @neuromechanist
<https://github.com/neuromechanist> can you share a HD-sEMG dataset? Data
from a single subject will do. Converting that to a draft BIDS dataset will
reveal the challenges to be addressed.
—
Reply to this email directly, view it on GitHub
<#1129 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABHKHCFSRZ3YEH6IQKQCT3XAPUMZANCNFSM6AAAAAAWSTE4BA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I agree, let's try to go this route |
Of course, here is the link to a sample comparative data I collected a while ago with three systems: OTB Sessantaquattro, Delsys Galelio, and g.tec Pangolin: EMG sample files. Both original files and converted files are included for convenience.
I 100% agree. Signal-wise, I see not much difference in storing any electrophysiological data either. However, what those signals mean, where they are collected from, and how they could/should be analyzed or reproduced are totally different stories. I guess that it may turn out that the main items that may require updating are the required and recommended metadata to ensure transparency, reusability, and reproducibility. |
I have had a first pass at converting the 4 examples. See here as a shared folder on my google drive. The The main information that is missing to make the data FAIR (especially reusable) is documentation on the electrode placement (which muscle, which arrangement), and on the montage and/or recording reference and ground. Furthermore, task information and timing of events is missing. Other than that, my guess is that MNE-Python (or any other software) would have no difficulty reading this BIDS-converted data, i.e., the interoperability should already be quite good. |
I realized that it may be best to move the discussion about the additional information needed to describe the signals to the BIDS issue. Please feel free to share your comments there. |
I 100% agree. Signal-wise, I see not much difference in storing any
electrophysiological data either. However, what those signals mean, where
they are collected from, and how they could/should be analyzed or
reproduced are totally different stories.
I would not be so assertive. I suspect you also end up defining trials,
epochs that are described by conditions and you analyse and use using
signal processing tools (spectral etc.
|
a quick attempt to see what it would take to support EMG data for mne-bids
cc @neuromechanist @robertoostenveld
follow up on bids-standard/bids-specification#1371