Using resting-state data to compute noise covariance matrix for source localization

Dear all,

I am trying to source model MEG data using the MNE-dSPM method as implemented in MNE-Python. The task I am using does not have a good baseline period in which nothing is presented, so I want to use individual resting-state data collected right before the task to compute the noise covariance matrix.

I heard that one important factor to consider when source modelling is the rank of the data. To account for this, I pre-processed both the task and resting-state data using the exact same pipeline and rejected the same independent components in both datasets (extracted from the task data). However, the rank of the data after pre-processing are not the same. I believe this is due to the maxfiltering step. I am wondering how to ensure that my task and resting state data have the same rank when maxfiltering. Is there a way to use the SSS projections from one data set and apply it to the another data set?

In addition, is there any other thing that I need to ensure to use resting-state data to compute noise covariance?

I would be grateful for any help you can provide.

Best,
Oscar

UPDATE:

After some tests, I decided to address the rank discrepancy by manually setting the rank when computation of the active and noise covariance matrices to the lowest value measured from the two data sets.

Any feedback would be greatly appreciated.

Hello @oscfer88, are you aware of maxwell_filter_prepare_emptyroom()? This function is specifically designed to help prepare an empty-room recording for Maxwell filtering.

Best wishes,
Richard