From 1854f904780277f4233d303fe6942cf52d7a2740 Mon Sep 17 00:00:00 2001 From: Hiyeri <48970646+Hiyeri@users.noreply.github.com> Date: Tue, 31 Jan 2023 18:18:15 +0100 Subject: [PATCH] add new test file --- test_pipes/test_matrixplots_brainregions.m | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 test_pipes/test_matrixplots_brainregions.m diff --git a/test_pipes/test_matrixplots_brainregions.m b/test_pipes/test_matrixplots_brainregions.m new file mode 100644 index 0000000..39b89a2 --- /dev/null +++ b/test_pipes/test_matrixplots_brainregions.m @@ -0,0 +1,45 @@ +% Test region-to-region FC matrices (MIM) with different parameters. Here, the grouped LORETA-Talairach-BAs ('Brain-Regions') atlas with 34 ROIs is used as the source model. +%% Run pipeline +clear +eeglab + +eeglabp = fileparts(which('eeglab.m')); +EEG = pop_loadset('filename','eeglab_data_epochs_ica.set','filepath',fullfile(eeglabp, 'sample_data/')); +EEG = pop_resample( EEG, 100); +EEG = pop_epoch( EEG, { }, [-0.5 1.5], 'newname', 'EEG Data epochs epochs', 'epochinfo', 'yes'); +EEG = pop_select( EEG, 'trial',1:30); +[ALLEEG, EEG, CURRENTSET] = eeg_store(ALLEEG, EEG); +eeglab redraw; + +EEG = pop_dipfit_settings( EEG, 'hdmfile',fullfile(eeglabp, 'plugins','dipfit','standard_BEM','standard_vol.mat'), ... + 'coordformat','MNI','mrifile',fullfile(eeglabp, 'plugins','dipfit','standard_BEM','standard_mri.mat'),... + 'chanfile',fullfile(eeglabp, 'plugins','dipfit','standard_BEM','elec', 'standard_1005.elc'),... + 'coord_transform',[0.83215 -15.6287 2.4114 0.081214 0.00093739 -1.5732 1.1742 1.0601 1.1485] ,'chansel',[1:32] ); + +EEG = pop_leadfield(EEG, 'sourcemodel',fullfile(eeglabp,'plugins','dipfit','LORETA-Talairach-BAs.mat'), ... + 'sourcemodel2mni',[0 -24 -45 0 0 -1.5708 1000 1000 1000] ,'downsample',1); + +EEG = pop_roi_activity(EEG, 'leadfield',EEG.dipfit.sourcemodel,'model','LCMV','modelparams',{0.05},'atlas','Brain-Regions','nPCA',3); +EEG = pop_roi_connect(EEG, 'methods', {'MIM'}); + +%% Plot matrix with different parameters +% matrix without any filters +pop_roi_connectplot(EEG, 'measure', 'mim', 'plotcortex', 'off', 'plotmatrix', 'on'); + +% group by hemispheres +pop_roi_connectplot(EEG, 'measure', 'mim', 'plotcortex', 'off', 'plotmatrix', 'on', 'grouphemispheres', 'on'); + +% frequency band specified +pop_roi_connectplot(EEG, 'measure', 'mim', 'plotcortex', 'off', 'plotmatrix', 'on', 'freqrange', [4 8]'); + +% hemisphere specified +pop_roi_connectplot(EEG, 'measure', 'mim', 'plotcortex', 'off', 'plotmatrix', 'on', 'hemisphere', 'right'); + +% cortical region specified +pop_roi_connectplot(EEG, 'measure', 'mim', 'plotcortex', 'off', 'plotmatrix', 'on', 'region', 'occipital'); + + + + + +