Exporting .e Files (Nicolet) to EDFs

Hello everyone,

I have a couple questions about exporting EEG files to EDFs:

  1. The .e files essentially have segmentations like this:

[-bckg-][seg1][bckg][seg2][bckg]

When I use the concatenate time options on the files (to combine them into one so I can export it to an EDF), is it preserving the background signal,
or is it simply giving me:

[seg1][seg2] ?

  1. Am I exporting the files properly? The steps I take to export an .e file is:
  • Create a subject (this is where I place all my EEG files)

  • Right-Click > Import MEG/EEG > Select my .e File > Select all the data from the sleep list and process them using concatenate time > Right-Click the newly generated Data > File > Export to File > EDF

Is there a better way to do this?

P.S I uploaded some pictures to give you a better understanding of what I meant by "sleep list" and "newly generated data"

Thank you so much for time!

-Shmyrde Jean-Paul

I'm not sure what this means... I guess it depends on how you proceed.
This should be something easy to test anyway, isn't it?

Right-Click > Import MEG/EEG > Select my .e File > Select all the data from the sleep list and process them using concatenate time > Right-Click the newly generated Data > File > Export to File > EDF

I would rather convert directly from the continuous .e to a continuous .edf file, without this importing step. Are you proceeding in this way because you want to exclude some of the data blocs from the output EDF file?

Why do you need to export to EDF?
This should be avoided if possible, and maybe replaced with the BrainVision format if you need to take the data outside of Matlab:

https://bids-specification.readthedocs.io/en/stable/04-modality-specific-files/03-electroencephalography.html#eeg-recording-data

There main problem with the EDF file format is that it cannot store floating point values.
In the Nicolet .e file recordings, the values are probably stored as integers (16, 24 or 32 bits). When imported to Brainstorm, the channel gains are applied and the values are saved as floating points double-precision. When exporting to EDF, the values have to be converted back to integers, with different channel gains.
These multiple layers of signals resampling may cause subtle artifacts in the signals, insignificant in terms of amplitude (ERP analysis would not be affected) but may lead to some artifacts in time-frequency or connectivity analysis.
Maybe this warning is completely useless in your case, but in general avoid reconverting between "incompatible" file formats if not absolutely necessary.

Cheers
François

Hi Francois,

Thanks for the reply.

I'm not sure what this means... I guess it depends on how you proceed.
This should be something easy to test anyway, isn't it?

That's true. I can have annotators go through the EDF files and they'll be able to notice whether the background signal was preserved or not.

I would rather convert directly from the continuous .e to a continuous .edf file, without this importing step. Are you proceeding in this way because you want to exclude some of the data blocs from the output EDF file?

I don't know how to convert directly from the continuous .e to a continuous .edf file. That is why I'm importing it and then concatenating it. Can you tell me how I can go about this? I want to export the entire .e to a continuous .edf file (no exclusions)

This isn't really a problem for us.

Thank you so much for your help!
-Shmyrde Jean-Paul

Right-click on the "Link to raw file" > File > Export to file > Pick the appropriate file format.

1 Like

I tried exporting an EDF file (using your suggestion) and I was given this error:

Error using export_data (line 92)
Cannot export epoched files.

Error in tree_callbacks>@(h,ev)export_data(GetAllFilenames(bstNodes)) (line 1395)
jMenuExport = gui_component('MenuItem', [], [], 'Export to file', IconLoader.ICON_SAVE, [],
@(h,ev)export_data(GetAllFilenames(bstNodes)));

Is there a way around this? Or am I not able to export that file? Also, what does it mean by "epoched files"?

(Update): I also get this error when exporting the edf of a different EEG file after it finds the "maximum values"

Error using out_fwrite_edf (line 134)
Error writing data to file.

Error in out_fwrite (line 106)
out_fwrite_edf(sFile, sfid, SamplesBounds, ChannelRange, F);

Error in export_data (line 272)
sFileOut = out_fwrite(sFileOut, ChannelMatOut, 1, SamplesBounds, iChannelsOut, F);

Error in tree_callbacks>@(h,ev)export_data(GetAllFilenames(bstNodes)) (line 1395)
jMenuExport = gui_component('MenuItem', [], [], 'Export to file', IconLoader.ICON_SAVE, [],
@(h,ev)export_data(GetAllFilenames(bstNodes)));

How can I fix this?

Thanks so much for your help,
Shmyrde Jean-Paul

Ah, indeed, I didn't think about this problem:
This export function is not equipped to handle files with multiple non-contiguous segments, which is common in Nicolet .e files...
Then the easiest option is to import long blocks to the database and export them as EDF, if possible the entire segments (simpler and safer than importing small blocks + concatenating as you did)

Oh, I see.

This sounds like a viable option. How would I import the long blocks to the database?

Thanks Again!
-Shmyrde

The same way as you import short ones: right-click on the "Link to raw file" > Import MEG/EEG.

I don't see this option when I right-click on the "Link to raw file".

Sorry, it's "Import in database", as you probably did before:
https://neuroimage.usc.edu/brainstorm/Tutorials/Epoching#Import_in_database