<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Mattias,<div><br></div><div><div><blockquote type="cite"><div>I am quite new to Fieldtrip and hope that someone has solved my problem before.<br></div></blockquote><div><br></div><div>High expectations ;). </div><br><blockquote type="cite"><div>I recorded EEG data inside an MR Scanner with the BrainVision software and now I want to use Fieldtrip to run some error correction scripts - so far so god.<br>But after that I need to write the corrected data back to the original EEG - data format.<br>I use the ft_write_data function to do this. After some problems I manage to run the function, but the result is a double size datafile, a messed up header and a empty marker file.<br>Probably the data is written in double precision. Giving the data to the function with "single(data_org.trial{1})" in the argument does not help.<br>The command line I use to call the function is:<br>ft_write_data('ScannerCor', data_org.trial{1}, 'dataformat', 'brainvision_eeg','header', data_org.hdr);<br><font class="Apple-style-span" color="#000000"><font class="Apple-style-span" color="#144FAE"><br></font></font></div></blockquote><blockquote type="cite"><div>(I copied the corrected data back to the read in matrix)<br><br>I heard already, that I can tell Matlab to use only single precision, but it would be nice to tell that the function directly - Is there a way to do so?<br>What do I need to do, to export the header and marker file correctly?<font class="Apple-style-span" color="#000000"><font class="Apple-style-span" color="#144FAE"><br></font></font></div></blockquote><div><br></div>I have not encountered this issue before, and I don't know whether anybody else has. This may mean that you need to do some digging yourself to get it solved. I never tried to export data to a different fileformat. The easy way out here would be to also do your subsequent analysis steps in matlab/fieldtrip.</div><div>Did you already have a detailed look at ft_write_data, and in particular the part which deals with 'brainvision_eeg'. My suspicion is that there is a discrepancy between the information in data_org.hdr, and the exact data you try to export (data_org.trial{1}). Manually converting to single precision may not work if in data_org.hdr you need to specify the precision. (once again I don't know about the specifics of this function, or of the functions it relies on). Using the matlab debugger may help you to access the variables in the function's workspace and to see what's preventing it to work properly.</div><div><br></div><div>Good luck,</div><div><br></div><div>Jan-Mathijs</div><div><br></div><div><br></div><div><br></div><div apple-content-edited="true"> <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Dr. J.M. (Jan-Mathijs) Schoffelen </div><div>Donders Institute for Brain, Cognition and Behaviour, <br>Centre for Cognitive Neuroimaging,<br>Radboud University Nijmegen, The Netherlands</div><div><a href="mailto:J.Schoffelen@donders.ru.nl">J.Schoffelen@donders.ru.nl</a></div><div>Telephone: 0031-24-3668063</div></div></span> </div><br></div></body></html><p>----------------------------------</p>
<p>The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis.</p>
<p>  http://listserv.surfnet.nl/archives/fieldtrip.html</p>
<p>  http://www.ru.nl/fcdonders/fieldtrip/</p>