Julian,<div><br></div><div>Brainvision Analyzer is somewhat finicky, but I've never seen it do this, and I don't seem to be able to reproduce the problem here.</div><div><br></div><div>If you can get access to the original datasets, then rereferencing in Fieldtrip might be a solution.</div>
<div><br></div><div>And if you can't get the original datasets, then you could try editing the header files to include the resolution. I don't think the resolution should change after rereferencing, so you could simply put the resolution in there. Alternatively, specifying the resolution in hdr.orig.resolution should be possible, perhaps with some editing.</div>
<div>Also, since Fieldtrip could open the files earlier, it would stand to reason that it either 'makes up' some values, doesn't need them (which would be odd), or somehow deduces them from other values. However, in my *.vhdr files it specifies the resolution twice, once below [Channel Infos] and once under [Channels], but nothing I can find that defines it any other way. So, I'm guessing Fieldtrip used to make them up, but doesn't anymore. So, placing a resolution in the files or specifying it in Fieldtrip should not be a problem. Ideally, you would want the original resolution, but if that's not known, you could try winging it with a value that seems 'close enough'.</div>
<div><br></div><div>Hope this helps,</div><div><br></div><div>Casper van Heck</div><div><br><br><div class="gmail_quote">On Wed, Jan 25, 2012 at 1:49 PM, Karch, Julian <span dir="ltr"><<a href="mailto:karch@mpib-berlin.mpg.de">karch@mpib-berlin.mpg.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="DE" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Hi,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">thanks for your answer. It seems that I was a little imprecise. Of course the original data set doesn't change but if I export the a data set
after setting a new reference in Brainvision Analyzer the header looks like that:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Original header real.vhdr<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">===============================<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Brain Vision Data Exchange Header File Version 1.0<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">; Data created by the Vision Recorder<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">[...]<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Ch4=Fz,,0.1,µV<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> realnewRef.vhdr<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">===============================<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Brain Vision Data Exchange Header File Version 1.0<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">; Data created from history path: real/Raw Data/New Reference<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">[...]<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Ch4=Fz,Avg,,µV<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">This was just a test I did with some random data. I don't have acess to the orginal recording for the data sets I want to read in. The header
from them look like<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Brain Vision Data Exchange Header File Version 1.0<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">; Data created from history path: passive3101/Raw Data/Filters/New Reference/Attentive<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">[...]<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Ch12=Fz,ref new,,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Like I said what's really strange that I think I was able to preprocess the exact same data set a couple of month ago.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Thanks for your help!<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Best,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Julian<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">Von:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> <a href="mailto:fieldtrip-bounces@donders.ru.nl" target="_blank">fieldtrip-bounces@donders.ru.nl</a> [mailto:<a href="mailto:fieldtrip-bounces@donders.ru.nl" target="_blank">fieldtrip-bounces@donders.ru.nl</a>]
<b>Im Auftrag von </b>Casper van Heck<br>
<b>Gesendet:</b> Wednesday, January 25, 2012 10:10 AM<br>
<b>An:</b> Email discussion list for the FieldTrip project<br>
<b>Betreff:</b> Re: [FieldTrip] Missing resolution Information in *vhdr causes ft_preprocessing to return only NaNs<u></u><u></u></span></p>
</div><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Julian,<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">It is my understanding that the header file doesn't change at all, since Brainvision Analyzer stores all changes either in the 'history' files or temporary files in the history folder. The *.vhdr and *.eeg (and marker files, if any) should
be unchanged after preprocessing. Therefore, resolution information should still be there.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Could you check the contents of the header file with notepad?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">It should say something like this for every channel under "[Channel Infos]":<u></u><u></u></p>
<div>
<div>
<p class="MsoNormal">Ch27=Fz,,0.0715,ĀµV<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
</div>
<div>
<p class="MsoNormal">Also, you could try to open it with Brainvision Analyzer, and see if that gives an error of sorts.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Sincerely,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Casper van Heck<u></u><u></u></p>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">On Tue, Jan 24, 2012 at 11:54 PM, Karch, Julian <<a href="mailto:karch@mpib-berlin.mpg.de" target="_blank">karch@mpib-berlin.mpg.de</a>> wrote:<u></u><u></u></p>
<div>
<div>
<p class="MsoNormal">Hi,<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">I'm working on a brainvision EEG dataset which was preprocessed by someone else using Brainvision Analyzer. One part of his preprocessing was to set a new reference.
This processing step makes the resolution information in the *vhdr file disappear. Because of that hdr.orig.resolution=NaN for all channels. As result of that the lines</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">
</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New"">calib = diag(hdr.resolution(chanindx));</span><u></u><u></u></p>
<p class="MsoNormal" style="text-autospace:none">
<span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New""> <span style="color:forestgreen">
% using a sparse multiplication speeds it up</span></span><u></u><u></u></p>
<p class="MsoNormal" style="text-autospace:none">
<span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New""> dat = full(sparse(calib) * dat);</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">in read_brainvision_eeg produce only NaN. This again results in trials which only contain NaNs.</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">I do weekly updates of fieldtrip using svn. Because I'm quite sure if was able to read in, using ft_preprocssing, the excact same dataset, even with the same
cfg file, earlier this year I checked the modifications for the last half year or so but I couldn't find any change which could have broken it.</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">My two questions are. How would you handle this problem? Just plug in some random numbers like 0.1 ? Is this an issue with fieldtrip or am I doing something wrong?
Were there any changes to the involved functions which could have changed the behavior in that way?</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">Thanks in advance!</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">Best,</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">Julian</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">Julian Karch
</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">Research Assistant</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">Center for Lifespan Psychology</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">MPI for Human Development</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">Lentzeallee 94, 14195 Berlin, Germany</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">phone:
<a href="tel:%2B49-30-82406-296" target="_blank">+49-30-82406-296</a></span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">fax:
<a href="tel:%2B49-30-8249939" target="_blank">+49-30-8249939</a></span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">web:
</span><a href="http://www.mpib-berlin.mpg.de" target="_blank"><span lang="EN-US">http://www.mpib-berlin.mpg.de</span></a><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"><br>
_______________________________________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl" target="_blank">fieldtrip@donders.ru.nl</a><br>
<a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><u></u><u></u></p>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div></div></div>
</div>
<br>_______________________________________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>
<a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br></blockquote></div><br></div>