Skip to content

Commit

Permalink
add new test file
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyen-td committed Jan 31, 2023
1 parent ae92bbe commit 1854f90
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions test_pipes/test_matrixplots_brainregions.m
Original file line number Diff line number Diff line change
@@ -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');






0 comments on commit 1854f90

Please sign in to comment.