<div dir="ltr">Thank you !</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, May 19, 2014 at 1:39 AM, Mikołaj Magnuski <span dir="ltr"><<a href="mailto:imponderabilion@gmail.com" target="_blank">imponderabilion@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">Check EEGlab options (file -> memory and other options). You can choose between single and double precision there.<br>
(before ICA the data are always cast to double precision as far as I remember)</p>
<div class="gmail_quote">19 maj 2014 00:15 "shahar" <<a href="mailto:shahars10@gmail.com" target="_blank">shahars10@gmail.com</a>> napisał(a):<div><div class="h5"><br type="attribution"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid">
<div dir="ltr"><div>Hello Mikolaj,</div><div>Thanks for this code. I haven't check your whole code, but it looks very good. </div><div>I have one question though: we have some data of double precision, but when it's translated to the EEGLAB, the variable EEG.data contains data of single precision. Does anyone have an idea why this precision has changed ?</div>
<div>Thank you,</div><div><br></div><div>Shahar </div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, May 18, 2014 at 3:06 AM, Mikołaj Magnuski <span dir="ltr"><<a href="mailto:imponderabilion@gmail.com" target="_blank">imponderabilion@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid"><div dir="ltr"><p dir="ltr">The simplest (but not necessarily most efficient) way of doing this is:</p>
<p dir="ltr">1. Load the data (using pop_loadset() for example or through the GUI)<br>
2. Run this script (it should work correctly assuming you have<br> more epochs than channels):<br></p><p dir="ltr">%%%%%%<br><br>% get size of data and allocate new data matrix<br>Siz = size(EEG.data);<br>NewData = zeros(fliplr(Siz));</p>
<p dir="ltr">% restrucutre the data<br>for i = 1:Siz(1)<br> NewData(:, :, i) = squeeze(EEG.data(i, :, :))';<br>end</p><p dir="ltr">% update relevant fields<br>EEG.data = NewData;<br>EEG.nbchan = Siz(3);<br>EEG.trials = Siz(1);</p>
<p dir="ltr">% add fake channel info:<br>addchn = Siz(3) - Siz(1);</p><p dir="ltr">for a = 1:addchn<br> num = num2str(rand(1));<br> fakename = ['ch_', num(3:5)];<br> EEG.chanlocs(Siz(1)+a) = EEG.chanlocs(Siz(1) - mod(a, Siz(1)));<br>
EEG.urchanlocs(Siz(1)+a) = EEG.urchanlocs(Siz(1) - mod(a, Siz(1)));<br> EEG.chanlocs(Siz(1)+a).labels = fakename;<br> EEG.urchanlocs(Siz(1)+a).labels = fakename;<br>end</p><p dir="ltr">% trim the epoch structure<br>
EEG.epoch(end -(addchn - 1):end) = [];</p><p dir="ltr">% redraw eeglab GUI<br>eeglab redraw<br>clear NewData a num fakename Siz i addchn</p><p dir="ltr">%%%%%%</p><p>3. Now using standard channel (scroll) plotting<br> will show you epochs as electrodes and vice<br>
versa. If it does not work correctly - let me know.</p>
</div>
</blockquote></div><br></div>
</blockquote></div></div></div>
</blockquote></div><br></div>