question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add Interface(s) to/from FieldTrip

See original GitHub issue

As 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
  • 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:

  1. 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
  2. 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:

  1. Write one read_fieldtrip function that automatically detects what kind of data is in the .mat file and then returns the appropriate object.
  2. Write individual functions for every “kind” of data.

I am looking forward to your input!

Best, Thomas

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:38 (38 by maintainers)

github_iconTop GitHub Comments

2reactions
larsonercommented, Oct 18, 2018

Easier to ask forgiveness than permission 😃

2reactions
dengemanncommented, Dec 14, 2017

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:

Hi Thomas,

this question was raised in the past and previously we went the other way around which is to have reader and writer for mne fif files in fieldtrip.

it was working with raw, epochs and evoked.

for the rest I am not sure what it involves. When it deals with source space as fieldtrip does not require freesurfer that might be tricky to keep things simple on mne side

Alex

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mne-tools/mne-python/issues/4833#issuecomment-351769535, or mute the thread https://github.com/notifications/unsubscribe-auth/AB0fiqm1fZGX9ia1L87C9LpJEkgRSI3Wks5tAVJegaJpZM4RCKqk .

Read more comments on GitHub >

github_iconTop Results From Across the Web

Code guidelines - FieldTrip toolbox
Graphical-User Interfaces (GUI). If you want to add a user interface (ui) to a figure, use the functions uicontrol and ft_uilayout for setting...
Read more >
EEGLAB and FieldTrip
To import EEGLAB datasets in FieldTrip is to read EEGLAB datasets using the file File-IO interface either using the standard FILE-IO interface or...
Read more >
FAQ - Field Trip
A simple interface. The Basecamp version our team currently loves and uses every single day. Basecamp 4: Yup! Field Trip works with Basecamp...
Read more >
FieldTrip: Open Source Software for Advanced Analysis of ...
FieldTrip is a MATLAB-toolbox for the analysis of MEG, EEG, ... High-level FieldTrip functions have a well-defined function-call interface.
Read more >
Field Trip Request Approval Template - Jotform
With our drag-and-drop interface, it's easy to adjust this Field Trip Request Approval Template to ... Add approvers, emails, conditions, and more.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found