Add Interface(s) to/from FieldTrip
See original GitHub issueAs requested by @agramfort, here is the todo list:
- Include pymatreader in mne-python to read any kind of mat file (old version and hdf5 based) in a consistent way
- Read MEG data originating from the Neuromag Triux System at Salzburg
- Raw data
- Epoched data
- Averaged Timelocked data
- Write Unittests to verify above functionality
- Import channel descriptions (i.e., type, location, orientation etc)
- Verify this is done correctly.
- Mostly done and tested. Only problem is that FieldTrip always stores channel locations in head coordinates. The reader functions store the data in head coordinates. But for testing, I would need to find out how to transform the device coords of the mne read FIFF file object to head coords.
- Create mat files with that testing data
- Verify this is done correctly.
- Read EEG, EOG, ECG and misc channels. Done and tested for Neuromag Sytsmes
- Read event data from FieldTrip raw data structure
- Make sure this all works with data from other systems. Just reading the MEG/EEG data should not be problematic at all. The metadata might be.
- Read Power and other spectra
- Read Time-Frequency data
- Read Source Space data
The corresponding PR is #5141
I leave the original issue here for reference:
I think, it would be great if it was possible to go back and forth between FieldTrip and mne-python.
We have a motivated and skilled student who will be supervised by me. Our group is very interested in this feature, so we are willing to contribute significant work.
I would suggest that we try to go for a solution that is as universal as possible from the beginning:
- Read and write all available data structures: 1.1. Raw Data 1.2. Epoched Data 1.3. Averaged Timelocked Data 1.4. Power and other spectra (i.e. frequency resolved data), averaged and single trial 1.5. Time-Frequency Data (averaged and single trial) 1.6. Source Space Data
- Use .mat files at least for the import, possibly also for the export. 2.1. Be agnostic to the version of the .mat file (old version vs. the hdf5 based one). This would require writing some sort of abstraction on top of the scipy.io and h5py or pytables
One of the main questions that comes to mind is where this would fit into the structure of mne-python. One obvious place would of course be mne.io. However, we are not only dealing with raw data here, for which that package would be the logical spot.
So, for the moment, I see two possibilities:
- Write one
read_fieldtrip
function that automatically detects what kind of data is in the .mat file and then returns the appropriate object. - Write individual functions for every “kind” of data.
I am looking forward to your input!
Best, Thomas
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:38 (38 by maintainers)
Top GitHub Comments
Easier to ask forgiveness than permission 😃
On the other hand the io support for MNE is broken / incomplete in FT and it seems no one takes care of it. Reading FT epochs is a frequent maintenance request and since we have eeglab and brainstorm readers why not a basic API that can encourage newcomers to try MNE.
My 3 cents. On Thu 14 Dec 2017 at 17:52, Alexandre Gramfort notifications@github.com wrote: