help > Moving Contrast error - with updated spm_contrasts_gPPI.m
Showing 1-4 of 4 posts
Display:
Results per page:
Feb 9, 2018  05:02 AM | merlinger
Moving Contrast error - with updated spm_contrasts_gPPI.m
Hi All! 

Was using the gPPI toolbox with only a few issues (that have since been resolved), however, after running through most of my participants, I realised that at some point, some participants had this error (whilst others did not):

Valid Contrast
Valid Contrast
contrast image 1 : ...written con_0001.img
spm{T} image 1 : ...written spmT_0001.img

....
Moving Contrast Images
error moving contrast PPI_Neutral-vs-Rest

....

And this occurred with all my contrasts. I saw someone just recently had a similar issue (Dec15 2017 Nadine Gier) and that the spm_contrasts_gPPI.m was supposed to fix the error... However it simply added this:

Valid Contrast
Valid Contrast
Generate xCon
Generate xCon
Generate xCon
...
Generate Contrasts
contrast image 1 : ...written con_0001.img
spm{T} image 1 : ...written spmT_0001.img
...
Moving Contrast Images
error moving contrast PPI_Neutral-vs-Rest


Nothing was resolved, but simply "Generate xCon" was added to the output. 


Below is a sample participant who's output resulted in the above error. 
P.subject=['19531650']
P.directory=['/usr/local/fMRI_processed_data/MAY/FMRI_FACES_NONCONSCIOUS_ANALYSIS/gPPI_analysis/BP_MDD_HC_files/BP/19531650/000_data_archive/105_fMRI_gPPI_FACES-NONCONSCIOUS/GLM/'];
P.VOI=['/local/May/FMRI_FACES_CONSCIOUS_ANALYSIS/ROIs/L_Amyg/MNI_Amygdala_L_roi.nii'];
P.Region='LamygBP';
P.Estimate=1;
P.contrast=0;
P.extract='eig';
P.Tasks={'1' 'Neutral' 'Happy' 'Fear' 'Anger' 'Sad' 'Disgust'};
P.Weights=[];
P.analysis='psy';
P.method='cond';
P.CompContrasts=1;
P.Weighted=0;
P.Contrasts(1).left={'Neutral'};
P.Contrasts(1).right={'none'};
P.Contrasts(1).STAT='T';
P.Contrasts(1).Weighted=0;
P.Contrasts(1).MinEvents=5;
P.Contrasts(1).name='Neutral-vs-Rest';
P.Contrasts(2).left={'Happy'};
P.Contrasts(2).right={'none'};
P.Contrasts(2).STAT='T';
P.Contrasts(2).Weighted=0;
P.Contrasts(2).MinEvents=5;
P.Contrasts(2).name='Happy-vs-Rest';
P.Contrasts(3).left={'Fear'};
P.Contrasts(3).right={'none'};
P.Contrasts(3).STAT='T';
P.Contrasts(3).Weighted=0;
P.Contrasts(3).MinEvents=5;
P.Contrasts(3).name='Fear-vs-Rest';
P.Contrasts(4).left={'Anger'};
P.Contrasts(4).right={'none'};
P.Contrasts(4).STAT='T';
P.Contrasts(4).Weighted=0;
P.Contrasts(4).MinEvents=5;
P.Contrasts(4).name='Anger-vs-Rest';
P.Contrasts(5).left={'Sad'};
P.Contrasts(5).right={'none'};
P.Contrasts(5).STAT='T';
P.Contrasts(5).Weighted=0;
P.Contrasts(5).MinEvents=5;
P.Contrasts(5).name='Sad-vs-Rest';
P.Contrasts(6).left={'Disgust'};
P.Contrasts(6).right={'none'};
P.Contrasts(6).STAT='T';
P.Contrasts(6).Weighted=0;
P.Contrasts(6).MinEvents=5;
P.Contrasts(6).name='Disgust-vs-Rest';
P.Contrasts(7).left={'Anger' 'Disgust' 'Fear'};
P.Contrasts(7).right={'none'};
P.Contrasts(7).STAT='T';
P.Contrasts(7).Weighted=0;
P.Contrasts(7).MinEvents=5;
P.Contrasts(7).name='Threat-vs-Rest';
P.Contrasts(8).left={'Happy'};
P.Contrasts(8).right={'Neutral'};
P.Contrasts(8).STAT='T';
P.Contrasts(8).Weighted=0;
P.Contrasts(8).MinEvents=5;
P.Contrasts(8).name='Happy-vs-Neutral';
P.Contrasts(9).left={'Fear'};
P.Contrasts(9).right={'Neutral'};
P.Contrasts(9).STAT='T';
P.Contrasts(9).Weighted=0;
P.Contrasts(9).MinEvents=5;
P.Contrasts(9).name='Fear-vs-Neutral';
P.Contrasts(10).left={'Anger'};
P.Contrasts(10).right={'Neutral'};
P.Contrasts(10).STAT='T';
P.Contrasts(10).Weighted=0;
P.Contrasts(10).MinEvents=5;
P.Contrasts(10).name='Anger-vs-Neutral';
P.Contrasts(11).left={'Sad'};
P.Contrasts(11).right={'Neutral'};
P.Contrasts(11).STAT='T';
P.Contrasts(11).Weighted=0;
P.Contrasts(11).MinEvents=5;
P.Contrasts(11).name='Sad-vs-Neutral';
P.Contrasts(12).left={'Disgust'};
P.Contrasts(12).right={'Neutral'};
P.Contrasts(12).STAT='T';
P.Contrasts(12).Weighted=0;
P.Contrasts(12).MinEvents=5;
P.Contrasts(12).name='Disgust-vs-Neutral';
P.Contrasts(13).left={'Anger' 'Disgust' 'Fear'};
P.Contrasts(13).right={'Neutral'};
P.Contrasts(13).STAT='T';
P.Contrasts(13).Weighted=0;
P.Contrasts(13).MinEvents=5;
P.Contrasts(13).name='Threat-vs-Neutral';


