[Eeglablist] presenting epochs one above the other

shahar shahars10 at gmail.com
Mon May 19 10:54:31 PDT 2014


Thank you !


On Mon, May 19, 2014 at 1:39 AM, Mikołaj Magnuski <imponderabilion at gmail.com
> wrote:

> Check EEGlab options (file -> memory and other options). You can choose
> between single and double precision there.
> (before ICA the data are always cast to double precision as far as I
> remember)
> 19 maj 2014 00:15 "shahar" <shahars10 at gmail.com> napisał(a):
>
> Hello Mikolaj,
>> Thanks for this code. I haven't check your whole code, but it looks very
>> good.
>> 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 ?
>> Thank you,
>>
>> Shahar
>>
>>
>> On Sun, May 18, 2014 at 3:06 AM, Mikołaj Magnuski <
>> imponderabilion at gmail.com> wrote:
>>
>>> The simplest (but not necessarily most efficient) way of doing this is:
>>>
>>> 1. Load the data (using pop_loadset() for example or through the GUI)
>>> 2. Run this script (it should work correctly assuming you have
>>>     more epochs than channels):
>>>
>>> %%%%%%
>>>
>>> % get size of data and allocate new data matrix
>>> Siz = size(EEG.data);
>>> NewData = zeros(fliplr(Siz));
>>>
>>> % restrucutre the data
>>> for i = 1:Siz(1)
>>>     NewData(:, :, i) = squeeze(EEG.data(i, :, :))';
>>> end
>>>
>>> % update relevant fields
>>> EEG.data = NewData;
>>> EEG.nbchan = Siz(3);
>>> EEG.trials = Siz(1);
>>>
>>> % add fake channel info:
>>> addchn = Siz(3) - Siz(1);
>>>
>>> for a = 1:addchn
>>>     num = num2str(rand(1));
>>>     fakename = ['ch_', num(3:5)];
>>>     EEG.chanlocs(Siz(1)+a) = EEG.chanlocs(Siz(1) - mod(a, Siz(1)));
>>>     EEG.urchanlocs(Siz(1)+a) = EEG.urchanlocs(Siz(1) - mod(a, Siz(1)));
>>>     EEG.chanlocs(Siz(1)+a).labels = fakename;
>>>     EEG.urchanlocs(Siz(1)+a).labels = fakename;
>>> end
>>>
>>> % trim the epoch structure
>>> EEG.epoch(end -(addchn - 1):end) = [];
>>>
>>> % redraw eeglab GUI
>>> eeglab redraw
>>> clear NewData a num fakename Siz i addchn
>>>
>>> %%%%%%
>>>
>>> 3. Now using standard channel (scroll) plotting
>>>     will show you epochs as electrodes and vice
>>>     versa. If it does not work correctly - let me know.
>>>
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sccn.ucsd.edu/pipermail/eeglablist/attachments/20140519/8e23738e/attachment.html>


More information about the eeglablist mailing list