# MNE pca and SNR

**URL:** <https://mne.discourse.group/t/mne-pca-and-snr/72>\
**Category:** Mailing List Archive (read-only)\
**Tags:** list-archive\
**Created:** [November 7, 2008, 1:39pm UTC](https://mne.discourse.group/t/mne-pca-and-snr/72 "2008-11-07T13:39:10Z")\
**Posts on this page:** 7\
**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:** [November 7, 2008, 1:39pm UTC](https://mne.discourse.group/t/mne-pca-and-snr/72/1 "2008-11-07T13:39:10Z")

</div>

Dear MNE users,

I have two questions that I hope someone can answer.

1) The first is about SNR. Following an older post that I made on SNR  
(left unaswered ☹ ) I will attempt to rephrase the question, hoping to  
hear back from someone.

I am still wondering about how to best use the option --snr in  
mne\_make\_movie. I have played around with the data a bit and changing  
the SNR value seems to make a difference in the stc files.

So what is the best way to chose an SNR?  
a) use the default value (3) independent of whether this is reflected in  
your data  
b) estimate the mean SNR value (over the epoch time), which will be  
different for each subject and condition?

At the moment, I have calculated the SNR for each subject and condition.  
The SNR value is between 1 and 2 and it is different for subjects and  
conditions. Will that be a problem when I need to do group-level  
statistics comparing different conditions?

2) The second question is about PCA. Is there any function in MNE that  
would allow one to do a PCA on the \*.fif files to remove eye-blinks or  
cardiovascular related oscillations?

Thank you in advance for the help,  
Marina

---

<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:** [November 13, 2008, 5:53pm UTC](https://mne.discourse.group/t/mne-pca-and-snr/72/2 "2008-11-13T17:53:31Z")

</div>

Hello folks -

When using mne\_analyze to calculate timecourses (either by clicking on  
a vertex or using labels), how does MNE determine what the timecourse  
should be? Thanks -

Eliezer Kanal

---

<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:** [November 18, 2008, 11:06am UTC](https://mne.discourse.group/t/mne-pca-and-snr/72/3 "2008-11-18T11:06:21Z")

</div>

Hi Eliezer,

This is just the product of the data and the inverse solution. The  
inverse solution specifies how to take the data from sensor space to  
source space (i.e. vertices/labels). And the data is in sensor space  
with multiple time points. Have I missed anything about your question?

Dan

?

> Hello folks -
> 
> When using mne\_analyze to calculate timecourses (either by clicking  
> on a vertex or using labels), how does MNE determine what the  
> timecourse should be? Thanks -
> 
> Eliezer Kanal  
> \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> Mne\_analysis mailing list  
> Mne\_analysis at nmr.mgh.harvard.edu  
> [Mne\_analysis Info Page](https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis)

-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20081118/e12dc353/attachment.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20081118/e12dc353/attachment.html)  
-------------- next part --------------  
A non-text attachment was scrubbed...  
Name: DGWakeman.vcf  
Type: text/directory  
Size: 792 bytes  
Desc: not available  
Url : [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20081118/e12dc353/attachment.bin](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20081118/e12dc353/attachment.bin)  
-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20081118/e12dc353/attachment-0001.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20081118/e12dc353/attachment-0001.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:** [November 18, 2008, 11:13am UTC](https://mne.discourse.group/t/mne-pca-and-snr/72/4 "2008-11-18T11:13:47Z")

</div>

Hi Marina,

1. I think the lack of reply generally reflects people's tendency to  
leave it alone. Please people chime in, if I'm wrong.

2. There is no function in MNE that does a PCA. The closest thing  
within MNE would be the ability of mne\_browse\_raw to create SSP  
projections. However, I would not recommend using this for that  
purpose; again please chime in, if you disagree. The next best  
possibility to work on this would be to use the excellent MATLAB  
toolbox to read the fif files into matlab remove the eyeblinks/  
cardiovascular artifacts using whatever technique you like best and  
save the data back and continue processing. Just be very careful  
with your noise covariance matrices and your artifact extraction as  
many of these tools have dangerous consequences for the true brain data.

Dan

?

> Dear MNE users,
> 
> I have two questions that I hope someone can answer.
> 
> 1) The first is about SNR. Following an older post that I made on  
> SNR (left unaswered ☹ ) I will attempt to rephrase the question,  
> hoping to hear back from someone.
> 
> I am still wondering about how to best use the option --snr in  
> mne\_make\_movie. I have played around with the data a bit and  
> changing the SNR value seems to make a difference in the stc files.
> 
> So what is the best way to chose an SNR?  
> a) use the default value (3) independent of whether this is  
> reflected in your data  
> b) estimate the mean SNR value (over the epoch time), which will be  
> different for each subject and condition?
> 
> At the moment, I have calculated the SNR for each subject and  
> condition. The SNR value is between 1 and 2 and it is different for  
> subjects and conditions. Will that be a problem when I need to do  
> group-level statistics comparing different conditions?
> 
> 2) The second question is about PCA. Is there any function in MNE  
> that would allow one to do a PCA on the \*.fif files to remove eye-  
> blinks or cardiovascular related oscillations?
> 
> Thank you in advance for the help,  
> Marina
> 
> \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> Mne\_analysis mailing list  
> Mne\_analysis at nmr.mgh.harvard.edu  
> [Mne\_analysis Info Page](https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis)

