Skip to content

Commit

Permalink
add LMM for effect of attention on activations, deactivations, crossm…
Browse files Browse the repository at this point in the history
…odal
  • Loading branch information
Remi-Gau committed Dec 11, 2019
1 parent f3b623b commit 53fb224
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 22 deletions.
37 changes: 31 additions & 6 deletions BOLDProfiles/make_figures_BOLD.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
% might not be necessarry for
DependenciesFolder = '/home/remi';

PlotDo = 0;
PlotDo = 1;

print_pvalue = 0;

Expand All @@ -36,7 +36,7 @@
% 4 - for cross modal effects for A1-PT
% 5 - for cross modal effects for V1-2-3
% 6 - for attention effects
clim_for_condition = 6;
clim_for_condition = 0;


%% define conditions to plot
Expand Down Expand Up @@ -67,6 +67,26 @@
Cdt2Choose(end).test_side = {'both' 'both' 'both' 'both'};


% extra results
% effect of attention on activation and deactivations
Cdt2Choose(6).name = '[A-fix]_{Att_A} - [A-fix]_{Att_V}';
Cdt2Choose(end).cdt = [1 4 0001 ];
Cdt2Choose(end).test_side = {'both' 'both' 'both' 'both'};

Cdt2Choose(7).name = '[V-fix]_{Att_A} - [V-fix]_{Att_V}';
Cdt2Choose(end).cdt = [2 5 0001 ];
Cdt2Choose(end).test_side = {'both' 'both' 'both' 'both'};

% effect of attention on crossmodal modulation
Cdt2Choose(8).name = '[AV - A]_{Att_A} - [AV - A]_{Att_V}';
Cdt2Choose(end).cdt = [1 4 3 6 0001];
Cdt2Choose(end).test_side = {'both' 'both' 'both' 'both'};

Cdt2Choose(9).name = '[AV - V]_{Att_A} - [AV - V]_{Att_V}';
Cdt2Choose(end).cdt = [2 5 3 6 0001];
Cdt2Choose(end).test_side = {'both' 'both' 'both' 'both'};


%% Figures parameters
Transparent = 1;
Switch = 1;
Expand Down Expand Up @@ -221,10 +241,15 @@

% in case we have to contrast between conditions
switch numel(stim)
case 2
case 4
Subj_Data = Subj_Data(:, :, 3:4) - Subj_Data(:, :, 1:2);
case 6
case 2 % activation and deactivation
case 3 % effect of attention on activation and deactivation
Subj_Data = Subj_Data(:, :, 1) - Subj_Data(:, :, 2);
case 4 % cross modal effect
Subj_Data = Subj_Data(:, :, 3:4) - Subj_Data(:, :, 1:2);
case 5 % effect of attention on cross modal effect
Subj_Data = (Subj_Data(:, :, 3) - Subj_Data(:, :, 1)) ...
- (Subj_Data(:, :, 4) - Subj_Data(:, :, 2)) ;
case 6 % attention effect
Subj_Data = Subj_Data(:, :, 4:6) - Subj_Data(:, :, 1:3);
end

Expand Down
12 changes: 11 additions & 1 deletion MVPA/make_figures_MVPA.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

DependenciesFolder = '/home/remi';

PlotDo = 0;
PlotDo = 1;

print_pvalue = 0;

Expand Down Expand Up @@ -46,6 +46,16 @@
Cdt2Choose(end).test_side = {'both' 'both' 'both' 'both'};
Cdt2Choose(end).filename = 'AAtt-vs-VAtt';

% extra results
% effect of attention on crossmodal modulation
Cdt2Choose(4).name = '[AV-A]_{att A} VS [AV-A]_{att V}';
Cdt2Choose(end).test_side = {'both' 'both' 'both' 'both'};
Cdt2Choose(end).filename = '[AV-A]_Att_A-vs-[AV-A]_Att_V';

Cdt2Choose(5).name = '[AV-V]_{att A} VS [AV-V]_{att V}';
Cdt2Choose(end).test_side = {'both' 'both' 'both' 'both'};
Cdt2Choose(end).filename = '[AV-V]_Att_A-vs-[AV-V]_Att_V';


%% Figures parameters
Transparent = 1;
Expand Down
61 changes: 47 additions & 14 deletions MVPA/save_decoding_profiles_all_sub.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,21 @@
'V1';...
'V2-3'};

Analysis(1) = struct('name', 'A Stim VS AV Stim');
Analysis(end+1) = struct('name', 'V Stim VS AV Stim');
Analysis(end+1) = struct('name', 'A Att VS V Att');
effect_att_on_crossmodal = 1;

