Extract ecg to the raw file

Hi Francois,

Thanks a lot for the detailed answer and suggestions, it seems that our best option would be to import both files and export the markers from the EDF to the RAW file.
We have contacted EGI support already, but they were not able to help us further, i.e., they told us to either use the edf. file with ecg but some flat channels or the raw file without the ecg. Our other option would to filter edf. in netstation before exporting, but we prefer to perform all the analysis in a single software, if possible.

About your question, we would like to correct the ecg since we observed while recording that some of our subjects have large cardiac artefacts, specially during resting state recordings. So we thought since the correction is worth doing in some people, would do the same corrections for everyone.

Could you let us know in what sense are the artefacts difficult to clean? Would you recommend us not to do this with EEG data in brainstorm? BTW, we will be doing resting state, ERP and frequency analysis.

Thanks,


Dear Jamie,

I am not aware of these issues with the filtering of the ECG to get it correctly exported to EDF format.
Merging two files of different formats sounds like a complicated option… You cannot do this with Brainstorm easily, if this is the way you want to go, you would have to code this yourself.

Easier option would be to create both files (EDF and .RAW), review them both in Brainstorm, do the detection from the EDF file, export the event markers and import them in the .RAW file.

Have you contacted the EGI customer support about the conversion of the ECG channel during the EDF export?
This sounds like they should do something about this issue…

I have a more general question: why do you need the ECG in Brainstorm for?
For what I understood, the cardiac artifact is usually not strong enough to be a problem in EEG, and it is difficult to clean for anyways…

If you have additional questions, please post them on the user forum (“Forum” section on the website): it makes it easier for us to manage and the answers can help other users as well.

Cheers,
Francois


Hello,
My colleague and I have a question about using Brainstorm to analysis data of EEG recording from Netstation EGI(256 channels, version 5.1).
The format exported from Netstation compatible in Brainstorm are .raw and .edf file. The .raw file can import to Brainstorm directly, but no ecg data. The .edf file contains ecg record, but needs to be filtered in Netstation before importing to Brainstorm. Because of the data was stored in 32bit in the EGI proprietary format and in 16bit in the edf. format. If the data values are too big, it is not supported anymore by the edf. format and some of the channel becomes flat.

Currently, we filtered the data (Notch and Band pass) in Netstation and then export the .edf file to Brainstorm for the Artifact cleaning. But we would like to do all the analysis in Brainstorm, so we were thinking if it is possible that we can use Brainstorm to extract ecg data from the .edf file and add this as an additional channel to the .raw file.

Thank you,
Jamie

Hi Jamie,

I’m sorry, I don’t have experience removing cardiac artifacts from EEG recordings.
You can try both SSP and ICA approaches, and see what gives you the best results (correct artifact topography, artifact removed, signals not altered otherwise).

Try first on your subject with the strongest artifact, then if you find a good way to process it try to reproduce it on a subject who doesn’t show the artifact.
Both SSP and ICA will work in different ways on different subjects, and may fail on some of them. You may not be able to apply the same level of correction on all your subjects.

Francois

Hi Francois,

Thank you for the advice. I was trying to use ICA to remove cardiac, I used the same parameter in SSP.
But I got a warning message, and there is no [ %] showing in each projector component ICA generated.

This is the warning message: There is probably not enough data for a correct ICA decomposition.
Number time samples in input: 80271 (80s) Recommend number of time samples:660490 (660s)

Is this because of we have lots of channels(256)? Or how should I set the parameter?

Thank you,
Jamie

Hi Jamie,

I’m sorry there is no documentation for the ICA decomposition yet… Hopefully we will write a tutorial this year.
This is normal that you don’t see any percentage next to the ICA components. Unlike the PCA/SSP approach where a few components can capture most of the signal power, the ICA decomposition gives you a list of component with equivalent amount of contributions. If one specific topography captures most of the signal, it may be split between different ICA components.

The recommendation for the signal length is coming from Scott Makeig, author of the Infomax method in EEGLAB:
Nsamples/Nchannels^2 >> 10

The algorithm used in Brainstorm is directly the EEGLAB function runica. Unfortunately we don’t have a lot of experience with it yet.
If you have questions about this method, please look for documentation or help on the EEGLAB side.

Cheers,
Francois