question about cardiac artifacts & ICA

,

Hello Everyone,
I’m currently working with MEG data too. My current aim is to remove the cardiac artifacts from the data. I’ve few questions regarding this:

  1. How does the ECG artifact looks on a 2D topoplot?
  2. Currently I stumbled upon this package mne_iclabel which is the Python adaption of the EEGLAB package. I’m trying to use it but it’s throwing some errors, would love to discuss it if someone on this portal using it too.

Thanks!

Hi @kirti, I’ve moved your question to be its own topic; it’s best not to ask new questions at the end of other people’s topic threads.

Also I see you’ve already asked about ICALabel here: mne_icalabel package, please avoid asking the same question in two different places.

Regarding your question about cardiac artifacts, please have a look at the MNE documentation, there are several tutorials about artifact detection/correction: Preprocessing — MNE 1.0.3 documentation

That page is specifically the “preprocessing” tutorials, but there are lots of others too: Tutorials — MNE 1.0.3 documentation

Hello,

To build up very quickly on this: for now mne-icalabel only supports EEG data and the ICLabel neural network developed originally for EEGLAB. It is not suited for MEG data as it was trained exclusively on EEG datasets with a BP filter between (1, 100) Hz and a common average reference.
For cardiac artifacts, please refer to the MNE preprocessing tutorials. Especially if you only have a couple of files to process, you can label manually the ICs and the cardiac artifact will pop up very clearly.

Mathieu

Hey @drammock @mscheltienne, thanks for the reply. I’m new to the MNE forum so was not aware of the posting rules. Thanks for sharing the resources. Currently my approach is to automate this process of artifact correction as I’m dealing with a big dataset. I’m using correlation as the method for both ECG and EOG rejection. Lately, I realised that the resultant dimension of the eog_scores obtained is (2,n) where n is the number of components. It’ll be great if you can shed some light on it. Thanks

no problem! Some of the “rules” are more like “conventions” and aren’t spelled out super clearly anywhere.

It’s hard for me to answer this question out of context. It would be very helpful to see a minimal working example (put “minimal working example” in a search engine if you’re not familiar with what that means). One thing I can say off the top of my head is that find_bads_eog returns a tuple of (eog_index, scores) so maybe that’s where the dimension 2 is coming from (you’re not unpacking the return value properly)?

@drammock I’ve attached my working code and the dimensions obtained for the indices and scores.


share_2

you are passing two ch_names to find_bads_eog so it returns a list of two arrays (one array of scores for each channel you specified)

1 Like

Also, one more convention, please avoid posting screenshots of code and instead copy/paste and format the code in the message :wink:

1 Like