Thank you so much for your answer. I did not use GUI, I have my script:
%% Correlation Calculation in Brainstorm
ProtocolName = ‘…';
SubjectName = '…';
SensorTypes = 'ECOG'; % 'ECOG','SEEG','EEG'
% Start Brainstorm
if \~brainstorm('status'), brainstorm nogui; end
iProt = bst_get('Protocol', ProtocolName);
if isempty(iProt), error('Protocol not found: %s', ProtocolName); end
gui_brainstorm('SetCurrentProtocol', iProt);
% Sadece epok dosyalarını seç (BAD trial'lar hariç)
sAll = bst_process('CallProcess','process_select_files_data', [ ], [ ], ...
'subjectname', SubjectName, ...
'condition', '', ...
'tag', 'HFO', ...
'includebad', 1, ...
'includeintra',0, 'includecommon',0);
if isempty(sAll)
error('Hiç HFO etiketli epoch bulunamadı. (Tag="HFO", condition boş).');
end
% Bad trial’ları çıkar
sGood = bst_process('CallProcess','process_select_files_data', sAll, [ ], ...
'subjectname', SubjectName, ...
'condition', '', ...
'tag', '', ...
'includebad', 0, ...
'includeintra',0, 'includecommon',0);
fprintf('HFO epok sayısı: toplam=%d, good=%d, bad=%d\n', ...
numel(sAll), numel(sGood), numel(sAll)-numel(sGood));
if isempty(sGood)
error('Good epok bulunamadı. (Muhtemelen tüm HFO epokları BAD ile çakışıyor ya da tag/subject eşleşmedi.)');
end
% Pearson correlation NxN (epoch bazında)
sConn = bst_process('CallProcess','process_corr1n', sGood, [ ], ...
'timewindow', [ ], ...
'sensortypes','ECOG', ...
'includebad',0, ...
'timeres','none', ...
'scalarprod',0, ...
'outputmode','input');
bst_report('Open', bst_report('Save', sConn));
Should I change/add something to remove bad channels from the matrix? I computed connectivity for each epoch. I assume they’re not included in the correlation calculation but maybe it does zero padding for those channels? So I removed those after the calculation, but in essence, I don’t want them in the first place.