Hi All,

We've been using FASTER to separately analyze biosemi .bdf and neuroscan .cnt data.  In the latest version of the code, the channel_properties.m function contains the following lines (31-35):
---
if ~isempty(ref_chan) && length(ref_chan)==1
    pol_dist=distancematrix(EEG,eeg_chans);
    [s_pol_dist dist_inds] = sort(pol_dist(ref_chan,eeg_chans));
    [s_inds idist_inds] = sort(dist_inds);
end
---

In an earlier version, these lines did not contain the if statement (31-33):
---
pol_dist=distancematrix(EEG);
[s_pol_dist dist_inds] = sort(pol_dist(ref_chan,eeg_chans));
[s_inds idist_inds] = sort(dist_inds);
---

Both versions subsequently contain similar code to calculate the properties, for example:
---
% 3 Variance of the channels
vars = var(EEG.data(eeg_chans,:)');
vars(~isfinite(vars))=mean(vars(isfinite(vars)));
% Quadratic correction for distance from reference electrode

if (~isempty(ref_chan) && length(ref_chan)==1)
    p = polyfit(s_pol_dist,vars(dist_inds),2);
    fitcurve = polyval(p,s_pol_dist);
    corrected = vars - fitcurve(idist_inds);

    list_properties(:,measure) = corrected;
else
    list_properties(:,measure) = vars;
end
measure = measure + 1;
---

What's odd is that in the later version, the only way it can work is if you feed it a single reference channel in the ref_chan argument.  If this is by design, why are there else statements in the property calculations?  For example, dist_inds won't exist if you have two reference electrodes (like averaged mastoids or earlobes) and the function will error out.  In earlier versions, the else statements would be accessed when the ref channel was not defined or contained two or more electrodes.  In the case of neuroscan data, they are recorded with respect to a reference electrode that doesn't exist in the .cnt file or EEG structure unless you create it.  So, we would pass channel_properties an empty ref_chan argument.  Is that wrong?  What are the implications of using one version vs the other?  I assume the old version run with empty ref_chan argument would not do the quadratic correction mentioned in the comments.  Is that a major problem?

thanks,
Brian


--
San Francisco VA Medical Center 116D
4150 Clement St. Bld 8 Rm9B#29
San Francisco CA 94121
phone: (415) 221-4810x4335
fax: (415) 750-6622