help > RE: Contrasts in gPPI for .nii files
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

Threaded View

TitleAuthorDate
Marek Wypych Dec 12, 2016
Donald McLaren Apr 13, 2017
Yangyang Zhang May 26, 2017
RE: Contrasts in gPPI for .nii files
Katherine McCurry Jun 19, 2017
Donald McLaren Jul 3, 2017
Thomas Stephan Jul 27, 2018
Andrew Gerlach Jan 5, 2023