Print

Print


Hello again Amir,

Glad the padding stuff worked. I have a rough idea how about your 
warping question, but don't have time to check that it's correct...

> In preprocessing, at the normalization step, I am using my own 
> registration method. The output of registering the structural data to the 
> template is in the form of a deformation field (i.e. for each voxel of the 
> source image, a vector with three elements, dx,dy and dz, is saved).
> 
> I was wondering if there is any spm function that I can use to apply this 
> deformation field to my EPI images (warping).

I think you'll need to convert your displacement field to be a field 
of post-transformation world coordinates, by adding on a component due 
to the affine part of the voxel world mapping. Basically, for each 
voxel (i,j,k) you will want to add V.mat*[i j k 1]' to the displacement.

Then under SPM5 you need this to be stored as a 5D NIfTI file, 
(x,y,z,time=1,component) where component is 1,2 or 3 for (x,y,z) 
coordinate. I think in SPM2 you need to create three separate 3D 
blah_x.img blah_y.img blah_z.img images (the best way to check this is 
to experiment with the SPM2 Deformations toolbox or SPM5 HDW toolbox 
and see what they do).

You should then be able to use either spm5/toolbox/HDW/spm_hdw or 
spm2/toolbox/Deformations/spm_apply_def_ui to warp the images.

By the way, in order to warp from an image to the template, the 
deformation field should be defined over the voxels of the template 
(usually called target, reference, or fixed image in this context) and 
not the source (aka moving or floating image). I think the target 
V.mat is then the correct affine voxel-world mapping to add on. 
Probably...

Best of luck,
Ged.