<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Dear Arti,<br>
<br>
You could try to adapt the following code:<br>
<br>
% --------------------------------<br>
% Load & preprocess continuous files<br>
% ---------------------------------<br>
cfg = [];<br>
cfg.dataset = tmpfilename;<br>
cfg.continuous='yes';<br>
cfg.hpfilter = 'yes';<br>
cfg.hpfilttype = 'but';<br>
cfg.hpfreq = 0.5; % Hz<br>
cfg.channel = elecs_183_selec;<br>
data_cont = ft_preprocessing(cfg); <br>
<br>
% -----------------------------------------<br>
% define trials<br>
%-----------------------------------------<br>
cfg = [];<br>
cfg.dataset = tmpfilename; % datafile to read events from<br>
cfg.eventformat = 'egi_mff_v2';<br>
cfg.trialdef.prestim = 2; % in seconds<br>
cfg.trialdef.poststim = 2; % in seconds<br>
<br>
cfg.trialdef.eventtype = {'DIN12'}; <br>
cfgDIN12 = ft_definetrial(cfg);<br>
<br>
tmp_data_segm12 = ft_redefinetrial(cfgDIN12, data_cont); %Segmentation<br>
<div><br>
The problem is that for me, it does not import the trialinfo. Therefore, I do the segmentation (here for DIN12) separately for all triggers, then append all tmp_data_segm and write the following code for adding the trialinfo:<br>
<br>
data_segm.trialinfo=[ones(1, length(tmp_data_segm12.trial))*12]<br>
<br>
Hope that helps!<br>
<br>
Best,<br>
Christine<br>
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px"><font face="Calibri" size="2"><span style="font-size:9.0pt" lang="EN-GB"><br>
</span></font><font face="Calibri" size="2"><span style="font-size:9.0pt"><a href="http://www.sleepscience.at/" tabindex="0"><span style="color:blue"></span></a></span></font></div>
</div>
</div>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div style="direction: ltr;" id="divRpF970078"><font face="Tahoma" color="#000000" size="2"><b>Von:</b> fieldtrip-bounces@science.ru.nl [fieldtrip-bounces@science.ru.nl]" im Auftrag von "Arti Abhishek [mailtome.2113@gmail.com]<br>
<b>Gesendet:</b> Montag, 30. Mai 2016 05:38<br>
<b>An:</b> FieldTrip discussion list<br>
<b>Betreff:</b> [FieldTrip] Problem with EGI file<br>
</font><br>
</div>
<div></div>
<div>
<div dir="ltr">
<div>
<div>Dear fieldtrip community,<br>
<br>
</div>
I am trying to analyse eeg recorded from EGI. I want to highpass filter the data before epoching and I managed to create the following script from the fieldtrip documentation. However I am getting an error (please see below). Could someone suggest a fix.<br>
<br>
</div>
<div>Thank you,<br>
</div>
<div>Arti<br>
</div>
<div><br>
<br>
datadir = 'D:\EGITest';<br>
dataset = fullfile(datadir, 's01_CH.mff');<br>
headerformat = 'egi_mff_v2';<br>
dataformat = 'egi_mff_v2';<br>
eventformat = 'egi_mff_v2';<br>
hdr = ft_read_header(dataset, 'headerformat', headerformat);<br>
dat = ft_read_data(dataset, 'headerformat', headerformat, 'dataformat', dataformat);<br>
event = ft_read_event(dataset, 'headerformat', headerformat, 'eventformat', eventformat);<br>
fg = [];<br>
cfg.data = dat;<br>
cfg.headerfile=hdr;<br>
cfg.trialdef.triallength = Inf;<br>
cfg.trialdef.ntrials = 1;<br>
cfg = ft_definetrial(cfg);<br>
cfg.hpfilter = 'yes';<br>
cfg.hpfreq = .1;<br>
cfg.hpfilttype = 'firws'; <br>
cfg.hpfiltdir = 'onepass-zerophase';<br>
alldata = ft_preprocessing(cfg);<br>
<br>
</div>
I am getting the following error<br>
<br>
Undefined function 'exist' for input arguments of type<br>
'struct'.<br>
<br>
Error in isdir (line 10)<br>
result = exist(dirpath,'dir') == 7;<br>
<br>
Error in ft_filetype (line 150)<br>
if isdir(filename)<br>
<br>
Error in ft_checkconfig (line 559)<br>
cfg.dataformat = ft_filetype(cfg.datafile);<br>
<br>
Error in ft_definetrial (line 128)<br>
cfg = ft_checkconfig(cfg, 'dataset2files', 'yes');<br>
<div><br>
</div>
</div>
</div>
</div>
</div>
</body>
</html>