diff --git a/pipeline_connectivity.m b/pipeline_connectivity.m index 93e03d6..522d510 100644 --- a/pipeline_connectivity.m +++ b/pipeline_connectivity.m @@ -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'}); diff --git a/pop_roi_connectplot.m b/pop_roi_connectplot.m index fbacd8c..51eed9c 100644 --- a/pop_roi_connectplot.m +++ b/pop_roi_connectplot.m @@ -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' ]; @@ -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, :); @@ -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)