function con_image = spm_bms_compare_groups(BMSfiles,name,contrast) % Compare BMS maps for different groups % FORMAT spm_bms_compare_groups() % % Input (interactive): % BMS - BMS.mat files for the two groups to compare % contrast (name) - name of contrast image that will be save in the current % directory % contrast (comp) - comparison between groups. options: 'A>B' (posterior % probability for group 1 > posterior group 2) % or 'AB|AB';'AB' ind = [1 2]; case 'A 0 % Initialise results con_total = NaN(1,Nvoxels); % Do BMS in all voxels of slice z for n = 1:Nvoxels, alpha1 = alpha(1,:,non_nan(n)); alpha2 = alpha(2,:,non_nan(n)); xp = spm_beta_compare(alpha1,alpha2); con_total(1,n) = xp; % Cond. Expecta. end % Write images j(non_nan) = con_total(1,:); con_image = spm_write_plane(con_image,j,z); else % Write images when Nvoxels = 0 con_image = spm_write_plane(con_image,j,z); end end % Loop over slices %-Clear progress bar %-------------------------------------------------------------------------- spm_progress_bar('Clear'); % Output: path to new file con_image = con_image.fname;