-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20081118/bc1a0d1a/attachment.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20081118/bc1a0d1a/attachment.html)  
-------------- next part --------------  
A non-text attachment was scrubbed...  
Name: DGWakeman.vcf  
Type: text/directory  
Size: 792 bytes  
Desc: not available  
Url : [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20081118/bc1a0d1a/attachment.bin](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20081118/bc1a0d1a/attachment.bin)  
-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20081118/bc1a0d1a/attachment-0001.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20081118/bc1a0d1a/attachment-0001.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:** [November 18, 2008, 12:19pm UTC](https://mne.discourse.group/t/mne-pca-and-snr/72/5 "2008-11-18T12:19:30Z")

</div>

Marina  
1. The snr issue is actually a very deep one. You are telling MNE how to set  
up the regularization parameter, and yes, it will change the resulting  
signals. The reason that happens is that there are many more brain states  
than there are MEG sensor states. (this is that "ill-posed problem" thing).  
As a result, we do a pragmatic thing, which is simplify the problem and make  
it solvable - we add the constraint of minimizing the current at every point  
in the brain (loosely described). But when we do that, we need to make a  
somewhat arbitrary choice about how much weight to give that constraint.  
Because there is no simply physical interpretation of what we are doing,  
physiology cannot easily guide us here. In practice, I have no suggestion. I  
defer to Matti.

2. I did some reading on the subject of artifact removal a few years ago. I  
haven't kept up with the literature there. But I recall reading a relatively  
compelling argument against using PCA for artifact removal that Dan hinted  
at. Essentially PCA does not care if it also removes real brain data along  
with artifact. One possible approach suggested out there was a related  
technique, called ICA. I believe someone has written a matlab toolbox for  
that. But the results there are still sometimes suspicious. If you trust  
SSS, that may be an extremely powerful method to removal any artifact not  
coming from the head. As for eye blinks and movements - you could consider  
adaptive filtering. Another possibility is to fit several dipoles at the  
anatomical location of the eyes, and fit data to them, and remove them. In  
my playing around with these issues very briefly, I didn't find one perfect  
solution. But many papers are out there saying they did.

Hope my vagaries are mildly useful

Daniel Goldenholz MD, PhD

---

<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:** [November 18, 2008, 3:55pm UTC](https://mne.discourse.group/t/mne-pca-and-snr/72/6 "2008-11-18T15:55:55Z")

</div>

EEGLab, which is an extensive free Matlab package has an ICA  
extension. What you should think about is whether trying to remove eye-  
blinks, etc by using ICA is worthwhile. There is always a chance that  
it will corrupt your data. It is safer and, in my view, a better  
practice to simply collect more data and totally dump all the time  
intervals with artifacts using a simple threshold artifact detector.

---

<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:** [November 18, 2008, 5:02pm UTC](https://mne.discourse.group/t/mne-pca-and-snr/72/7 "2008-11-18T17:02:00Z")

</div>

I agree with you Yury. The safe bet is to discard any data that seems to  
have a big artifact.  
I look forward to the day when we can include those data with confidence  
because we have a proper method of accounting for the artifact precisely.

Daniel Goldenholz MD, PhD