Any ideas of how to resolve the issue?
Many thanks in advance!


Cheers,
May
Feb 9, 2018  02:02 PM | Donald McLaren
RE: Moving Contrast error - with updated spm_contrasts_gPPI.m
Hi May,

That's an odd one. I thought I fixed all of the bugs related to moving files.

Can you rename the attached file to: spm_contrasts_PPI.m and replace your current version. This won't fix the issue, but should help narrow down where there error is actually occurring in the code. The code was built with try/catch statements, which are good in getting the program to continue onto the next subject, but bad for troubleshooting.

Best,
Donald
Feb 12, 2018  12:02 AM | merlinger
RE: Moving Contrast error - with updated spm_contrasts_gPPI.m
Hi Donald!

Thanks for that! This is what it spits out with the updated contrast file:
...
Valid Contrast
Generate xCon
...
Generate Contrasts
contrast image 1 : ...written con_0001.img
spm{T} image 1 : ...written spmT_0001.img
...
Moving Contrast Images
error moving contrast when contrast already exists PPI_Neutral-vs-Rest
error moving spmT/F when contrast already exists PPI_Neutral-vs-Rest


These are contrasts written for a 'nonconscious-faces' tasks, where I similarly have a 'conscious-faces' task, however they are in separate folders and have undergone separate analyses in a different location, so I'm not sure how the gPPI script would be picking up that a PPI_Neutral-vs-Rest (etc..) contrast exists in a separate folder to the one I am running analyses for these participants. 

I've found if I change the name to "Neutral_vs_Rest" the gPPI analysis will run... however is there a way to run it where I can run a gPPI for two different tasks (that have the same contrast names) for the same person?
Many thanks for your help!
Mar 6, 2018  05:03 PM | Donald McLaren
RE: Moving Contrast error - with updated spm_contrasts_gPPI.m
I'm not sure how the names are getting crossed.

What is the contents of:
/usr/local/fMRI_processed_data/MAY/FMRI_FACES_NONCONSCIOUS_ANALYSIS/gPPI_analysis/BP_MDD_HC_files/BP/19531650/000_data_archive/105_fMRI_gPPI_FACES-NONCONSCIOUS/GLM/PPI_LamygBP?

Best,
Donald