-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39 from nguyen-td/feature
Feature
- Loading branch information
Showing
10 changed files
with
123 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Cingulo_opercular_network DNM Salience_network Executive_network Working_memory_network Dorsal_attention_network | ||
13L 23L 13L 8L 6R 17R | ||
42L 31L 24L 9L 8R 18R | ||
8L 39L 32L 10L 9R 19R | ||
9L 24L 33L 46L 7R 7R | ||
10L 25L 13R 3L 39R 8R | ||
ThalamusL 32L 24R 5L 40R 17L | ||
13R 33L 32R 7L 6L 18L | ||
42R 23R 33R 39L 8L 19L | ||
8R 31R 40L 9L 7L | ||
9R 39R 8R 7L 8L | ||
10R 24R 9R 39L | ||
ThaRamusR 25R 10R 40L | ||
39R 32R 46R | ||
40R 33R 3R | ||
39L 5R | ||
40L 7R | ||
39R | ||
40R |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
clear | ||
allAreas = readtable('NGNetworkROIs_area_definition_v2.txt', 'delimiter', char(9)); | ||
networks = readtable('NGNetworkROIs_v4.txt', 'delimiter', char(9)); | ||
networksNew = networks; | ||
networksNew(2:end,:) = []; | ||
|
||
networkNames = fieldnames(networks); | ||
allAreasNames = fieldnames(allAreas); | ||
allAreasNames = allAreasNames(1:end-3); | ||
for iNet = 1:length(networkNames)-3 | ||
|
||
count = 1; | ||
areas = networks.(networkNames{iNet}); | ||
addAreaList = {}; | ||
|
||
% get the list of areas | ||
for iArea = 1:length(areas) | ||
areaNameTmp = areas{iArea}; | ||
|
||
if ~isempty(areaNameTmp) | ||
if areaNameTmp(end) ~= 'L' && areaNameTmp(end) ~= 'R' | ||
areaNameTmp1 = [ areaNameTmp '_R' ]; | ||
areaNameTmp2 = [ areaNameTmp '_L' ]; | ||
colPos1 = strmatch(areaNameTmp1, allAreasNames, 'exact'); | ||
colPos2 = strmatch(areaNameTmp2, allAreasNames, 'exact'); | ||
addAreaList = { addAreaList{:} allAreas{:,colPos1}{:} allAreas{:,colPos2}{:} }; | ||
else | ||
colPos = strmatch(areaNameTmp, allAreasNames, 'exact'); | ||
addAreaList = { addAreaList{:} allAreas{:,colPos}{:} }; | ||
end | ||
end | ||
end | ||
|
||
% write the list of areas | ||
addAreaList(cellfun(@isempty, addAreaList)) = []; | ||
for iArea = 1:length(addAreaList) | ||
networksNew(iArea,iNet) = { addAreaList{iArea} }; | ||
end | ||
end | ||
writetable(networksNew, 'BANetworkROIs_v4.txt', 'delimiter', char(9)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
% are shown in Zandvoort and Nolte, 2021. | ||
% | ||
% Inputs: | ||
% data - nchan x ntimepoints x ntrials ROI data, requires prior source reconstruction | ||
% data - (nchan x ntimepoints x ntrials) or (nchan x ntimepoints * ntrials) ROI data, requires prior source reconstruction | ||
% params - Set containing parameters for bispectrum computation | ||
% | ||
% Outputs: | ||
|
@@ -12,7 +12,8 @@ | |
% b_orig_norm - ROI x ROI bicoherence (normalized by threenorm) | ||
% b_anti_norm - ROI x ROI antisymmetrized bicoherence (normalized by threenorm) | ||
% | ||
% Copyright (C) Franziska Pellegrini, [email protected] | ||
% Copyright (C) Franziska Pellegrini, [email protected], | ||
% Tien Dung Nguyen, [email protected] | ||
|
||
function [b_orig, b_anti, b_orig_norm,b_anti_norm] = pac_bispec(data, params) | ||
|
||
|
@@ -38,7 +39,11 @@ | |
[m, n] = ndgrid(frqs_low, frqs_high); | ||
frqs_combs = [m(:),n(:)]; | ||
n_combs = size(frqs_combs, 1); | ||
warning('PAC is going to be estimated on %d frequency pair(s).', n_combs); | ||
if n_combs > 50 | ||
% according to our test simulations, the computation time scales linearly with the number of frequency pairs times 2, assuming no other ongoing CPU-heavy processes | ||
time_est = 2 * n_combs; | ||
warning('PAC is going to be estimated on %d frequency pair(s). Estimated time: %d seconds', n_combs, time_est); | ||
end | ||
|
||
freqinds_low = zeros(n_combs, 2); | ||
freqinds_up = zeros(n_combs, 2); | ||
|
@@ -70,7 +75,7 @@ | |
[bs_low,~] = data2bs_event(X(:,:)', segleng, segshift, epleng, freqinds_low); | ||
biv_orig_low = ([abs(bs_low(1, 2, 2, :)) abs(bs_low(2, 1, 1, :))]); | ||
xx = bs_low - permute(bs_low, [2 1 3, 4]); | ||
biv_anti_low =([abs(xx(1, 2, 2, :)) abs(xx(2, 1, 1, :))]); | ||
biv_anti_low = ([abs(xx(1, 2, 2, :)) abs(xx(2, 1, 1, :))]); | ||
|
||
% normalized by threenorm | ||
[RTP_low,~] = data2bs_threenorm(X(:,:)', segleng, segshift, epleng, freqinds_low); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters