Do I need ECG channel to run "artifact_ecg"

Jim Li megjim1 at GMAIL.COM
Thu Apr 23 17:47:53 CEST 2009


Dear Jan-Mathijs,

Thanks a lot for your feedback. Last night I did a bit of debugging and found 
out why the crashed happened. In line 116 of "artifact_ecg" it says:
if ~isfield(cfg.artfctdef.ecg,'inspect'),cfg.artfctdef.ecg.inspect   = 
{'MLT' 'MRT'}; end

That's the cause of my trouble because 4D's system doesn't have channels 
names like "MLT", "MRT" . So I fixed te problem by adding this line:
cfg.artfctdef.ecg.inspect   = {'A229'};

before this line:
[cfg, artifact]          = artifact_ecg(cfg);

And it worked! All these fits into your great suggestion very well. And I'm so 
happy that I don't need to get an ECG channel before doing cardiac artifact 
rejection.



Jim


On Thu, 23 Apr 2009 09:00:44 +0100, jan-mathijs schoffelen 
<j.schoffelen at PSY.GLA.AC.UK> wrote:

>Dear Jim,
>
>The reason for your crash is probably related to the fact that the
>default settings for artifact_ecg have been defined with a ctf-system
>in mind. Artifact_ecg will provide some feedback as to how the QRS-
>complex-locked MEG signals look, by picking a subset of channels as
>defined by cfg.artfctdef.ecg.inspect. By default this is set to all
>channels named 'MLTxx'. Since in your megsystem the sensors are named
>'Axx', fieldtrip cannot make sense out of the default and crashes.
>Just specify your own (subset of) channel(s) to inspect.
>
>Good luck
>
>Jan-Mathijs
>
>
>
>On Apr 22, 2009, at 5:23 PM, Jim Li wrote:
>
>> Dear all,
>>
>>
>> W/ a 041809 Fieldtrip, I tried to run the following lines but got
>> some error (see
>> below). I don't have ECG channel in my data, that's why I use a
>> left-most
>> MEG channel w/ apparent cardiac interferences instead. Any
>> suggestion how
>> to fix the problem?
>>
>> -------------
>> cfg                      = [];
>> cfg.trl                  = data.cfg.previous.trl;
>> cfg.dataset              = data.cfg.previous.dataset;
>> cfg.continuous            = 'yes' ;
>> cfg.artfctdef.ecg.channel  = 'A229';
>> cfg.artfctdef.ecg.pretim = 0.25;
>> cfg.artfctdef.ecg.psttim = 0.5;
>> cfg.artfctdef.ecg.method  = 'zvalue'; %peak-detection method
>> cfg.artfctdef.ecg.cutoff  = 3; %peak-threshold
>> [cfg, artifact]          = artifact_ecg(cfg);
>>
>> current  zvalue threshold = 3.000
>> keep the current value (y/n) ?
>> y
>> ??? Undefined function or variable "labelmlt".
>>
>> Error in ==> channelselection at 344
>> if findmlt,        channel = [channel; labelmlt]; end
>>
>> Error in ==> artifact_ecg at 238
>> sgn    = channelselection(artfctdef.inspect, hdr.label);
>>
>> ----------------------------------
>> The aim of this list is to facilitate the discussion between users
>> of the FieldTrip  toolbox, to share experiences and to discuss new
>> ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/
>> archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
>
>----------------------------------
>The aim of this list is to facilitate the discussion between users of the 
FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and 
EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and 
http://www.ru.nl/neuroimaging/fieldtrip.

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.



More information about the fieldtrip mailing list