[FieldTrip] problem using ft_artifact_muscle

Pascasie L. Dombert pd25588 at berkeley.edu
Mon Feb 25 21:23:28 CET 2013


Hi all,



I am a fieldtrip starter working on an EEG data set. I have a question
concerning
the muscle artifact detection function and I was hoping that you could help
me with this.

I am calling the function

[cfg,artifact_muscle]  = ft_artifact_muscle(cfg,ref_data)  as explained in
the manual (settings suggested) and get the following error message (see
code + error):

________________________________________________________________________________________________

> %detect the MUSCLE artifacts

> cfg                              = [];

> cfg.continuous                   = 'yes';

> % define trial first

> cfg.dataset                      = 'xx’;

> cfg.trialfun                     ='trialfun_general';

> cfg.trialdef.triallength         =1;                   % creates 1-second
data segments

> cfg.trialdef.ntrials                   =   inf;

                         % i.e. the complete file

> cfg                           = ft_definetrial(cfg);

>

> % cutoff

> cfg.artfctdef.muscle.channel      = 'all';

> cfg.artfctdef.muscle.cutoff         = 4;

>

> % algorithmic parameters

> cfg.artfctdef.muscle.bpfilter        = 'yes';

> cfg.artfctdef.muscle.bpfreq          = [110 140];

> cfg.artfctdef.muscle.bpfiltord       = 9;

> cfg.artfctdef.muscle.bpfilttype      = 'but';

> cfg.artfctdef.muscle.hilbert           = 'yes';

> cfg.artfctdef.muscle.boxcar           = 0.2;

>

> % feedback

> %cfg.artfctdef.muscle.interactive   = 'yes'; % to adjust cutoff zvalue if
needed

>

> [cfg, artifact_muscle] = ft_artifact_muscle(cfg,ref_data);

>

>

>

>

> ERROR:

> Subscript indices must either be real positive integers or logicals.

>

> Error in ft_fetch_data (line 123)

>        count     = count(begsample:endsample);

>

> Error in ft_artifact_zvalue (line 195)

>          dat{trlop} = ft_fetch_data(data,        'header', hdr,
'begsample', trl(trlop,1)-fltpadding, 'endsample', trl(trlop,2)+fltpadding,
'chanindx',

>          sgnind, 'checkboundary', strcmp(cfg.continuous,'

> Error in ft_artifact_muscle (line 156)

>      [tmpcfg, artifact] = ft_artifact_zvalue(tmpcfg, data);

> _______________________________________________________





However, I only get the error message with the default/suggested values.

When I use:

cfg.artfctdef.muscle.bpfreq = [110 120]; and
cfg.artfctdef.muscle.bpfiltord  = 7;

I don't get the error message and the script runs properly. Does anyone
happen to know what could have let to this problem?



Thanks a lot in advance!

Best, Leonie
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20130225/56f6ebd2/attachment-0001.html>


More information about the fieldtrip mailing list