Dear Suzanne,
is your original file a 4D-NIfTI? Then, your V will be a struct array with one entry per 3D frame. Using spm_write_vol, you will have to loop over the 3D frames to write a new file. You should use spm_fileparts to deconstruct the filenames, as it preserves frame information. You can create a 4D hdr/img dataset by just changing the extension of the filename to .img, leaving the 4th part containing frame numbers untouched.
Hope this helps
Volkmar
|