THANK YOU FOR YOUR QUICK RESPONSE
Parametric modulators should be fine. Were the PMs created in SPM?
----Correct, the PMs were created in SPM
What does your config file look like?
----See below
Does gPPI create a design matrix for PPI?
----It does not create a design matrix before the error, only the specified ROI mask for each subject.
What was the rest of the screen output before you get the Estimation Failed?
----Here is a quick print out of the rest of the screen:-------
"VOI has 41 voxels in 3.800000e+000x3.800000e+000x3.800000e+000 space
VOI has 81 voxels in 3x3x3 space. This is in the the same space as the input data and functional mask.
Warning: Matrix is close to singular or badly scaled.
Results may be inaccurate. RCOND = 1.266417e-020.
> In spm_PEB>spm_inv at 371
In spm_PEB at 244
In PPPI at 684
In gPPI_MORF at 129
In gPPI_batch_MORF at 23
Estimation Failed
Warning: Missing conditions!!! Invalid Contrast
Invalid Contrast
PPI Contrasts were not estimated for some reason.
ans =
xY: [1x1 struct]
nscan: [86 86 86 86]
xBF: [1x1 struct]
Sess: [1x4 struct]
xGX: [1x1 struct]
xX: [1x1 struct]
xVi: [1x1 struct]
SPMid: 'SPM8: spm_spm (v3468)'
xM: [1x1 struct]
xsDes: [1x1 struct]
swd: 'S:\nad12\MORF\Analysis_ret\Relatedness_hrf\21y2108'
xVol: [1x1 struct]
Vbeta: [1x64 struct]
VResMS: [1x1 struct]
VM: [1x1 struct]
xCon: [1x82 struct]
CONFIG FILE?:
function [] = gPPI_MORF(subject,VOI_name,PeakXYZ,VOI_size,gPPI_dir,Analysis_dir)
%% Create a VOI mask
% Go to this subjects gPPI directory. If the mask exists, move on. If the
% masks does not exist, create it.
cd([gPPI_dir filesep subject]) % Change present working directory to this subjects gPPI dir
if exist([gPPI_dir filesep subject filesep VOI_name '_mask.nii'], 'file') % if there is already a VOI image for this person, move on
else % if not...
create_sphere_image('SPM.mat',PeakXYZ,{VOI_name},VOI_size) % create sphere around seed and save it in this subjects gPPI dir
end
%% Load first level univariate parameters and remove 'Run#_' from the beginning of regressor names
% -Note, this section of code permantely changes the SPM.mat file parameters
% -The regressors will not longer have 'Run#_' appended to the front of
% their name
% -For example: "Run1_Rem_Rel" becomes "Rem_Rel". If run a second time,
% "Rem_Rel" becomes "el"
% Note, I added an if statement below to avoid the deletion issue which
% occurs when you run this script more then once
first_level_dir = [Analysis_dir filesep subject]; % path to subjects GLM analysis dir
cd(first_level_dir) % go to the this subject's first level directory
load SPM.mat % load this subject's SPM parameters
for k = 1:length(SPM.Sess) % for each Sessions...
for u = 1:length(SPM.Sess(k).U) % for each Trial Type in Session k...
if strcmp(SPM.Sess(k).U(u).name{1}(1:2),'Ru') % if this regressor has "Run" as the first 3 characters...
SPM.Sess(k).U(u).name{1} = SPM.Sess(k).U(u).name{1}(6:end); % Remove the first 5 characters of the regressor's name
disp(SPM.Sess(k).U(u).name{1}) % display the changes regressor name in the MATLAB Command Window
else
end
end
end
save('SPM.mat','SPM') % save the SPM parameters loaded above to a file called "SPM.mat" in this subject's first level analysis directory.
% note this overwrites the SPM.mat file which already
% exists
%% Setting the gPPI Parameters
%%% For more details on the parameters below and what they mean, go to the
%%% gPPI website and download the guide: http://www.nitrc.org/projects/gppi
P.subject= subject; % A string with the subjects id
P.directory= first_level_dir; % path to the first level GLM directory
P.VOI=[gPPI_dir filesep subject filesep VOI_name '_mask.nii']; % path to the ROI image, created above
P.Region = VOI_name; % string, basename of output folder
P.Estimate=1; % Yes, estimate this gPPI model
P.contrast=0; % contrast to adjust for. Default is zero for no adjustment
P.extract='eig'; % method for ROI extraction. Default is eigenvariate
P.Tasks=['0' {'HiHit','LoHit','AllMiss','AllFA', 'AllFAxrelatedness^1','HiCR','HiCRxrelatedness^1', 'LoCR', 'LoCRAxrelatedness^1'}]; % Specify the tasks for this analysis. Think of these as trial types. Zero means "does not have to occur in every session"
%P.Tasks=['0' {'AllHits', 'AllMisses', 'FM1', 'FM2', 'FM3', 'FM4', 'CR1', 'CR2', 'CR3' ,'CR4'}];
P.Weights=[]; % Weights for each task. If you want to weight one more than another. Default is not to weight when left blank
P.maskdir = [gPPI_dir filesep subject]; % Where should we save the masks?
P.equalroi = 0; % When 1, All ROI's must be of equal size. When 0, all ROIs do not have to be of equal size
P.FLmask = 1; % restrict the ROI's by the first level mask. This is useful when ROI is close to the edge of the brain
P.VOI2={}; % specifiy a second ROI. Only used for "physiophysiological interaction"
P.analysis='psy'; % for "psychophysiological interaction"
P.method='cond'; % "cond" for gPPI and "trad" for traditional PPI
P.CompContrasts=1; % 1 to estimate contrasts
P.Weighted=0; % Weight tasks by number of trials. Default is 0 for do not weight
P.outdir = [gPPI_dir filesep subject]; % Output directory
P.ConcatR=1; % Tells gPPI toolbox to concatenate runs
% P.Contrasts(1).left={'FM1' 'FM2' 'FM3' 'FM4'}; % left side or positive side of contrast
% P.Contrasts(1).right={}; % right side or negative side of contrast
% P.Contrasts(1).STAT='T'; % T contrast
% P.Contrasts(1).Weighted=0; % Wieghting contrasts by trials
% P.Contrasts(1).MinEvents=1; % min number of event need to compute this contrast
% P.Contrasts(1).name='AllFA_vs_Baseline'; % Name of this contrast
P.Contrasts(1).left={'AllFA'}; % left side or positive side of contrast
P.Contrasts(1).right={'LoCR'}; % right side or negative side of contrast
P.Contrasts(1).STAT='T'; % T contrast
P.Contrasts(1).Weighted=0; % Wieghting contrasts by trials
P.Contrasts(1).MinEvents=1; % min number of event need to compute this contrast
P.Contrasts(1).name='AllFA_vs_LoCR'; % Name of this contrast
% P.Contrasts(2).left={'AllFA'}; % left side or positive side of contrast
% P.Contrasts(2).right={'LoCR' 'HiCR'}; % right side or negative side of contrast
% P.Contrasts(2).STAT='T'; % T contrast
% P.Contrasts(2).Weighted=0; % Wieghting contrasts by trials
% P.Contrasts(2).MinEvents=1; % min number of event need to compute this contrast
% P.Contrasts(2).name='AllFA_vs_AllCR'; % Name of this contrast
%
% P.Contrasts(3).left={'AllFA'}; % left side or positive side of contrast
% P.Contrasts(3).right={'HiHit'}; % right side or negative side of contrast
% P.Contrasts(3).STAT='T'; % T contrast
% P.Contrasts(3).Weighted=0; % Wieghting contrasts by trials
% P.Contrasts(3).MinEvents=1; % min number of event need to compute this contrast
% P.Contrasts(3).name='AllFA_vs_HiHit'; % Name of this contrast
%
% P.Contrasts(4).left={'AllFA'}; % left side or positive side of contrast
% P.Contrasts(4).right={'HiHit' 'LoHit'}; % right side or negative side of contrast
% P.Contrasts(4).STAT='T'; % T contrast
% P.Contrasts(4).Weighted=0; % Wieghting contrasts by trials
% P.Contrasts(4).MinEvents=1; % min number of event need to compute this contrast
% P.Contrasts(4).name='AllFA_vs_AllHit'; % Name of this contrast
%
% P.Contrasts(5).left={'AllFA'}; % left side or positive side of contrast
% P.Contrasts(5).right={'none'}; % right side or negative side of contrast
% P.Contrasts(5).STAT='T'; % T contrast
% P.Contrasts(5).Weighted=0; % Wieghting contrasts by trials
% P.Contrasts(5).MinEvents=1; % min number of event need to compute this contrast
% P.Contrasts(5).name='AllFA'; % Name of this contrast
%
% P.Contrasts(6).left={'LoCR' 'HiCR'}; % left side or positive side of contrast
% P.Contrasts(6).right={'none'}; % right side or negative side of contrast
% P.Contrasts(6).STAT='T'; % T contrast
% P.Contrasts(6).Weighted=0; % Wieghting contrasts by trials
% P.Contrasts(6).MinEvents=1; % min number of event need to compute this contrast
% P.Contrasts(6).name='AllCR'; % Name of this contrast
%
% P.Contrasts(7).left={'HiHit' 'LoHit'}; % left side or positive side of contrast
% P.Contrasts(7).right={'none'}; % right side or negative side of contrast
% P.Contrasts(7).STAT='T'; % T contrast
% P.Contrasts(7).Weighted=0; % Wieghting contrasts by trials
% P.Contrasts(7).MinEvents=1; % min number of event need to compute this contrast
% P.Contrasts(7).name='AllHit'; % Name of this contrast
%% Below are parameters for gPPI. All set to zero for do not use. See website
%% for more details on what they do.
P.ConcatR=1;
P.FSFAST=0;
P.peerservevarcorr=0;
P.wb=0;
P.zipfiles=0;
P.rWLS=0;
%% Actually Run PPI
PPPI(P)
|