I’d like to understand how to best preprocess empty room recording for later source reconstruction. I’m aware that I should apply the same preprocessing to the ER data as my experiment data. However, when maxfiltering my experiment data I always project them onto an average head using the participant’s head position info (from cHPI data) and destination=avg_head.
My first question is, should I do the same to the ER recording (after applying maxwell_filter_prepare_emptyroom())? Since there is no cHPI recorded during ER, should I just set destination=avg_head in applying maxfilter to the ER signal? Or does this parameter even matter for ER?
And related to this, when applying maxwell_filter_prepare_emptyroom() to the ER recording, does it matter which raw signal I use? Particularly, the raw signal without any preprocessing, vs. the raw signal after maxfiltering which has been adjusted for the head position?
I will add to those questions, how should we handle the difference in length between the ER and the task recording?`
The head_pos argument of SSS (applying movement compensation) is dependent on the recording length. Same for the annotations injected by maxwell_filter_prepare_emptyroom.
To make the empty room data most closely match the recording, you should pass the un-maxwell-filtered data to the prepare function. Ideally the calls to maxwell_filter would match between the prepared-empty-room and task data. So for example if you use movement compensation, you should pass head_pos=head_pos to the maxwell_filter calls for both the empty-room and task data. Same thing with destination, etc.
@mscheltienne I tried running maxfilter on my ER data using the head position computed from the experiment data and there was no error… I don’t know how MNE deals with the time mismatch but as I understand from @larsoner this is the way to go? The terminal displayed a message like the following while maxfiltering each chunk of ER recording: “Used 11 head positions for 170.000 - 179.999 s (#18/18)”
How long is your empty-room recording? 3 minutes? Used 11 head positions for 170.000 - 179.999 s (#18/18) kind of sounds like the correction was only applied for the last 10s of the empty-room recording; maybe the raw.first_samp difference also impacts the processing here?
Sorry for the confusion. The sentence was copied from just the last “epoch” of the ER maxfiltering. This operation seems to be iterated 18 times for my 3-minute ER recording, each corresponding to 10 seconds, so I assume it applied maxfiltering for the entire duration.
Yes in MNE-Python the empty room prep function takes care of differences in first_samp to make the empty room data be processed the same way to the extent possible. Basically if you have 3 minutes of empty room data but 10 minutes of task data, you’ll get the first 3 minutes of head positions used to “movement compensate” the empty room data. It’s not perfect but so far seems to work reasonably well for infant data I’ve tested with at least.
It will work incorrectly if the position at the start varies drastically from the position later on, though.
Thanks a lot for your explanation! Now I understand how it’s done. I have a follow-up question and hope to get your insight.
After preprocessing my ER (prepare, maxfilter, then bandpass filter and apply ICA in the same way as my experiment recording), I computed the covariance matrix and found they have a pattern quite different from what I see in the tutorial:
Such a quadratic pattern, instead of a dominating diagonal line, appeared in all four participants’ data that I tested. Does this indicate something was screwed up in the processing, or just reflecting the property of our facility? What would be a good way to diagnose the noise covariance matrix?
You get a mostly diagonal noise covariance if your noise term is dominated by independent, individual-sensor noise (like at MGH with a magnetically quiet triple-shielded room). If you have sources of interference (which is very common), you’ll see stronger off-diagonal entries like the ones in your plots.