Skip to content

Commit 44870aa

Browse files
Merge pull request #6 from CognitiveNeuroLab/final_code
final version matlab code
2 parents d62b756 + 62a3dcb commit 44870aa

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

src/I_Microstates_groups.m

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@
55
% so that you can decide how many microstates
66
% you want to choose without getting into single subjects
77
% only run 1 group at a time to compaire their EO and EC data
8-
% adapted for our pipeline on 12/20/2021 by Douwe
8+
% or run for everyone together
9+
% adapted for our pipeline on 6/26/2021 by Douwe
910
clear variables
1011

1112

1213

1314

14-
Group = {'22q' };% 'Control 22q' 'Control sz' '22q +' '22q -' 'sz' };%
15+
Group = {'All' };% 'Control 22q' 'Control sz' '22q +' '22q -' 'sz' };%
1516
type={'EC'};
1617
for g=1:length(Group)
1718
switch Group{g}
@@ -35,6 +36,9 @@
3536
subject_list = {'2202' '2204' '2212' '2222' '2229' '2231' '2257' '2260' '2261' '2284' '2295'};
3637
case '22q'
3738
subject_list = {'2201','2207','2216','2243','2256','2267','2274','2281','2286','2292','2202','2204','2212','2222','2229','2231','2257','2260','2261','2284','2295'};
39+
case 'All'
40+
subject_list = {'10293' '10561' '10562' '10581' '10616' '10748' '10822' '10858' '10935' '12004' '12512' '12632' '12648' '12727' '12739' '12746' '12750' '12770' '12815' '12010' '12139' '12177' '12188' '12197' '12203' '12206' '12272' '12415' '12482' '12588' '12651' '12852' '12870' '7003' '7007' '7019' '7025' '7046' '7051' '7054' '7058' '7061' '7064' '7065' '7073' '7078' '7089' '7092' '7094' '7123' '7556' '7808' '2201' '2207' '2216' '2243' '2256' '2267' '2274' '2281' '2286' '2292' '2202' '2204' '2212' '2222' '2229' '2231' '2257' '2260','2261' '2284' '2295'};
41+
3842
end
3943
home_path = 'D:\restingstate\data\';
4044
for t=1:length(type)
@@ -43,7 +47,7 @@
4347
for s=1:length(subject_list)
4448
data_path = [home_path subject_list{s} ''];% Path to the folder containing the current subject's data
4549
% Load original dataset
46-
fprintf('\n\n\n**** %s: Loading dataset ****\n\n\n', subject_list{s});
50+
fprintf('\n\n\n**** %s: Loading dataset ****\n\n\n', subject_list{s});
4751
EEG = pop_loadset('filename', [subject_list{s} '_' type{t} '.set'], 'filepath', data_path);
4852
[ALLEEG, EEG] = eeg_store(ALLEEG, EEG, CURRENTSET);
4953
end
@@ -57,7 +61,7 @@
5761
figure;[tt]=title([type{t} ' ' Group{g}]);tt.FontSize = 15;MicroPlotTopo( EEG, 'plot_range', [] ); %plotting microstates
5862
print([save_path Group{g} '_microstate_' type{t}], '-djpeg','-r300');
5963
figure();
60-
% EEG = pop_micro_selectNmicro( EEG ); % only select CV and GEV, look for where GEV doesn't increase significantly
64+
EEG = pop_micro_selectNmicro( EEG ); % only select CV and GEV, look for where GEV doesn't increase significantly
6165
[ALLEEG EEG] = eeg_store(ALLEEG, EEG, CURRENTSET);
6266
close all
6367
end

src/J_Microstates_all.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
clear variables
77

88

9-
Group = {'22q' };% 'Control 22q' 'Control sz' '22q +' '22q -' 'sz' };%
9+
Group = {'All' };% 'Control 22q' 'Control sz' '22q +' '22q -' 'sz' };%
1010
type={'EC'};
1111
n_microstates=4;%how many microstates should be plotted
1212
for g=1:length(Group)
@@ -31,6 +31,9 @@
3131
subject_list = {'2202' '2204' '2212' '2222' '2229' '2231' '2257' '2260' '2261' '2284' '2295'};
3232
case '22q'
3333
subject_list = {'2201','2207','2216','2243','2256','2267','2274','2281','2286','2292','2202','2204','2212','2222','2229','2231','2257','2260','2261','2284','2295'};
34+
case 'All'
35+
subject_list = {'10293' '10561' '10562' '10581' '10616' '10748' '10822' '10858' '10935' '12004' '12512' '12632' '12648' '12727' '12739' '12746' '12750' '12770' '12815' '12010' '12139' '12177' '12188' '12197' '12203' '12206' '12272' '12415' '12482' '12588' '12651' '12852' '12870' '7003' '7007' '7019' '7025' '7046' '7051' '7054' '7058' '7061' '7064' '7065' '7073' '7078' '7089' '7092' '7094' '7123' '7556' '7808' '2201' '2207' '2216' '2243' '2256' '2267' '2274' '2281' '2286' '2292' '2202' '2204' '2212' '2222' '2229' '2231' '2257' '2260','2261' '2284' '2295'};
36+
3437
end
3538
home_path = 'D:\restingstate\data\';
3639
%% creating arrays to save data in

0 commit comments

Comments
 (0)