[Eeglablist] bva io plugin scaling
basile pinsard
basile.pinsard at gmail.com
Fri Sep 25 08:34:05 PDT 2015
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sccn.ucsd.edu/pipermail/eeglablist/attachments/20150925/38d0a822/attachment.html>
More information about the eeglablist
mailing list