# Unable to open EEGLAB file

**URL:** <https://mne.discourse.group/t/unable-to-open-eeglab-file/3110>\
**Category:** Support & Discussions\
**Tags:** eeg\
**Created:** [May 9, 2021, 3:08pm UTC](https://mne.discourse.group/t/unable-to-open-eeglab-file/3110 "2021-05-09T15:08:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![balandongiv](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/balandongiv/32/104_2.png) [@balandongiv](https://mne.discourse.group/u/balandongiv)\
**Post date:** [May 9, 2021, 3:08pm UTC](https://mne.discourse.group/t/unable-to-open-eeglab-file/3110/1 "2021-05-09T15:08:29Z")

</div>

When opening the `.set` file, using the code below

```python

import mne
raw = mne.io.read_raw_eeglab('s01_051017m.set')

```

the compiler return an error

`IsADirectoryError: [Errno 21] Is a directory: 's01_051017m.set'`

May I know how to solve this issue.

The `.set` file is accessible via the following link: [https://ndownloader.figshare.com/files/14242478](https://ndownloader.figshare.com/files/14242478)

- MNE-Python version: 0.21.2
- operating system: Ubuntu

Appreciate for any help

---

<div class="post-metadata">

**Author:** ![agramfort](https://avatars.discourse-cdn.com/v4/letter/a/7c8e57/32.png) [@agramfort](https://mne.discourse.group/u/agramfort)\
**Post date:** [May 9, 2021, 4:03pm UTC](https://mne.discourse.group/t/unable-to-open-eeglab-file/3110/2 "2021-05-09T16:03:26Z")

</div>

you passed the folder name and not the file to the read\_raw\_eeglab

I tested and it works fine

A

---

<div class="post-metadata">

**Author:** ![balandongiv](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/balandongiv/32/104_2.png) [@balandongiv](https://mne.discourse.group/u/balandongiv)\
**Post date:** [May 10, 2021, 1:01am UTC](https://mne.discourse.group/t/unable-to-open-eeglab-file/3110/3 "2021-05-10T01:01:48Z")

</div>

Hi @agramfort , thanks for the clarification.  
I changed the following and now it works.

```python
raw = mne.io.read_raw_eeglab('s01_051017m.set/s01_051017m.set')
print(raw.annotations)

```

outputted:

> Reading s01\_051017m.set/s01\_051017m.fdt  
> \<Annotations | 597 segments: 251 (95), 252 (104), 253 (199), 254 (199)\>

But within the folder `s01_051017m.set`, there are two files, `.fdt` and `.set`

> s01\_051017m.set  
> -s01\_051017m.fdt  
> -s01\_051017m

I am curios on how to open the `.fdt` file, or does the above amended code open the `.fdt` simultaneously?  
I read the documentation on `read_raw_eeglab`, and it mentioned

> **input\_fname** [`str`](https://docs.python.org/3/library/stdtypes.html#str)
> 
> Path to the .set file. If the data is stored in a separate .fdt file, it is expected to be in the same folder as the .set file

However, I’m not so clear whether `.fdt` is open simultaneously.

I assume, the `.fdt` contained the time series signal.

Sorry, this is my first time work with `.set` file.

---

<div class="post-metadata">

**Author:** ![balandongiv](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/balandongiv/32/104_2.png) [@balandongiv](https://mne.discourse.group/u/balandongiv)\
**Post date:** [May 10, 2021, 2:26am UTC](https://mne.discourse.group/t/unable-to-open-eeglab-file/3110/4 "2021-05-10T02:26:54Z")

</div>

Based on the discussion.

> <https://github.com/mne-tools/mne-python/issues/2672>
>
> I was wondering if you have any tools for reading eeglab \`.set\` files (along wit…h \`.fdt\`) and converting to mne-python representation?
> It would have seemed easy to do if not for the fact that sometimes (always?) \`scipy.io.loadmat\` fails in reading eeglab \`.set\` files (eeglab \`.set\` files are just \`.mat\` files). See my issue on \`scipy\` repo \[here\](https://github.com/scipy/scipy/issues/5516).

> <https://github.com/mne-tools/mne-bids/issues/88>
>
> EEGLAB files are MATLAB files ... albeit with a \`.set\` extension instead of the …usual \`.mat\`. The EEGLAB files can contain the EEG data in a matlab struct field called \`data\`. However, this \`data\` field can alternatively contain a link to an accompanying (separate) \`.fdt\` (=FloatDaTa) file. 
> 
> Currently MNE-BIDS only allows the standalone \`.set\` files and thorws an error when an \`.set\`+\`.fdt\` combination is used. This should be fixed, see:
> 
> https://github.com/mne-tools/mne-bids/blob/7403fc56b33bfe9b61e2cd7ee214ab9ad24312b0/mne\_bids/utils.py#L497-L505

> Fdt is not matlab file. It’s a companion file to a .set file that is actually a .mat file

Hence,

```python
import mne
raw = mne.io.read_raw_eeglab('s01_051017m.set/s01_051017m.set')
raw.plot(start=5, duration=5)

```

will produce the following graph

 ![Snap 2021-05-10 at 10.25.32](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/28368c55b59801bb7e1c3f4db92a8888d9c73e7a.png)

This confirmed that, the `read_raw_eeglab` load the `.fdt` simultaneously.

---

<div class="post-metadata">

**Author:** ![cbrnr](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/cbrnr/32/1409_2.png) [@cbrnr](https://mne.discourse.group/u/cbrnr)\
**Post date:** [May 10, 2021, 8:50am UTC](https://mne.discourse.group/t/unable-to-open-eeglab-file/3110/5 "2021-05-10T08:50:58Z")

</div>

Yes, you always pass the `.set` file, and MNE will auto-detect if there is an additional `.fdt` file.
