Hi,
I have nifti files in .hdr/.img file format. I am trying to convert them to .nii format. I tried using the following Matlab/SPM commands I found in a previous thread from 2011:
> V=spm_vol('filename.img');
> ima=spm_read_vols(V);
> V.fname='filename.nii';
> spm_write_vol(V,ima);
When I get to the V.fname step, I get the following error in Matlab:
'Scalar structure required for this assignment.'
If I run these commands in SPM8, I do not get the scalar structure error, however, I get a slew of Matlab/SPM8 compatibility errors (missing libraries, mex files, etc.) when I go to write out the volume.
Does anyone have any updated code for SPM12 and newer versions of Matlab? I am running the latest version of SPM12 on Matlab 2017a.
Thanks in advance,
suzanne
|