<div dir="ltr"><div>Hi Lizhuang,<br><br>I haven't used Fieldtrip to import .avg files so I'm not sure about this, but I wonder if this is related to the same problem in EEGLAB. EEGLAB also scales .avg files like this when importing them, for some reason, so if the Fieldtrip function is based on EEGLAB code these issues may be related. (However, I just looked at read_ns_avg.m, which is what ft_read_data calls, and it doesn't say it's copied from EEGLAB). If you have EEGLAB, you can add the custom function loadavg_bcl.m to your path (it is available at <a href="http://sccn.ucsd.edu/pipermail/eeglablist/2011/003986.html">http://sccn.ucsd.edu/pipermail/eeglablist/2011/003986.html</a>, as one of the attachments near the bottom), use that to import the .avg file, and then use the EEGLAB function eeglab2fieldtrip() to get the data into FieldTrip.<br>
<br></div>Also, have you tried reading the data with ft_preprocessing() instead of ft_read_data? ft_read_data is kind of a low-level function; in the past I think I've had better luck just using ft_preprocessing.<br><div>
<div><br></div><div>Best,<br>Steve<br><br></div><div><br>Stephen Politzer-Ahles<br>New York University, Abu Dhabi<br>Psychology Department<br><br><br>> Message: 1<br>> Date: Sat, 03 Aug 2013 16:49:59 +0800<br>> From: lzyang <<a href="mailto:lzyang@ustc.edu.cn">lzyang@ustc.edu.cn</a>><br>
> To: <a href="mailto:fieldtrip@science.ru.nl">fieldtrip@science.ru.nl</a><br>> Subject: [FieldTrip] units of data sample read from neuroscan avg file<br>>         is      incorrect<br>> Message-ID: <<a href="mailto:51FCC437.5070409@ustc.edu.cn">51FCC437.5070409@ustc.edu.cn</a>><br>
> Content-Type: text/plain; charset=GB2312<br>><br>> Dear fieldtrip list,<br>> I used ft_read_data to read in .avg files (neuroscan format) to do some<br>> advanced analysis.<br>> data=ft_read_data('sham.avg', 'dataformat', 'ns_avg');<br>
> I noticed that the unit of data sample read by this function is incorrect.<br>> Values of samples ranged from -0.1 to 0.1.<br>> I will appreciate if anyone can give me some hints on how to import avg<br>> files correctly using fieldtrip.<br>
><br>> Thanks very much!<br>><br>> Best Regards,<br>> -Lizhuang<br></div></div></div>