[FieldTrip] FT_REJECTARTIFACT
Nenad Polomac
polomacnenad at gmail.com
Wed Aug 22 19:59:51 CEST 2012
Dear all,
I have one problem concerning ft_rejectartifact function.
I did everything as you explained in automatic artifact rejection tutorial.
I mark segments first and that is fine, but the ft_rejectartifact doesn't
remove marked bad segments form my data.
Please help!
Here is my code:
% automatic
clear all
s=[87 209 195 225 60];
for g=1:length(s)
input_no=s(g)
clear sub
sub=['Subject' num2str(input_no)];
eval(sub) %calling subject's script
cfg=[];
cfg.trialdef.eventtype = 'UPPT001';
cfg.trialdef.eventvalue = 1;
cfg.trialdef.prestim = 0.1;
cfg.trialdef.poststim = 0.5;
cfg.trialfun = 'trialfun_general';
cfg.channel = {'MEG'};
cfg.continuous = 'yes';
cfg.dataset = [subjectdata.wr11.datadir];
[data1]=ft_definetrial(cfg)
trial=data1.trl;
% muscle
cfg=[];
cfg.trl =trial;
cfg.datafile = [subjectdata.wr11.datafile];
cfg.headerfile =[subjectdata.wr11.headerfile];
cfg.continuous = 'yes';
% channel selection, cutoff and padding
cfg.artfctdef.zvalue.channel = 'MRT*';
cfg.artfctdef.zvalue.cutoff = 15;
cfg.artfctdef.zvalue.trlpadding = 0.5;
cfg.artfctdef.zvalue.fltpadding = 0.5;
cfg.artfctdef.zvalue.artpadding = 0.1;
% algorithmic parameters
cfg.artfctdef.zvalue.bpfilter = 'yes';
cfg.artfctdef.zvalue.bpfreq = [110 140];
cfg.artfctdef.zvalue.bpfiltord = 9;
cfg.artfctdef.zvalue.bpfilttype = 'but';
cfg.artfctdef.zvalue.hilbert = 'yes';
cfg.artfctdef.zvalue.boxcar = 0.2;
%make the process interactive
cfg.artfctdef.zvalue.interactive = 'yes';
[cfg, artifact_muscle] = ft_artifact_zvalue(cfg)
% jump
cfg=[];
cfg.trl = trial;
cfg.datafile = [subjectdata.wr11.datafile];
cfg.headerfile =[subjectdata.wr11.headerfile];
cfg.continuous = 'yes';
% channel selection, cutoff and padding
cfg.artfctdef.zvalue.channel = 'MEG';
cfg.artfctdef.zvalue.cutoff = 20;
cfg.artfctdef.zvalue.trlpadding = 0;
cfg.artfctdef.zvalue.artpadding = 0;
cfg.artfctdef.zvalue.fltpadding = 0;
% algorithmic parameters
cfg.artfctdef.zvalue.cumulative = 'yes';
cfg.artfctdef.zvalue.medianfilter = 'yes';
cfg.artfctdef.zvalue.medianfiltord = 9;
cfg.artfctdef.zvalue.absdiff = 'yes';
% make the process interactive
cfg.artfctdef.zvalue.interactive = 'yes';
[cfg, artifact_jump] = ft_artifact_zvalue(cfg)
cfg.artfctdef.reject = 'complete';
cfg.artfctdef.jump.artifact = artifact_jump;
cfg.artfctdef.muscle.artifact = artifact_muscle;
data_no_artifacts = ft_rejectartifact(data1)
end
Thank you in advance!
NP
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20120822/a57fef80/attachment-0001.html>
More information about the fieldtrip
mailing list