Skip to content

Commit

Permalink
added calculation of contrast maps for single categories that do not …
Browse files Browse the repository at this point in the history
…include the second category of the same domain
  • Loading branch information
Marisa Nordt committed May 9, 2019
1 parent 1ce8a83 commit c096b4e
Showing 1 changed file with 32 additions and 2 deletions.
34 changes: 32 additions & 2 deletions functions/fLocAnalysis.m
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,12 @@
mkdir Inplane/GLMs/NiftiMaps

hi = initHiddenInplane('GLMs', 1);
% if there are 10 conditions, contrast 1&2 vs. all others, 3&4 vs. all
% others, and so on
% if there are 10 conditions, contrast ...
% - 1&2 vs. all others, 3&4 vs. all others, and so on
% - 1 vs. all not 2, 2 vs. all not 1, 3 vs. all not 4, and so on
if length(cond_num_list) == 10
for cc = 1:2:length(cond_num_list)
% Contrasting domain vs. all other domains
active_conds = [cc cc + 1];
control_conds = setdiff(cond_num_list, active_conds);
contrast_name = [strcat(cond_list{cc:cc + 1}) '_vs_all'];
Expand All @@ -268,6 +270,34 @@
cd Inplane/GLMs/NiftiMaps
writeFileNifti(contrastNifti);
cd ../../..

% Contrasting category vs. all other categories not in domain
domain_conds = [cc cc + 1];
j = 1;
for i = 0:1
active_conds = cc + i;
control_conds = setdiff(cond_num_list, domain_conds);
contrast_name = [strcat(cond_list{cc + i}) '_vs_all_except_' ...
strcat(cond_list{cc + j})];
hi = computeContrastMap2(hi,active_conds,control_conds,...
contrast_name,'mapUnits','T');
% Storing contrast map as nifti
niftiFileName = [contrast_name,'.nii.gz'];
hi = computeContrastMap2(hi, active_conds, control_conds, ...
contrast_name, 'mapUnits','T');
% storing contrast map as nifti
niftiFileName = [contrast_name,'.nii.gz'];
contrastNifti = contrastMap2Nii(hi.map{1},niftiFileName,...
functionalNifti);
% saving nifti under Inplane/GLMs/NiftiMaps
cd Inplane/GLMs/NiftiMaps
writeFileNifti(contrastNifti);
cd ../../..

% move to next condition
j = j - 1;
end

end
end
% for any number of conditions, contrast each individual condition with all
Expand Down

0 comments on commit c096b4e

Please sign in to comment.