eog artifact rejection
Sameer Walawalkar
sameer at ANDREW.CMU.EDU
Tue Feb 20 17:06:50 CET 2007
I am interested in removing blink artifacts. Unfortunately, with
fieldtrip component analysis, it is difficult to identify the independent
component corresponding to blinks by visual inspection due to the short
timecourse over which they are presented (trial length).
There are essentially two errors:
1> ??? Error using ==> timelockanalysis
data has variable trial lengths, you specified not to accept that !
2> fdcomp.cohspctrm does not exist.
I tried to follow instructions under independent component analysis (ICA)
to remove ECG artifacts replacing eog for ecg. (I did not do any
resampling). (Is this a good idea?)
So I did,
% go back to the raw data on disk and detect the peaks in the EOG channel,
cfg = same.old.cfg.used.for.component.analysis.of.data;
cfg.artfctdef.eog.pretim = 0.25;
cfg.artfctdef.eog.psttim = 0.50-1/1200;
[cfg, artifact] = artifact_eog(cfg); (found 11 artifacts)
% preprocess the data around the peaks, i.e. read the segments of raw data
containing the EOG artifact
cfg = [];
cfg.dataset = 'JD_012507_Beeps_One.fif';
cfg.datatype = 'continuous';
cfg.padding = 10;
cfg.dftfilter = 'yes';
cfg.blc = 'yes';
cfg.trl = [artifact zeros(size(artifact,1),1)];
cfg.channel = {'MEG' 'EOG'};
data_eog = preprocessing(cfg)
% decompose the ECG-locked datasegments into components, using the
previously found (un)mixing matrix
cfg = [];
cfg.topo = compRR_orig.topo;
cfg.topolabel = compRR_orig.topolabel;
comp_eog = componentanalysis(cfg, data_eog);
selecting 307 channels
baseline correcting data
starting decomposition using predetermined mixing matrix
total time in componentanalysis 1.2 seconds
% compute a frequency decomposition of all components and the ECG
cfg = [];
timelock = timelockanalysis(cfg, comp_eog);
applying preprocessing options
??? Error using ==> timelockanalysis
data has variable trial lengths, you specified not to accept that !
% compute a frequency decomposition of all components and the ECG
cfg = [];
cfg.method = 'mtmfft';
cfg.output = 'fourier';
cfg.foilim = [0 100];
cfg.taper = 'hanning';
cfg.pad = 'maxperlen';
freq = freqanalysis(cfg, comp_ecg);
% compute coherence between all components and the ECG
cfg = [];
cfg.channelcmb = {'all' 'ECG'};
cfg.jackknife = 'no';
fdcomp = freqdescriptives(cfg, freq);
Even though I get computing cross-spectral densities message, I do not get
.cohspctrm.
fdcomp =
dimord: 'chan_freq'
freq: [1x155 double]
label: {307x1 cell}
powspctrm: [307x155 double]
dof: [307x155 double]
cfg: [1x1 struct]
Sorry for the long email, and thanks for your help.
sameer
More information about the fieldtrip
mailing list