-
Notifications
You must be signed in to change notification settings - Fork 92
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
Motion-BIDS #1145
Comments
Hello! 👋 Thanks for opening your first issue here! ❤️ We will try to get back to you soon. 🚴🏽♂️ |
Hi @JuliusWelzel thanks for the proposal :-) perhaps looking at the PR that made NIRS available in MNE-BIDS can be helpful: https://github.com/mne-tools/mne-bids/pull/406/files what exactly will you need mne-bids to do? Have you worked with mne-bids before? If not, I'd recommend you have a look at the examples and execute them yourself / play around with them ... or perhaps try to convert one of your EEG datasets (if you have one) to BIDS via mne-bids. |
@sappelhoff Thank you for the help. I Converted a few EEG datasets via MNE-BIDS. NIRS and other data have dedicated formats to be read into MNE as far as I understand it. This is not the case for motion data I believe. Would it make sense to think about a motion-MNE reader as a first step? The problem is, there are a lot of different motion datatypes available. |
indeed, it'd be good for mne-bids to supply one (or maximally "a few") data format(s) from which to do the conversion. Would it be possible to represent a motion dataset in a MNE-Python does that sound like a possibility? Otherwise you are right ... we'd need readers for each motion file format that you want to support, and we would need to implement these readers outside of mne-bids (and possibly even outside of mne-python, as a separate package) |
I will check if that is possible. It still would be good to write import functions for |
I've looked at a couple of options to get motion data into MNE. One solution would be using the Would it be possible to add a dedicated Any feedback is appreciated :) |
For the mne-bids converter you indeed first need a python-based reader supported in MNE-Python. AFAIK the EDF format is not used by any motion capture systems, so I don't think that is of use as it just shifts the problem to "How do I convert my data in Python from The first MNE-Python importer that I would write is one that imports the data from the motion-BIDS format, i.e. one that reads the tsv+json files and represents it as MNE-Python data in memory. |
That is true indeed. The idea is to provide Python import function for the most common used formats in the future.
That would require MNE to accept motion as a channel type? |
what exactly would a motion channel type look like? How would it be different from the channel types that are already supported in MNE-Python? --> https://mne.tools/dev/overview/implementation.html#supported-channel-types
I think we agree that for now it's important that we clarify how to represent motion data in MNE-Python data structures. Once we have that, we can work on several ways how to go from raw motion data to MNE-Python data structures. (Note that here I would place a slightly different focus from Robert: I'd try to prepare examples how to easily convert from some raw motion data to MNE-Python data, instead of directly from BIDS to MNE-Python data, ... because the latter would require people to organize their data in BIDS, which is something we want them to do automatically via mne-bids) Once that is done, converting to BIDS via mne-bids would be easy. |
The current specification of motion channel types can be found here. There is some overlap ( For now, all relevant information for motion data from a |
You may want to have a look at https://www.fieldtriptoolbox.org/example/bids_motion/ for an example, the data (sourcedata including data in 4 original formats and bids using data2bids) is available from here https://download.fieldtriptoolbox.org/example/bids_motion/. Please note that I did not review this example for quite some time and hence it might be outdated wrt details that have been updated in the spec. If you find something that is not correct, please file an issue on https://github.com/fieldtrip/website/issues so that I can fix it. |
@sjeung and I are finalising the Motion BEP and example datasets and will get back to this fieldtrip example once everything is done |
Yes! Please try to work with what's already there and identify the pain points (if any) -- then we'll take it from there and see what needs to be adjusted in MNE-Python. |
Hello, I have put some code and data for testing here. The repo contains a sample dataset that we typically get from a cheap IMU system. The metadata and data are loaded into some dataclasses and then transfered to an MNE Raw object. When trying to use
So I think, |
sorry I dropped the ball here.
the way I would proceed.
- make sure you can load your data and get an mne Raw object with all the
relevant datatypes. I am not sure we have support for what you need. I
would not use "bio" for IMU signals. It does not sound specific enough to
say what is acceleration, gyro etc. I would really start there.
- then see how to export to bids and make mne-bids happy.
the first part is the hard part I would say as it requires certainly to
change the fiff constants and the internals of the measurement info.
my 2c
… Message ID: ***@***.***>
|
Just chiming in here. Yes that is what I suspect would be the best. This would require you to have a minimal example dataset that you can use for testing and probably some downstream PRs to document this new data-type in MNE-Python. I would open up a issue/PR there to begin. |
Thanks @adam2392 for the pointer. I already uploaded some test data before with code how to get this example into python #1145 (comment). Feel free to have a look and give feedback, in the meantime I will open a PR. |
I have opened the PR. Please let me know, how to implement different types of motion channels. I started already coil types and would like to automatically get channel type constants here. |
Describe the problem
Hello,
as of March the BEP029 for Motion data has been merged into the BIDS specification. There are still some minor details to be finalized, but the core specifications are done.
We would like to extend the functionality of MNE-BIDS to motion data to provide a Python-based tool for converting sourcedata to BIDS. A MatLab based version is already implemented in Fieldtrip with the data2bids with the help of @sjeung, @robertoostenveld and @helenacockx.
Having MNE-BIDS support motion data would make converting data a lot easier for non MatLab users.
Describe your solution
Implementing import functions from the most common used motion data types for MNE and update write_raw_bids to be able to use the
format
: 'motion'.Describe possible alternatives
Prove a more flexible solution without import functions to import motion data in an MNE Raw object and assign relevant metadata to be able to convert data to BIDS.
Additional context
No response
The text was updated successfully, but these errors were encountered: