Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiyeri committed Oct 21, 2022
2 parents 614c3bd + 3d947be commit 6b4006d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 24 deletions.
1 change: 1 addition & 0 deletions pipeline_connectivity.m
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
measures = { 'CS' 'COH' 'DTF' 'wPLI' 'PDC' 'MIM' 'MIC' 'GC' };
measures = { 'CS' 'COH' 'wPLI' 'PDC' 'MIM' 'MIC' 'GC' };
measures = { 'CS' 'COH' 'MIM' 'GC' };
measures = { 'CS' 'COH' 'MIM' };

EEG_no_connect = EEG;
EEG = pop_roi_connect(EEG_no_connect, 'methods', {'MIM'});
Expand Down
26 changes: 2 additions & 24 deletions pop_roi_connectplot.m
Original file line number Diff line number Diff line change
Expand Up @@ -357,10 +357,6 @@
% TRGCnet = S.TRGC(:, :, 1) - S.TRGC(:, :, 2);
TRGC = S.TRGC;
end
% TRGCnet = TRGCnet - permute(TRGCnet, [1 3 2]);
% TRGCnet = TRGCnet(:,:);
% TRGCnet = S.GC(:, :, 1) - S.GC(:, :, 2);
% TRGC = get_connect_mat( TRGCnet, S.nROI, -1);
matrix = squeeze(mean(TRGC(frq_inds, :, :)));
cortexPlot = mean(matrix, 2);
cortexTitle = [ upper(g.measure) ' (' titleStr '); Red = net sender; Blue = net receiver' ];
Expand All @@ -373,27 +369,23 @@
% MI = S.MIM(:, :);
MI = S.MIM;
end
% MI = get_connect_mat( MI, S.nROI, +1);
matrix = squeeze(mean(MI(frq_inds, :, :)));
cortexPlot = mean(matrix, 2);

case { 'crossspecpow' 'coh' 'crossspecimag' }
if strcmpi(g.measure, 'coh')
PS = abs(S.COH); % do not know what to do here
PS = squeeze(mean(mean(reshape(PS, S.srate+1, S.nPCA, S.nROI, S.nPCA, S.nROI), 2), 4));
PSarea2area = squeeze(mean(PS(frq_inds, :, :)));
cortexPlot = mean(PSarea2area, 2);
elseif strcmpi(g.measure, 'crossspecimag')
PS = abs(imag(cs2coh(S.CS)));
PS = squeeze(mean(mean(reshape(PS, S.srate+1, S.nPCA, S.nROI, S.nPCA, S.nROI), 2), 4));
PSarea2area = squeeze(mean(PS(frq_inds, :, :)));
cortexPlot = mean(PSarea2area, 2);
else
PS = cs2psd(S.CS);
PS2 = squeeze(mean(mean(reshape(PS, S.srate+1, S.nPCA, S.nROI, S.nPCA, S.nROI), 2), 4));
PSarea2area = squeeze(mean(PS2(frq_inds, :, :),1));
apow = squeeze(sum(sum(reshape(PS(frq_inds, :), [], S.nPCA, S.nROI), 1), 2)).*S.source_roi_power_norm';
apow = squeeze(sum(sum(reshape(PS(frq_inds, :), [], S.nROI), 1), 2)).*S.source_roi_power_norm';
cortexPlot = 10*log10(apow);
PSarea2area = [];
end
plotPSDFreq = S.freqs(frq_inds);
plotPSD = PS(frq_inds, :);
Expand Down Expand Up @@ -451,20 +443,6 @@
end
end

function measure = get_connect_mat( measureOri, nROI, signVal)
% create a ROI x ROI connectivity matrix, if needed
% TRGCmat(f, ii, jj) is net TRGC from jj to ii
measure = [];
iinds = 0;
for iroi = 1:nROI
for jroi = (iroi+1):nROI
iinds = iinds + 1;
measure(:, iroi, jroi) = signVal * measureOri(:, iinds);
measure(:, jroi, iroi) = measureOri(:, iinds);
end
end
end

function [coordinate, seed_idx] = get_seedregion_coordinate(scouts, seed_idx, vc)
% determine voxel of selected seed region, if needed
% assign region index to selected seed region (passed as index)
Expand Down

0 comments on commit 6b4006d

Please sign in to comment.