完全内輪向け.

EEGLAB versionは7.1.3.11b.

前回のコンタープロットがまさに処理していたデータに限定的だったので,
少し汎用性を持たせて見ました.
ただどのデータをプロットするのか指定するだけですが…

以前のもの

contourf(ALLTFA.timec,ALLTFA.freqs,ALLTFA.ERSP.avdata, ...
[min(min(ALLTFA.ERSP.avdata)):0.1:max(max(ALLTFA.ERSP.avdata))])


では単極,単一条件で取りあえず出してみた時にしか機能しませんが,
普通多くの電極,いくつかの条件でデータを算出するはずですので,

ALLTFA.ERSP.avdata



ALLTFA.ERSP(電極数,条件数).avdata

になるはずです.


よって以下のようにしました.


%------------(Please set your request for plotting)--------------
ElecLabel='';
ElecNum=0;
ConditionNumber=0;


%------------(The program follows)--------------
if isempty(ElecLabel)
if ElecNum=0, fprintf('please set the Elec Label or number.\n');
elseif ~isempty(ElecNum), fprintf('please set the Elec Label or number.\n');
else elec=ElecNum;
end
else
for i=1:size(ALLTFA.channel,2)
if strcmp(ALLTFA.channel(1,i),ElecLabel)==1
ElecNum=i;break
end
if i==size(ALLTFA.channel,2)
error('please check whether ElecLabel is correct, or use the number')
end
end
end

cond=ConditionNumber;

contourf(ALLTFA.timec,ALLTFA.freqs,ALLTFA.ERSP(elec,cond).avdata, ...
[min(min(ALLTFA.ERSP.avdata)):0.1:max(max(ALLTFA.ERSP.avdata))])



で作ったmatファイルのデータをコンタープロット表示できます.

Conditionもラベルで指定できるようにしたら,
プロットに条件名も表示できていいですが,
それは元のTFA_EEGLAB_revisitedを少し改変する必要があるのでまた今度.
とりあえずどんな感じか見てみるだけってことで.

少しずつ汎用性を高めていきます.