function [Total_RonO, Total_TRonS, Total_ftRonO, Total_ftTRonS]=retabulate_totals(RonO, TRonS, ftRonO, ftTRonS, numchan)

Total_RonO=zeros(numchan,1);
Total_TRonS=zeros(numchan,1);
Total_ftRonO=zeros(numchan,1);
Total_ftTRonS=zeros(numchan,1);

if ~isempty(RonO)
for i=1:numel(RonO.channel)
    Total_RonO(RonO.channel(i))=Total_RonO(RonO.channel(i))+1;
end;
end;

if ~isempty(TRonS)
for i=1:numel(TRonS.channel)
    Total_TRonS(TRonS.channel(i))=Total_TRonS(TRonS.channel(i))+1;
end;
end;

if ~isempty(ftRonO)
for i=1:numel(ftRonO.channel)
    Total_ftRonO(ftRonO.channel(i))=Total_ftRonO(ftRonO.channel(i))+1;
end;
end;

if ~isempty(ftTRonS)
for i=1:numel(ftTRonS.channel)
    Total_ftTRonS(ftTRonS.channel(i))=Total_ftTRonS(ftTRonS.channel(i))+1;
end;
end;