[Eeglablist] bva io plugin scaling

Andreas Widmann widmann at uni-leipzig.de
Mon Sep 28 01:42:28 PDT 2015


Hi Basile,

your input is appreciated. To report potential bugs, please file a report at the EEGLAB bugzilla (https://sccn.ucsd.edu/bugzilla/) *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 (https://github.com/widmann/bva-io).

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;)

Best,
Andreas

> Am 25.09.2015 um 17:34 schrieb basile pinsard <basile.pinsard at gmail.com>:
> 
> Hi all,
> The bva-io plugin had a bug which prevent correct scaling of the data.
> most of the operation on chanlocs was not stored in EEG structure
> I mainly changed the lines  117-136 of pop_loadbv.m for the following to restore correct scaling.
> 
> 
> if isfield(hdr, 'channelinfos')
>     for chan = 1:length(chans)
>         try
>             [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', ',');
>         catch % Octave compatible code below
>             str  = hdr.channelinfos{chans(chan)};
>             [EEG.chanlocs(chan).labels str] = strtok(str, ',');
>             [EEG.chanlocs(chan).ref        str] = strtok(str, ',');
>             [EEG.chanlocs(chan).scale      str] = strtok(str, ',');
>             [EEG.chanlocs(chan).unit       str] = strtok(str, ',');
>         end;
>         EEG.chanlocs(chan).labels = char(EEG.chanlocs(chan).labels);
>         EEG.chanlocs(chan).scale = str2double(char(EEG.chanlocs(chan).scale));
> %             EEG.chanlocs(chan).unit = native2unicode(double(char(EEG.chanlocs(chan).scale)), 'UTF-8');
> %             EEG.chanlocs(chan).datachan = chans(chan);
>     end
>     if isempty([EEG.chanlocs.scale])
>         EEG.chanlocs = rmfield(EEG.chanlocs, 'scale');
>     end
> end;
> 
> 
> 
> I am kind of lost between the repository for the code though so I didn't pushed anything.
> 
> Cheers.
> -- 
> Basile Pinsard
> PhD candidate, 
> Laboratoire d'Imagerie Biomédicale, UMR S 1146 / UMR 7371, Sorbonne Universités, UPMC, INSERM, CNRS
> Brain-Cognition-Behaviour Doctoral School , ED3C, UPMC, Sorbonne Universités
> Biomedical Sciences Doctoral School, Faculty of Medicine, Université de Montréal 
> CRIUGM, Université de Montréal
> _______________________________________________
> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
> To unsubscribe, send an empty email to eeglablist-unsubscribe at sccn.ucsd.edu
> For digest mode, send an email with the subject "set digest mime" to eeglablist-request at sccn.ucsd.edu



More information about the eeglablist mailing list