Print

Print


hi,

use the following:

Y = spm_vol(filename);
data = spm_read_vols(Y);

where filename is a string containing the 4D fMRI (.nii o .img) file name. The output (as a matrix) will be stored in the variable "data"

Bw,

Enzo

On Tue, May 29, 2012 at 8:40 PM, David Romano <[log in to unmask]> wrote:
I'm a mathematician who has no previous experience with SPM, or imaging, for that matter, and have what I'm sure is a very basic question:

I would like to capture the data associated to an .img file in a matrix that I can then manipulate with MATLAB, but have not been able to find anything in the SPM8 manual that might allow me to do this.  I did find that the Image Calculator *can* produce a data matrix with dimensions (image planes)x(voxels per plane), but I'm not sure about two things:  1) I can't find whether or how this data matrix can be saved as a separate file, and 2) if the .img files are whole brain images, I can't find how one specifies the plane of interest (in my case, all).  

If anyone could point me in right direction to finding answers to these questions, I'd be very grateful.

Thank you,
David Romano