Empty-room pre-processing - ICA

  • MNE version: e.g. 1.3.0
  • operating system: Windows 11

Hi, I am trying to use my empty room data to whiten my covariance matrix before applying LCMV beamforming. In the pre-processing pipeline of the empty room, I successfully applied the function mne.preprocessing.maxwell_filter_prepare_emptyroom. Now, on my experimental data, I also applied ICA. My question is: what should I do with my empty room data? Is it enough to just remove the same number of components, or is there a way to save the ICA weights from the data and apply the same transformation to the empty room recordings?

Thank you!

Once you fit the ica on your data, you can do ica.apply(my_data) to remove the bad components- then also do ica.apply(noise_data). Just make sure that you prefilter your noise and neurophys data the same. You can also save out the ica for later use - the documentation is on the MNE site, but I think its just ica.save.

And from your question - I don’t think that just removing the same number of components is equivalent.

Good luck.

–Jeff

1 Like

Sorry that this is a bit late, but Jeff, should you do the (t)SSS filtering of the empty room data after you finish preprocessing your MEG data (since ICA and SSP will reduce the rank of your data)?

@ktyner - If you are using Elekta/MEGIN data with active shielding - the data it isn’t considered valid until you do some form of SSS processing to clean up the environmental noise. So to do ICA and SSP, you would have to do SSS/tSSS beforehand. The SSS operation is going to bring your rank down to 60-80 from the original 306.

After saying that - I think that you can do full rank beamformer analysis without doing any SSS operations to either your subject or emptyroom data. The beamformer will filter out the environmental noise from your data. If you wanted to remove ICA components, you would process them on the SSS-ed data and apply them to the non-SSS data. That is my understanding of it at least. One issue is that this precludes head motion correction (since the SSS is required for that operation).

-Jeff

1 Like

Right, that all makes sense. I was just wondering WHEN that SSS filtering should be done on the empty room data. Say you perform it at the beginning using the info from the raw data. Then the empty room and raw data would have the same rank. But further preprocessing would alter the rank of the raw data. Or is it that if you apply say ICA to the raw data, you apply the same decomposition to the empty room data (as you said)?

You have to apply the exact same processing, in the same order, to both your empty room and to your raw data.

Mathieu

I would figure that would be the case. So ultimately do the ranks of the empty room and raw data not need to match?

No - they do not need to match. Compute the rank for emptyroom and subject data and use the smaller rank value in your make_lcmv (or other beamformer).

filters = make_lcmv(
    evoked.info,
    forward,
    data_cov,
    reg=0.05,
    noise_cov=noise_cov,
    pick_ori="max-power",
    weight_norm="unit-noise-gain",
    rank=None,   <------------
)

There are some discussions in the forums on issues arising from improperly choosing the rank in source localization.

-Jeff