Hi Amir,
> I am facing a problem while I am trying to use spm_slice_vol. For a simple
> test, I use the T1.mnc template data and first I manually apply a
> transformation to it usin the SPM gui. I also use spm_slice_vol to get the
> reslice image of the same volume using the same transformation matrix. As
> it says in the spm_slice_vol.m, "spm_slice_vol returns a section through a
> memory mapped image volume on disk. This section is the transverse slice
> at z = 0 after linear transformation according to matrix A". So I think
> the slice image displayed in SPM's gui (axial view) after applying
> transformation should look the same as the reslice image I get using
> spm_slice_vol.
I think you're confusing two different things. Reorienting using the
GUI changes the voxel-world mapping of the image, so e.g. if you are
displaying the z=0(mm) plane, then you can reorient where this plane
cuts the volume, though it's not commonly used for visualisation like
this -- reorienting is usually done to manually bring images into
rough alignment (and hence is applied, by clicking reorient, rather
than just changing the fields).
spm_slice_vol just uses an affine matrix as a way of allowing you to
retrieve a slice of data at any orientation and location. You get the
z=0(voxels) slice after voxelwise affine transformation, so e.g.
s1 = spm_slice_vol(V, spm_matrix([0 0 50]), [91 109], 0);
gets the same slice as using:
img = spm_read_vols(V); s2 = img(:, :, 50);
Personally I find spm_slice_vol very confusing for anything other than
axial slices as in the example above; you may prefer to use the
voxel-world mapping (from the V.mat matrix) in combination with
spm_sample_vol. Or just experiment with it until familiar (comparing
with the voxel-wise data loaded as above, as well as with the GUI,
will probably help).
Best of luck,
Ged.
|