Hello Yang Xu,
I appreciate you providing some suggested instructions to follow.
I went through the wiki tutorial and pasted the .m code to a matlab script for processing through all my participant data… below:
clear
subjects = [1:14, 16:19, 21:30, 32:43];
train1_scan2=2;
event1_block2=1;
%generate folder and model file strings
session = ‘ses-02’;
%main directory
mri_fldr = uigetdir(,‘Select folder containing smoothed data’);
cd(mri_fldr)
for s=1:length(subjects)
matlabbatch{1}.spm.stats.con.spmmat = {['/Users/jojomartis/Documents/PPI Study/effector_specificity/smooth/sub-'...
sprintf('%2.2d', subjects(s)) filesep session filesep '1st-level_event_mc' filesep 'SPM.mat']};
matlabbatch{1}.spm.util.voi.adjust = 7;
matlabbatch{1}.spm.util.voi.session = 1;
matlabbatch{1}.spm.util.voi.name = 'voi_ips';
matlabbatch{1}.spm.util.voi.roi{1}.spm.spmmat = {[mri_fldr filesep sprintf('sub-%2.2d', subjects(s)) filesep session filesep '1st-level_event_mc' filesep 'SPM.mat']};
matlabbatch{1}.spm.util.voi.roi{1}.spm.contrast = 4;
matlabbatch{1}.spm.util.voi.roi{1}.spm.conjunction = 1;
matlabbatch{1}.spm.util.voi.roi{1}.spm.threshdesc = 'none';
matlabbatch{1}.spm.util.voi.roi{1}.spm.thresh = 0.001;
matlabbatch{1}.spm.util.voi.roi{1}.spm.extent = 0;
matlabbatch{1}.spm.util.voi.roi{1}.spm.mask = struct('contrast', {}, 'thresh', {}, 'mtype', {});
matlabbatch{1}.spm.util.voi.roi{2}.sphere.centre = [-32 -64 52];
matlabbatch{1}.spm.util.voi.roi{2}.sphere.radius = 10;
matlabbatch{1}.spm.util.voi.roi{2}.sphere.move.fixed = 1;
matlabbatch{1}.spm.util.voi.roi{3}.sphere.centre = [0 0 0];
matlabbatch{1}.spm.util.voi.roi{3}.sphere.radius = 6;
matlabbatch{1}.spm.util.voi.roi{3}.sphere.move.global.spm = 1;
matlabbatch{1}.spm.util.voi.roi{3}.sphere.move.global.mask = 'i2';
matlabbatch{1}.spm.util.voi.expression = 'i1 & i3';
%% run the jobs
spm('defaults', 'FMRI');
spm_jobman('run', matlabbatch);
end
though i think there may be an issue with my set path becasue the command window says the spm file is not names?
Contrasts folder : ./ses-02/1st-level_event_mc
Completed : 08:15:53 - 06/11/2023
06-Nov-2023 08:15:53 - Done ‘Contrast Manager’
06-Nov-2023 08:15:53 - Done
Item spm: No field(s) named
util
Also, when running this batch on a single subject, I see .nii files being created but not .mat for the time series extraction needed for PPI analysis.
Do you have any suggestions on why this may be the case?
Also, you referred to gPPI toolbox, is this a separate function then the PPI button on the initial SPM GUI? If it’s an additional installation, can you please share where I can find this?
Thank you.