Hi Remi,
I'm not sure I've completely understood your question, but a 3D volume
can be loaded with e.g:
img = spm_read_vols(spm_vol('filename.nii'));
and img will then be a 3D Matlab array. img(1,1,1) will be the first
voxel. Matlab arrays are indexed in the order row, column, plane; that
is, the first index runs down the first column ("column-major
ordering"). If you want a 1D vector,
vec = img(:)
will stack the voxels into vec in the order they are indexed, so you
will get the first column, then the second, ... then the first of the
next plane, ..., last column of last plane. I hope that makes sense!
Best,
Ged.
Remi Vieux wrote:
> Dear SPMers,
>
> When you load an volume image into memory (for example an Analyze
> image), is it load in an array using MatLab's memory management style,
> that is to say the following matrix [1 2 ; 3 4] would be stored in a 1D
> array looking like [1 3 4 5], or is it stored line by line, the 1D array
> beeing [1 2 3 4] then...?
>
> Regards,
> Remi.
>
|