# Maxfilter and PCA-mag-v# projections

**URL:** <https://mne.discourse.group/t/maxfilter-and-pca-mag-v-projections/1895>\
**Category:** Mailing List Archive (read-only)\
**Tags:** list-archive\
**Created:** [July 16, 2019, 9:44am UTC](https://mne.discourse.group/t/maxfilter-and-pca-mag-v-projections/1895 "2019-07-16T09:44:19Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [July 16, 2019, 9:44am UTC](https://mne.discourse.group/t/maxfilter-and-pca-mag-v-projections/1895/1 "2019-07-16T09:44:19Z")

</div>

External Email - Use Caution

Dear MNE users,

can anyone enlighten me a little about the three 'default' projections  
PCA-mag-v1, PCA-mag-v2 and PCA-mag-v3. Where do they come from and why are they  
"discaded" by the maxfiltering process? My mags look pretty clean with them  
applied, but after maxfiltering, they look much worse, similar to not applying  
the PCA projections.

best,  
Marijn.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [July 16, 2019, 3:52pm UTC](https://mne.discourse.group/t/maxfilter-and-pca-mag-v-projections/1895/2 "2019-07-16T15:52:42Z")

</div>

External Email - Use Caution

First they are discarded as you project to the low rank coordinate system  
of maxfilter. After this the SSPs are not valid any longer. Question : do  
you take into account bad channels before computing maxfilter? It sounds as  
if something is not right with its computation.  
Question 2: if your data looks good, do you need maxfilter then in the  
first place?

Denis

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [July 16, 2019, 4:26pm UTC](https://mne.discourse.group/t/maxfilter-and-pca-mag-v-projections/1895/3 "2019-07-16T16:26:57Z")

</div>

External Email - Use Caution

Hi Denis,

thanks for confirming that the PCA projections are indeed dropped.  
Q1: I?m careful to take bad channels into account. However, I don?t have access to a crosstalk file or a fine calibration file. Maybe these will make all the difference.  
W2: I guess you are right in that I don?t \*need\* maxfilter, since the data is pretty clean to begin with. I was just wondering about the interplay between the PCA projections and maxfilter, since the projections seem superior in this case.

best,  
Marijn.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [July 16, 2019, 4:31pm UTC](https://mne.discourse.group/t/maxfilter-and-pca-mag-v-projections/1895/4 "2019-07-16T16:31:58Z")

</div>

External Email - Use Caution

I?d say if your data is clean enough to do without maxfilter then don?t bother with it. The proj approach is less invasive and more conservative.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [July 17, 2019, 2:53am UTC](https://mne.discourse.group/t/maxfilter-and-pca-mag-v-projections/1895/5 "2019-07-17T02:53:34Z")

</div>

External Email - Use Caution

Hi Marijn,

Regarding your first, question:

> can anyone enlighten me a little about the three 'default' projections

PCA-mag-v1, PCA-mag-v2 and PCA-mag-v3. Where do they come from

They are coming from the empty room recording.

Also,

> However, I don?t have access to a crosstalk file or a fine calibration

file

According to Maxfilter manual, you can find them at:

\(NEUROMAG\_ROOT\)/databases/ctc/ct\_sparse\.fif (NEUROMAG\_ROOT)/databases/sss/sss\_cal.dat

Best,  
Mainak

Best,  
Mainak

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [July 17, 2019, 7:07am UTC](https://mne.discourse.group/t/maxfilter-and-pca-mag-v-projections/1895/6 "2019-07-17T07:07:38Z")

</div>

External Email - Use Caution

Thanks, Mainak! I managed to find the files based on this. Sadly, using the  
fine calibration files did not make the filter much better. So I'm going  
with Denis' advice: drop the SSS for this particular subject.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [July 17, 2019, 8:11am UTC](https://mne.discourse.group/t/maxfilter-and-pca-mag-v-projections/1895/7 "2019-07-17T08:11:25Z")

</div>

External Email - Use Caution

Ah, one more thing. Is there a way to keep using the PCA projections, but  
still make use of maxfilter to "move" the head position? What would happen  
is I first applied the projections and then started doing maxfilter? Or is  
there a way to re-compute the PCA projections from empty room data after  
maxfiltering?

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [July 17, 2019, 1:16pm UTC](https://mne.discourse.group/t/maxfilter-and-pca-mag-v-projections/1895/8 "2019-07-17T13:16:48Z")

</div>

External Email - Use Caution

> Is there a way to keep using the PCA projections, but still make use of  
> maxfilter to "move" the head position?

No not currently. You could maybe hack it together by creating a RawArray  
with your give `meas_info` and data with three "time points" that are your  
PCA vectors.

> What would happen is I first applied the projections and then started  
> doing maxfilter?

maxwell\_filter should complain if you try to do this. It would cause a  
mismatch between the multipole moment forward model and data. In theory we  
might be able to compensate for this (e.g., by applying the projectors to  
the multipole moment model) but this has not been implemented or tested.

> Or is there a way to re-compute the PCA projections from empty room data  
> after maxfiltering?

Typically what people tend to do is process the empty room data the same  
way that the subject's data is processed (same translation, tSSS params,  
etc.) for example for computing an empty-room noise covariance. In theory  
you could instead (or additionally) compute the projection vectors from it.

Eric  
-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20190717/6cd57d92/attachment.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20190717/6cd57d92/attachment.html)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [July 17, 2019, 10:48pm UTC](https://mne.discourse.group/t/maxfilter-and-pca-mag-v-projections/1895/9 "2019-07-17T22:48:46Z")

</div>

External Email - Use Caution

Hi Marijn,

Empty room PCA vectors and the external SSS vectors that are based on a  
physical model (vector spherical harmonics converging at the origin of the  
coordinate system) typically span a very similar signal subspace.  
Therefore, it sounds strange if your MaxFilter-processed data look very bad  
while SSP-processed data with just three empty room vectors are good, and  
potential bad channels have been excluded in the operations. I would like  
to understand what's going on. You could try MaxFilter with a lower  
external expansion order by setting -out 1 and then MaxFilter and SSP  
should be even more compatible in your case. But I doubt that this solves  
the problem. I would be happy to take a look at your problematic file, if  
possible?

Best,  
Samu
