An automated toolbox for doing PPI is now available at: http://martinos.org/~mclaren/ftp/Utilities_DGM/PPPI/ createVec.m and defContrasts.m are also required and can be found at: http://martinos.org/~mclaren/ftp/Utilities_DGM/ An example wrapper (looping through subjects and regions) and example input structure (P) can be found at: http://martinos.org/~mclaren/ftp/Utilities_DGM/example_structure_inputs/ The automated toolbox can do the following: (a1) produce identical results to the current implementation in SPM (a2) use the current implementation of PPI in SPM but using the regional mean instead of the eigenvariate (a3) uses a generalized form that allows a PPI for each task to be in the same model using either the regional mean of eigenvariate (b) creates the model using the output of one of the (a) options and the first level design (c) estimates the model (/results directory) (d) computes the contrasts specified To use the toolbox, you will need to change the following things in the wrapper and input structure: In the wrapper ppi_wrapper.m (in example_structure_inputs): Change the following lines: addpath('PPPIdirectory') --> replace PPPIdirectory with the location of the PPPI directory that was downloaded addpath('spm8directory') --> replace spm8directory with the location of spm8 (can be found by typing which spm) Subjects={'subject1' 'subject2'}; --> put your subjects in '' inside the {}. regionfile={'region1.nii'... 'region2.nii'}; --> these are the VOIs files (.nii, .img, .mat) with full paths to use for PPI, they are added to the input structure file by the wrapper. region={'region1'... 'region2'};--> these are the VOIs names, they are added to the input structure file by the wrapper. load('ppi_master_template.mat'); --> change if your calling the master template something else. save(['directory' region{regionnumber} '.mat'],'P'); --> change directory to a location to save the inputstructure that has the region and VOI information added to it. Directory=['subjectdirectory']; --> change to location of 1st level statistics. Can include variables (e.g. ['/Data/' Subjects{i} '/model/']) load(['directory' region{regionnumber} '.mat']); --> should match the save statement above. save([Subjects{i} '_analysis_' region{regionnumber} '.mat'],'P'); PPPI([Subjects{i} '_analysis_' region{regionnumber} '.mat']); --> analysis should be changed to something more identifiable (e.g. workingmemory_myname) Now your set to run the wrapper. However, you need to modify the master_template first for the options that you want to use. You should also change the name in case others are also using it. In the case that you change the name, it must also be changed in the wrapper above. In the input structure fields of the template.mat file (in example_structure_inputs): These are set by the wrapper: subject: the subject number, can also be the second argument of PPPI (set in wrapper) directory: either the first-level SPM.mat directory, or if you are only estimating a PPI model, then the first-level PPI directory (set in wrapper) VOI: name of VOI file ('.nii', '.img', '.mat'). If you use a .mat file, it should be 3 columns containing the ijk voxel indices OR be a VOI.mat file from SPM. (set in wrapper) Region: name of output file(s), reqires two names for analysis (set in wrapper) with two VOI, regions should be separated by a space inside the ' '. Output directory will be Region. (if 2 regions, then the two regions will be separated by a _ in the directory name. (set in wrapper) These should be set ahead of time. contrast: contrast to adjust for. Adjustments remove the effect of the null space of the contrast. Set to 0 for no adjustment. Set to a number, if you know the contrast number. Set to a contrast name, if you know the name. The default is: 'Omnibus F-test for PPI Analyses'. If not set, reverts to default setting. analysis: specifies psychophysiological interaction ('psy'); physiophysiological interaction ('phys'); or psychophysiophysiological interactions ('psyphy'). extract: specifies the method of ROI extraction, eigenvariate ('eig') or mean ('mean') method: specifies traditional SPM PPI ('trad') or generalized condition-specific PPI ('cond'). 'trad' is identical to SPMs current implementation. equalroi: specifies the ROIs must be the same size in all subjects NOTE: default=1 (true); set to 0 to lift the restriction. NOTE: that if your VOI is outside of the 1L mask, it will return an error message FLmask: specifies that the ROI should be restricted using the mask.img from the 1L statistics. NOTE: default=0. FLmask=1 does nothing if equalroi=1. VOI2: name of 2nd VOI for physiophysiological interactions Weights: for traditional PPI, you must specify weight vector for each task. Order needs to be the same as Tasks below. Tasks: In the generalized condition-specific PPI, you should specify the tasks to include in the analyses, but put a 0 or 1 in front of them to specify if they must exist in all sessions. NOTE: In traditional PPI, specify the tasks that go with the weights. Estimate: specifies whether or not to estimate the PPI design. 1 means to estimate the design, 2 means to estimate the design from already created regressors (must be of the OUT structure), 0 means not to estimate. Default is set to 1, so it will estimate. CompContrasts: 0 not to estimate any contrasts; 1 to estimate contrasts; 2 to only use PPI txt file for 1st level (not recommended); 3 to only use PPI txt file for 1st level and estimate contrasts (not recommended); 2&3 are not recommended as they potentially do not include all tasks effects in the mode. Use at your own risk. 3 can not weight the contrasts based on the number of trials. Default is 0. Contrasts: cell array of tasks to create contrasts to evaluate OR it is a structure with the following fields: % left: tasks on left side of equation or 'none' % right: tasks on right side of equation or 'none' % Weighted: from Weighted below, default is 0; automatically set from Weighted % STAT: 'T' or 'F' % c: contrast vector from createVec, automatically generated % name: name of contrast, will be defined if left blank % Prefix: prefix to the task name (optional), can be used to select each run % Contrail: suffix after task name (e.g. parametric modulators, different basis function) **If left blank and CompContrasts=1, then it defines all possible T contrasts for task components and across runs. Weighted: Default is not to weight tasks by number of trials (0); to change this, specify which tasks should be weighted by trials. If you want to weight trials, then specify a duration longer than your events. If you have a mixed block event related design, then you can average your events based on number of trials and the blocks won't be averaged IF Weighted is set to be a number that is shorter than the block duration and longer than your events. SPMver: SPM version used to create SPM.mat files at the first level. maskdir: location to save seeds if VOI was a .mat file ** To set a field, type: load template_master.mat P.fieldname=value save template_master.mat P Please let me know if you run into any errors or have any questions. Additionally, a paper describing the method should be available soon. Best Regards, Donald McLaren ================= D.G. McLaren, Ph.D. Postdoctoral Research Fellow, GRECC, Bedford VA Research Fellow, Department of Neurology, Massachusetts General Hospital and Harvard Medical School Office: (773) 406-2464 ===================== This e-mail contains CONFIDENTIAL INFORMATION which may contain PROTECTED HEALTHCARE INFORMATION and may also be LEGALLY PRIVILEGED and which is intended only for the use of the individual or entity named above. If the reader of the e-mail is not the intended recipient or the employee or agent responsible for delivering it to the intended recipient, you are hereby notified that you are in possession of confidential and privileged information. Any unauthorized use, disclosure, copying or the taking of any action in reliance on the contents of this information is strictly prohibited and may be unlawful. If you have received this e-mail unintentionally, please immediately notify the sender via telephone at (773) 406-2464 or email.