<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none"><!-- p { margin-top: 0px; margin-bottom: 0px; }--></style>
</head>
<body dir="ltr" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<span style="font-family: Tahoma; font-size: 13px;">Hello,</span>
<div style="font-family: Tahoma; font-size: 13px;">I found the problem with reading epoched fif files</div>
<div style="font-family: Tahoma; font-size: 13px;">
<p style="margin-right: 0px; margin-left: 0px; font-size: 12px; font-family: Helvetica;">
<em><strong><br>
</strong></em></p>
<p style="margin-right: 0px; margin-left: 0px; font-size: 12px; font-family: Helvetica;">
This code snippet </p>
<p style="margin-right: 0px; margin-left: 0px; font-size: 12px; font-family: Helvetica;">
<em><strong><br>
</strong></em></p>
<p style="margin-right: 0px; margin-left: 0px; font-size: 12px; font-family: Helvetica;">
<em><strong>cfg = [];</strong></em></p>
<p style="margin-right: 0px; margin-left: 0px; font-size: 12px; font-family: Helvetica;">
<em><strong>cfg.dataset = Epochfilename;</strong></em></p>
<p style="margin-right: 0px; margin-left: 0px; font-size: 12px; font-family: Helvetica;">
<em><strong>epoch1= ft_preprocessing(cfg);</strong></em></p>
<p style="margin-right: 0px; margin-left: 0px; font-size: 12px; font-family: Helvetica; min-height: 14px;">
<br>
</p>
<p style="margin-right: 0px; margin-left: 0px; font-size: 12px; font-family: Helvetica;">
was giving the following error</p>
<p style="margin-right: 0px; margin-left: 0px; font-size: 12px; font-family: Helvetica; min-height: 14px;">
<br>
</p>
<p style="margin-right: 0px; margin-left: 0px; font-size: 12px; font-family: Helvetica;">
<em>Error using fiff_read_epochs (line 46)<br>
</em></p>
<p style="margin-right: 0px; margin-left: 0px; font-size: 12px; font-family: Helvetica;">
<em>Could not find epochs data</em></p>
</div>
<div style="font-family: Tahoma; font-size: 13px;"><br>
</div>
<div style="font-family: Tahoma; font-size: 13px;">This error was caused by this line of code (line 43 in fiff_read_epochs)</div>
<div style="font-family: Tahoma; font-size: 13px;"><strong><em><br>
</em></strong></div>
<div style="font-family: Tahoma; font-size: 13px;"><strong><em>ep = fiff_dir_tree_find(meas, FIFF.FIFFB_EPOCHS);</em></strong></div>
<div style="font-family: Tahoma; font-size: 13px;"><strong><em><br>
</em></strong></div>
<div style="font-family: Tahoma; font-size: 13px;">because the returned structure ep was empty</div>
<div style="font-family: Tahoma; font-size: 13px;"><br>
</div>
<div style="font-family: Tahoma; font-size: 13px;">The value of this constant <strong>FIFF.FIFFB_EPOCHS</strong> is 122 , and in meas there was no block with such id therefore ep was empty</div>
<div style="font-family: Tahoma; font-size: 13px;"><br>
</div>
<div style="font-family: Tahoma; font-size: 13px;">The epoched data was in the block with the id 373</div>
<div style="font-family: Tahoma; font-size: 13px;"><br>
</div>
<div style="font-family: Tahoma; font-size: 13px;">By changing line 43 in fiff_read_epochs by this</div>
<div style="font-family: Tahoma; font-size: 13px;"><strong>ep = fiff_dir_tree_find(meas, 373); </strong></div>
<div style="font-family: Tahoma; font-size: 13px;">I am able to load the epoched data<br>
</div>
<div style="font-family: Tahoma; font-size: 13px;"><br>
</div>
<div style="font-family: Tahoma; font-size: 13px;">Kind regards</div>
<div style="font-family: Tahoma; font-size: 13px;">Bushra Riaz</div>
<div><br>
<br>
<br>
</div>
<div dir="ltr" style="font-size:12pt; color:#000000; background-color:#FFFFFF; font-family:Calibri,Arial,Helvetica,sans-serif">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Bushra Riaz Syeda<br>
<b>Sent:</b> Monday, March 14, 2016 7:30 AM<br>
<b>To:</b> fieldtrip@science.ru.nl<br>
<b>Subject:</b> [FieldTrip] error in reading epoched fif files</font>
<div> </div>
</div>
<div>
<p></p>
<div dir="ltr" style="font-size:12pt; color:#000000; background-color:#FFFFFF; font-family:Calibri,Arial,Helvetica,sans-serif">
<div>
<p style="margin-right:0px; margin-left:0px; font-size:12px; font-family:Helvetica">
My bad. I should have explained the problem</p>
<p style="margin-right:0px; margin-left:0px; font-size:12px; font-family:Helvetica">
I am using this code to read epoched fif files created with latest version of mne-python as was explained in fieldtrip tutorial (http://www.fieldtriptoolbox.org/development/integrate_with_mne)</p>
<p style="margin-right:0px; margin-left:0px; font-size:12px; font-family:Helvetica; min-height:14px">
The sample epoched file can be downloaded from this link <br>
</p>
<p style="margin-right:0px; margin-left:0px; font-size:12px; font-family:Helvetica; min-height:14px">
<a href="https://www.dropbox.com/s/3wy7clqu8o4a6wp/test-epo.fif?dl=0" title="https://www.dropbox.com/s/3wy7clqu8o4a6wp/test-epo.fif?dl=0
Cmd+Click or tap to follow the link">https://www.dropbox.com/s/3wy7clqu8o4a6wp/test-epo.fif?dl=0</a><br>
</p>
<p style="margin-right:0px; margin-left:0px; font-size:12px; font-family:Helvetica; min-height:14px">
<br>
</p>
<p style="margin-right:0px; margin-left:0px; font-size:12px; font-family:Helvetica; min-height:14px">
<br>
</p>
<p style="margin-right:0px; margin-left:0px; font-size:12px; font-family:Helvetica">
<em><strong>cfg = [];</strong></em></p>
<p style="margin-right:0px; margin-left:0px; font-size:12px; font-family:Helvetica">
<em><strong>cfg.dataset = Epochfilename;</strong></em></p>
<p style="margin-right:0px; margin-left:0px; font-size:12px; font-family:Helvetica">
<em><strong>epoch1= ft_preprocessing(cfg);</strong></em></p>
<p style="margin-right:0px; margin-left:0px; font-size:12px; font-family:Helvetica; min-height:14px">
<br>
</p>
<p style="margin-right:0px; margin-left:0px; font-size:12px; font-family:Helvetica">
and I am getting the following error</p>
<p style="margin-right:0px; margin-left:0px; font-size:12px; font-family:Helvetica; min-height:14px">
<br>
</p>
<p style="margin-right:0px; margin-left:0px; font-size:12px; font-family:Helvetica">
Error using fiff_read_epochs (line 46)<br>
</p>
<p style="margin-right:0px; margin-left:0px; font-size:12px; font-family:Helvetica">
Could not find epochs data</p>
<p style="margin-right:0px; margin-left:0px; font-size:12px; font-family:Helvetica; min-height:14px">
<br>
</p>
<p style="margin-right:0px; margin-left:0px; font-size:12px; font-family:Helvetica">
Error in fiff_read_epochs (line 46)</p>
<p style="margin-right:0px; margin-left:0px; font-size:12px; font-family:Helvetica">
error(me,'Could not find epochs data');</p>
<p style="margin-right:0px; margin-left:0px; font-size:12px; font-family:Helvetica; min-height:14px">
<br>
</p>
<p style="margin-right:0px; margin-left:0px; font-size:12px; font-family:Helvetica">
Error in ft_read_header (line 1601)</p>
<p style="margin-right:0px; margin-left:0px; font-size:12px; font-family:Helvetica">
epochs = fiff_read_epochs(filename);</p>
<p style="margin-right:0px; margin-left:0px; font-size:12px; font-family:Helvetica; min-height:14px">
<br>
</p>
<p style="margin-right:0px; margin-left:0px; font-size:12px; font-family:Helvetica">
Error in ft_preprocessing (line 397)</p>
<p style="margin-right:0px; margin-left:0px; font-size:12px; font-family:Helvetica">
hdr = ft_read_header(cfg.headerfile, 'headerformat', cfg.headerformat, 'coordsys', cfg.coordsys,</p>
<p style="margin-right:0px; margin-left:0px; font-size:12px; font-family:Helvetica">
'coilaccuracy', cfg.coilaccuracy);</p>
<p style="margin-right:0px; margin-left:0px; font-size:12px; font-family:Helvetica; min-height:14px">
<br>
</p>
<p style="margin-right:0px; margin-left:0px; font-size:12px; font-family:Helvetica">
Kind regards</p>
<p style="margin-right:0px; margin-left:0px; font-size:12px; font-family:Helvetica">
Bushra Riaz<strong></strong><br>
</p>
<p><br>
</p>
</div>
</div>
</div>
</div>
</body>
</html>