help > Constrasts in gPPI saved as .img with no .hdr
Showing 1-7 of 7 posts
Display:
Results per page:
Dec 12, 2016  01:12 PM | Marek Wypych - Laboratory of Brain Imaging, Nencki Institute of Experimental Biology
Constrasts in gPPI saved as .img with no .hdr
I have found an interesting issue while using gPPI in SPM12 (v6225).
I've definded the new (gPPI) model, which seems to be ok.
I have also defined contrasts, which also look reasonable in SPM, but the files are like:
con_PPI_Neutral_minus_Punishment_gppi_GNG03.img and con_PPI_Punishment_minus_Neutral_gppi_GNG03.img (where Neutral and Punishment are my conditions and GNG03 is a subject's code),
However there are no .hdr files, and SPM is unable to calculate second level.
Surprisingly, when I rerun the gPPI script, new additional contrast are generated (con_0003.nii and con_0004.nii, which looks also reasonable - so I am going to use them for second level).
Maybe even more surprisngly, when I rerun the script again and again, new contrast are being added, and every second time it is .img (whith descriptive name and no .hdr), and every other second time this are typical con_00XX.nii files.
I hope to deal with it for now with additional con*.nii files, but would be grateful for a hint if and how I could get con*.nii files without need to rerun the script.
Best regards
Marek

edit:
I've just noticed, that while estimating the model and contrasts an error ocurs:
Valid Contrast
Valid Contrast
contrast image 1 : ...written con_0001.nii
spm{T} image 1 : ...written spmT_0001.nii
contrast image 2 : ...written con_0002.nii
spm{T} image 2 : ...written spmT_0002.nii
Moving Contrast Images
error moving contrast PPI_Punishment_minus_Neutral
error moving contrast PPI_Punishment_minus_Neutral
Moving Contrast Images
error moving contrast PPI_Neutral_minus_Punishment
error moving contrast PPI_Neutral_minus_Punishment
Apr 13, 2017  01:04 AM | Donald McLaren
RE: Constrasts in gPPI saved as .img with no .hdr
Has this issue been solved? If you are still having issues, I can work on a solution.

-Donald
May 26, 2017  09:05 AM | Yangyang Zhang
RE: Constrasts in gPPI saved as .img with no .hdr
I also got such a error:

Valid Contrast
Valid Contrast
contrast image 1 : ...written con_0001.nii
spm{T} image 1 : ...written spmT_0001.nii
contrast image 2 : ...written con_0002.nii
spm{T} image 2 : ...written spmT_0002.nii
Moving Contrast Images
error moving contrast PPI_PPI_contrast1
error moving contrast PPI_PPI_contrast1
Moving Contrast Images
error moving contrast PPI_PPI_contrast2
error moving contrast PPI_PPI_contrast2

Would you have some ideas?

Yangyang Zhang
Jun 19, 2017  08:06 PM | Katherine McCurry
RE: Contrasts in gPPI for .nii files
I had a similar error when using gPPI in spm12. This likely is not the most efficient fix, but as a workaround, I made provisional edits to my copy of spm_contrasts_PPI.m in order to handle .nii files.

In particular, for the move contrast images section (loop starts at line 176), inside of the loop, I added in the following if statement [if strcmp(SPM.xCon(ii).Vcon.fname(end-2:end),'img')] and then before the final end of the loop, added an elseif statement for "nii"[elseif strcmp(SPM.xCon(ii).Vcon.fname(end-2:end),'nii')]. Then I copied the content of the loop, pasted below the elseif statement, and modified it for nii files (i.e., deleted .hdr lines and changed .img to .nii).

With those edits, it worked ok for me. Script attached in case it is helpful-- but no promises that my edits were error-free; double-checking is recommended. 

Best,
Katie
Attachment: spm_contrasts_PPI.m
Jul 3, 2017  02:07 AM | Donald McLaren
RE: Contrasts in gPPI for .nii files
Try the attached version of spm_contrasts_ppi.m
Attachment: spm_contrasts_PPI.m
Jul 27, 2018  03:07 PM | Thomas Stephan - LMU Muenchen
RE: Contrasts in gPPI for .nii files
Had the same issue, this solution worked for me.

Is there an updated package of the toolbox that includes this fix, as well as others that can be found in this forum?

Many thanks for the software and the help,
Thomas
Jan 5, 2023  02:01 PM | Andrew Gerlach - University of Pittsburgh
RE: Contrasts in gPPI for .nii files
I also ran into this issue while using runOnSampleData and replacing the spm_contrasts_PPI.m file with the one above worked.