[FieldTrip] problem using ft_artifact_muscle

jan-mathijs schoffelen jan.schoffelen at donders.ru.nl
Tue Feb 26 22:03:23 CET 2013


Hi Leonie,

> > ERROR:
> 
> > Subscript indices must either be real positive integers or logicals.
> 
> > 
> 
> > Error in ft_fetch_data (line 123)
> 
> >        count     = count(begsample:endsample);
> 
> >
> 


The error message indicates that either begsample or endsample are badly behaved. I put my money on begsample, in that its value <= 0 in the case of a bandpassfilter-order of 9. My guess is that ft_fetch_data tries to get some data that is not there. Did you check the cfg.artfctdef.muscle.fltpadding? In general, when supplying data in the input to ft_artifact_muscle, the value of this parameter should be set to 0.

Best,

Jan-Mathijs


On Feb 25, 2013, at 9:23 PM, Pascasie L. Dombert wrote:

> 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
> 
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip

Jan-Mathijs Schoffelen, MD PhD 

Donders Institute for Brain, Cognition and Behaviour, 
Centre for Cognitive Neuroimaging,
Radboud University Nijmegen, The Netherlands

Max Planck Institute for Psycholinguistics,
Nijmegen, The Netherlands

J.Schoffelen at donders.ru.nl
Telephone: +31-24-3614793

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20130226/57036614/attachment-0001.html>


More information about the fieldtrip mailing list