# Using fieldtrip processed .mat data with MNE

**URL:** <https://mne.discourse.group/t/using-fieldtrip-processed-mat-data-with-mne/6366>\
**Category:** Support & Discussions\
**Tags:** data-import\
**Created:** [February 17, 2023, 5:33am UTC](https://mne.discourse.group/t/using-fieldtrip-processed-mat-data-with-mne/6366 "2023-02-17T05:33:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![saurabhr](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/saurabhr/32/2263_2.png) [@saurabhr](https://mne.discourse.group/u/saurabhr)\
**Post date:** [February 17, 2023, 5:33am UTC](https://mne.discourse.group/t/using-fieldtrip-processed-mat-data-with-mne/6366/1 "2023-02-17T05:33:01Z")

</div>

- MNE version: ‘1.2.1’

- operating system: macOS 12.6

I am using publicly available MEG data from Donder’s institute website.  
Data is already preprocessed using FieldTrip and I am able to load it in python using _mat73_ package. I get a dictionary as shown in the embedded image here for a condition in participant’s dataset.  
This dictionary is itself in a dictionary as a value to key called _data_.

As this my first time using MNE as well as with MEG data, I am not sure how to use this mat file data in MNE.

 ![image](https://global.discourse-cdn.com/free1/uploads/mne/original/2X/1/15a63352ea32ae72640ea5d0ae052ab36d7741bc.png)

Any help will be very appreciated!

---

<div class="post-metadata">

**Author:** ![richard](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/richard/32/15_2.png) [@richard](https://mne.discourse.group/u/richard)\
**Post date:** [February 17, 2023, 7:44am UTC](https://mne.discourse.group/t/using-fieldtrip-processed-mat-data-with-mne/6366/2 "2023-02-17T07:44:15Z")

</div>

Hello, MNE provides dedicated functions for reading FieldTrip data:

[https://mne.tools/stable/auto\_tutorials/io/10\_reading\_meg\_data.html#fieldtrip-meg-eeg-data-mat](https://mne.tools/stable/auto_tutorials/io/10_reading_meg_data.html#fieldtrip-meg-eeg-data-mat)

I’d suggest you try the approaches outlined here.

Best wishes  
Richard

---

<div class="post-metadata">

**Author:** ![saurabhr](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/saurabhr/32/2263_2.png) [@saurabhr](https://mne.discourse.group/u/saurabhr)\
**Post date:** [February 17, 2023, 8:24am UTC](https://mne.discourse.group/t/using-fieldtrip-processed-mat-data-with-mne/6366/3 "2023-02-17T08:24:11Z")

</div>

Hi,

Thanks for your response.  
I am now able to read the file through MNE. I got 2 runtime warnings, which are as follows:

1. RuntimeWarning: Importing FieldTrip data without an info dict from the original file. Channel locations, orientations and types will be incorrect. The imported data cannot be used for source analysis, channel interpolation etc.

2. RuntimeWarning: Cannot guess the correct type of channel HLC0037. Making it a MISC channel. (_I got this for many other channels_);

I understand the reason for 1st warning from the documentation but I am confused by 2nd one, what does the 2nd one mean?

Also I do not understand why does \_**channel\_type\_idx[‘eeg’]** has a value ([303, 304, 305, 306, 307, 308, 309, 310] in this case) when the data comes from MEG?

Thanks,  
Saurabh

---

<div class="post-metadata">

**Author:** ![ah5005](https://avatars.discourse-cdn.com/v4/letter/a/8dc957/32.png) [@ah5005](https://mne.discourse.group/u/ah5005)\
**Post date:** [May 12, 2024, 8:57pm UTC](https://mne.discourse.group/t/using-fieldtrip-processed-mat-data-with-mne/6366/4 "2024-05-12T20:57:57Z")

</div>

Hi Saurabh,

I’m wondering if you successfully imported your preprocessed fieldtrip data to MNE?  
I’m currently trying to do the same, but running into problems.

My preprocessed EEG data from fieldtrip is already segmented into trials. I also have a time variable, and a variable that stores all channel labels used.

I do:  
data = ft\_timelockanalysis(cfg, eegdata) %I select a subset of trials (based on condition)  
fieldtrip2fiff(‘data.fif’,data)

But importing this into MNE (using Python), I get many errors regarding missing data, so I wonder if the conversion isn’t happening properly.

If you have any thoughts or ideas about which functions to use, it would be very helpful. Thank you so much!
