<div dir="ltr">Thanks Jim and Craig!<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Oct 10, 2013 at 11:35 AM, Herring, J.D. (Jim) <span dir="ltr"><<a href="mailto:j.herring@fcdonders.ru.nl" target="_blank">j.herring@fcdonders.ru.nl</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear Raquel,<br>
<br>
What you could do, for example, is:<br>
<br>
<br>
<br>
% Save your data to disk<br>
Save('data','data','-v7.3'); % Saves the variable data to the file<br>
data.mat. The '-v7.3' switch allows the file to be larger than 4gb, if<br>
necessary.<br>
<br>
% Resample your data<br>
cfg = [];<br>
cfg.resamplefs = 250; % Or less<br>
<br>
data_resampled = ft_resampledata(cfg, data);<br>
<br>
% Clear original data from memory<br>
Clear data<br>
<br>
<br>
% Perform ICA on resampled data<br>
cfg = [];<br>
cfg.method = 'runica'; % or 'fastica', for example.<br>
<br>
comp = ft_componentanalysis(cfg, data_resampled);<br>
<br>
% clear resampled data<br>
Clear data_resampled<br>
<br>
% load original data<br>
Load('data.mat');<br>
<br>
% Use previously calculated unmixing matrix on original data<br>
cfg = [];<br>
cfg.unmixing = comp.unmixing; % copy unmixing matrix to new configuration<br>
structure<br>
cfg.topolabel = comp.topolabel; % copy channel labels to new config<br>
structure.<br>
<br>
comp = ft_componentanalysis(cfg, data);<br>
<br>
<br>
<br>
All the saving and clearing in between might not be necessary depending on<br>
how much RAM you have and on the size of your data.<br>
<br>
Best,<br>
<br>
Jim<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
<br>
-----Original Message-----<br>
From: <a href="mailto:fieldtrip-bounces@science.ru.nl">fieldtrip-bounces@science.ru.nl</a><br>
[mailto:<a href="mailto:fieldtrip-bounces@science.ru.nl">fieldtrip-bounces@science.ru.nl</a>] On Behalf Of Raquel Bibi<br>
Sent: donderdag 10 oktober 2013 15:36<br>
To: FieldTrip discussion list<br>
Cc: FieldTrip discussion list; CR<br>
Subject: Re: [FieldTrip] ICA/PCA EOG artifact removal<br>
<br>
Dear Robert,<br>
Over a year ago I tried to use the suggested method of the lower sample<br>
rate and project onto my original data. I had problems. Can you provide a<br>
little snippet of the projection?<br>
<br>
Best,<br>
<br>
Raquel<br>
Sent from my iPhone<br>
<br>
> On Oct 10, 2013, at 4:43 AM, Robert Oostenveld<br>
<<a href="mailto:r.oostenveld@donders.ru.nl">r.oostenveld@donders.ru.nl</a>> wrote:<br>
><br>
> Hi Craig,<br>
><br>
> Let me forward this to the email discussion list.<br>
><br>
><br>
>> On 9 Oct 2013, at 23:27, CR wrote:<br>
>><br>
>> Hi Robert,<br>
>> I wanted to see what your thoughts were on the merits of 2 different<br>
methods of removing blinks. I have a 12 minute resting state segment of<br>
data, so it has required me to do some things a little differently.<br>
>><br>
>> Method 1: ICA<br>
>><br>
>> I break the 12 minute segment into 2 second intervals, since doing ICA<br>
on the whole segment gave a poor result.<br>
><br>
> why does it give you a poor result? Has the subject been moving? Is<br>
there something else that makes the data not compatible with the<br>
stationary mixing assumption?<br>
><br>
> Or is it the difference in the preprocessing? 12 minutes of data<br>
represented in one segment can have drift, whereas 12 minutes of data<br>
represented in 2 second snippets will not have the drift (assuming you<br>
use the default cfg.demean=yes). Doing a low-pass filter on the continuous<br>
data would have a similar effect as segmenting it and demeaning the 2 sec<br>
snippets.<br>
><br>
>> I apply the resulting unmixing matrix to the 12 minute segment and<br>
correlate each component with the EOG to find the most relevant<br>
components, and reject these based on a threshold.<br>
><br>
> so a bit like<br>
><br>
<a href="http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_i" target="_blank">http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_i</a><br>
ca_to_remove_eog_artifacts<br>
> with the correlation method of<br>
><br>
<a href="http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_i" target="_blank">http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_i</a><br>
ca_to_remove_ecg_artifacts<br>
><br>
><br>
>> Method 2: PCA<br>
>><br>
>> I do a timelock analysis based on the blink onset point returned by the<br>
eyelink system. I then PCA the resulting blink ERF. I then reject the<br>
component(s) that account for say 98% of the total variance.<br>
>><br>
>> Obviously option 2 is much faster. What do you see as the relative<br>
merits/problems with the techniques? Technique 1 is largely what the FT<br>
tutorials suggest, so what about method 2?<br>
><br>
> Option 2 makes the large variance component orthogonal to the remainder<br>
of the components, whereas in option 1 the eye component and frontal brain<br>
components are both estimated, not orthogonal, and removing of the eye<br>
component does not remove the frontal brain component.<br>
><br>
> Option 1 is better, as it is less aggressive in removing brain<br>
components.<br>
><br>
> If speed is a concern, you could do<br>
> - ft_resampledata to e.g. 250 Hz or even less, estimate the components<br>
based on that and project them out of the original high Fsample data.<br>
> - do ft_componentanalysis on a subset of the data (say every 4th data<br>
segment after cutting it in pieces), and project them out of the original<br>
segmented data<br>
> - a combination of the two<br>
> - try out anothe rica algorithm (fastica versus runica)<br>
> - try out with the options of the ica algorithm, esp the stopping<br>
options<br>
> - get a faster computer<br>
><br>
> best regards<br>
> Robert<br>
><br>
><br>
><br>
><br>
><br>
><br>
> _______________________________________________<br>
> fieldtrip mailing list<br>
> <a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>
> <a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
<br>
_______________________________________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>
<a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
_______________________________________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>
<a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
</div></div></blockquote></div><br></div>