<div dir="ltr"><div>Hi Andreas,<br></div><div>thanks for your quick reply.<br></div><div>Sorry, you are right the code is correct, I was trying to investigate on why I get higher amplitude in a channel which has a different scaling and got mixed in the code, but it is certainly a matter of acquisition setup.<br></div><div>Thanks for your help.<br><br></div><div>Best,<br></div><div>Basile<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 28, 2015 at 4:42 AM, Andreas Widmann <span dir="ltr"><<a href="mailto:widmann@uni-leipzig.de" target="_blank">widmann@uni-leipzig.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Basile,<br>
<br>
your input is appreciated. To report potential bugs, please file a report at the EEGLAB bugzilla (<a href="https://sccn.ucsd.edu/bugzilla/" rel="noreferrer" target="_blank">https://sccn.ucsd.edu/bugzilla/</a>) *including* a description of the problem you perceived and instructions how to replicate the problem (optimally including a small sample file!). For bva-io alternatively you could create an issue at the Github repository (<a href="https://github.com/widmann/bva-io" rel="noreferrer" target="_blank">https://github.com/widmann/bva-io</a>).<br>
<br>
Sorry, from the code you sent I unfortunately cannot replicate or understand the problem. The ref, scale, and unit fields are intentionally not stored in the EEG.chanlocs structure (for compatibility reasons). Scaling is done in line 355 and does not refer to the EEG.chanlocs structure (EEG.data(chan, :) = EEG.data(chan, :) * chanlocs(chan).scale;)<br>
<br>
Best,<br>
Andreas<br>
<div><div class="h5"><br>
> Am 25.09.2015 um 17:34 schrieb basile pinsard <<a href="mailto:basile.pinsard@gmail.com">basile.pinsard@gmail.com</a>>:<br>
><br>
> Hi all,<br>
> The bva-io plugin had a bug which prevent correct scaling of the data.<br>
> most of the operation on chanlocs was not stored in EEG structure<br>
> I mainly changed the lines  117-136 of pop_loadbv.m for the following to restore correct scaling.<br>
><br>
><br>
> if isfield(hdr, 'channelinfos')<br>
>     for chan = 1:length(chans)<br>
>         try<br>
>             [EEG.chanlocs(chan).labels, EEG.chanlocs(chan).ref, EEG.chanlocs(chan).scale, EEG.chanlocs(chan).unit] = strread(hdr.channelinfos{chans(chan)}, '%s%s%s%s', 1, 'delimiter', ',');<br>
>         catch % Octave compatible code below<br>
>             str  = hdr.channelinfos{chans(chan)};<br>
>             [EEG.chanlocs(chan).labels str] = strtok(str, ',');<br>
>             [EEG.chanlocs(chan).ref        str] = strtok(str, ',');<br>
>             [EEG.chanlocs(chan).scale      str] = strtok(str, ',');<br>
>             [EEG.chanlocs(chan).unit       str] = strtok(str, ',');<br>
>         end;<br>
>         EEG.chanlocs(chan).labels = char(EEG.chanlocs(chan).labels);<br>
>         EEG.chanlocs(chan).scale = str2double(char(EEG.chanlocs(chan).scale));<br>
> %             EEG.chanlocs(chan).unit = native2unicode(double(char(EEG.chanlocs(chan).scale)), 'UTF-8');<br>
> %             EEG.chanlocs(chan).datachan = chans(chan);<br>
>     end<br>
>     if isempty([EEG.chanlocs.scale])<br>
>         EEG.chanlocs = rmfield(EEG.chanlocs, 'scale');<br>
>     end<br>
> end;<br>
><br>
><br>
><br>
> I am kind of lost between the repository for the code though so I didn't pushed anything.<br>
><br>
> Cheers.<br>
> --<br>
> Basile Pinsard<br>
> PhD candidate,<br>
> Laboratoire d'Imagerie Biomédicale, UMR S 1146 / UMR 7371, Sorbonne Universités, UPMC, INSERM, CNRS<br>
> Brain-Cognition-Behaviour Doctoral School , ED3C, UPMC, Sorbonne Universités<br>
> Biomedical Sciences Doctoral School, Faculty of Medicine, Université de Montréal<br>
> CRIUGM, Université de Montréal<br>
</div></div>> _______________________________________________<br>
> Eeglablist page: <a href="http://sccn.ucsd.edu/eeglab/eeglabmail.html" rel="noreferrer" target="_blank">http://sccn.ucsd.edu/eeglab/eeglabmail.html</a><br>
> To unsubscribe, send an empty email to <a href="mailto:eeglablist-unsubscribe@sccn.ucsd.edu">eeglablist-unsubscribe@sccn.ucsd.edu</a><br>
> For digest mode, send an email with the subject "set digest mime" to <a href="mailto:eeglablist-request@sccn.ucsd.edu">eeglablist-request@sccn.ucsd.edu</a><br>
<br>
</blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div><font size="1">Basile Pinsard<br></font></div><i><font size="1">PhD candidate, <br></font></i></div><font size="1">Laboratoire d'Imagerie Biomédicale, UMR S 1146 / UMR 7371, Sorbonne Universités, UPMC, INSERM, CNRS</font><br><font size="1"><span><span style="color:#333333"><span style="font-family:Arial,serif"><span lang="en-GB"><em>Brain-Cognition-Behaviour Doctoral School </em></span></span></span><span style="color:#333333"><span style="font-family:Arial,serif"><span lang="en-GB"><strong>, </strong>ED3C<strong>, </strong>UPMC, Sorbonne Universités<br>Biomedical Sciences Doctoral School, Faculty of Medicine, Université de Montréal <br></span></span></span></span></font><font size="1">CRIUGM, Université de Montréal</font><br></div></div></div></div>
</div>