if effect_att_on_crossmodal
Analysis(1) = struct('name', '[AV-A]_Att_A VS [AV-A]_Att_V');
Analysis(end+1) = struct('name', '[AV-V]_Att_A VS [AV-V]_Att_V');

else
Analysis(1) = struct('name', 'A Stim VS AV Stim');
Analysis(end+1) = struct('name', 'V Stim VS AV Stim');
Analysis(end+1) = struct('name', 'A Att VS V Att');
Analysis(end+1) = struct('name', 'A Stim(A Att VS V Att)');
Analysis(end+1) = struct('name', 'V Stim(A Att VS V Att)');

end


opt.acroslayer.do = 0;
opt.leave2out.do = 0;
Expand Down Expand Up @@ -64,7 +76,13 @@
end
end

SaveSufix = '_results_surf_FixedC';

if effect_att_on_crossmodal
SaveSufix = '_results_surf';
else
SaveSufix = '_results_surf_FixedC';
end

if opt.fs.do
SaveSufix = [SaveSufix '_FS']; %#ok<*AGROW>
end
Expand Down Expand Up @@ -96,7 +114,12 @@
SaveSufix = [SaveSufix '_SessMeanCent'];
end

SaveSufix = [SaveSufix '_FWHM_' FFX{1} '_Layers_' num2str(NbLayersMVPA+2) '.mat'];

if effect_att_on_crossmodal
SaveSufix = [SaveSufix '_FWHM_' FFX{1} '.mat'];
else
SaveSufix = [SaveSufix '_FWHM_' FFX{1} '_Layers_' num2str(NbLayersMVPA+2) '.mat'];
end


%% Get Data for MVPA
Expand All @@ -116,18 +139,28 @@
'_ROI_' ROIs{iROI} SaveSufix];

load(fullfile(DataFolder, 'Subjects_Data', ['Subject_' SubjID],...
'Transfer', 'SVM', Save_vol));
'Results', 'SVC', Save_vol));

CV = Results.session(end).rand.perm.CV;

for iLayer= 2:NbLayersMVPA+1
if effect_att_on_crossmodal
Layers2pick = 1:NbLayersMVPA;
else
Layers2pick = 2:NbLayersMVPA+1;
end

for iLayer= Layers2pick
Label = [];
Pred = [];
for iCV=1:numel(CV)
Label(:,end+1) = CV(iCV).layers.results{1}{iLayer}.label;
Pred(:,end+1) = CV(iCV).layers.results{1}{iLayer}.pred(:,iLayer);
end
Acc(iLayer-1,:) = mean(Pred==Label,2)';
if effect_att_on_crossmodal
Acc(iLayer,:) = mean(Pred==Label,2)';
else
Acc(iLayer-1,:) = mean(Pred==Label,2)';
end
end

AllSubjects_Data(iROI,iSVM).DATA = cat(1, ...
Expand Down Expand Up @@ -164,11 +197,11 @@
% creates a label for each row
NbBlocks = size(Data,1) / (NbSubject);
suffix = repmat('_CV', [size(Data,1), 1]);
% tmp = repmat(1:NbRuns, [NbBlocks,1]);
% suffix = [suffix num2str(tmp(:))];
% suffix = [suffix repmat('_block-', [NbRuns*NbBlocks,1])];
% tmp = repmat((1:NbBlocks)', [NbRuns,1]);
% suffix = [suffix num2str(tmp)];
% tmp = repmat(1:NbRuns, [NbBlocks,1]);
% suffix = [suffix num2str(tmp(:))];
% suffix = [suffix repmat('_block-', [NbRuns*NbBlocks,1])];
% tmp = repmat((1:NbBlocks)', [NbRuns,1]);
% suffix = [suffix num2str(tmp)];
clear tmp

prefix = repmat(cellstr(SubjectList)',[NbBlocks, 1]);
Expand All @@ -178,7 +211,7 @@
labels = [prefix suffix];
clear prefix suffix


% save to .mat
save(fullfile(Results_Folder, [FileName '.mat']), ...
'Data', 'labels')
Expand Down
2 changes: 1 addition & 1 deletion display_lmm_results.m
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ function display_lmm_results(DO)
%% print out results
ToPermute = list_permutation();

for i_model = model_of_interest %1:numel(models)
for i_model = 1:numel(models) % model_of_interest %

model = models(i_model);

Expand Down

0 comments on commit 53fb224

Please sign in to comment.