You can use the Deformations utility to generate inverse transforms. Note
that these are stored as 5D image files (you can only see the first volume in
SPM as the other two volumes are defined in the 5th, rather than the 4th
dimension). These files encode deformation fields. If you want to know
where (in mm space) voxel 30,40,20 points to, then a snippet of code similar
to the following may help:
P = 'blah/blah/y_blah.img';
N = nifti(P);
i = 30;
j = 40;
k = 20;
x = N.dat(i,j,k,1,1);
y = N.dat(i,j,k,1,2);
z = N.dat(i,j,k,1,3);
Alternatively, if you are good with MATLAB, then you could find some helpful
clues in spm_prep2sn.m .
Best regards,
-John
On Tuesday 24 June 2008 08:32, Mustafa Anjari wrote:
> Dear Prof Ashburner and SPM users
>
>
>
> Dear SPM users,
>
> By searching your weblist, I have been able to find a program where I can
> input a given set of coordinates in the warped image and get the
> corresponding coordinates in the source image (using normalise).
>
> What I would like to do is the opposite: to input the coordinates in the
> source image and get the corresponding ones in the warped image. I have
> spent a lot of time trying to invert the transformations in the program,
> but have not succeeded because I don't really know how to "invert" the
> transformations in the non-linear part (the Tr matrix). Does anyone have
> any ideas?
>
> Best wishes,
> Mustafa
>
>
>
> On Sun, 15 Jun 2008 17:31:56 +0100, Mustafa Anjari
>
> <[log in to unmask]> wrote:
> >Dear SPM users
> >
> >Thank you very much for your help. Yes, I used the normalise tool to
> >register an EPI to a T2 image from the same subject. The transformed image
> >looks good. I now want to apply this transformation to landmarks (in world
> >coordinates) that I had placed on the unregistered EPI and see where they
> >end up. I’ve tried using your code (get_coord_orig.m), but I don’t get
> >plausible results. For example, the point [0, 0, 0] gets mapped to around
> >[120, 120, 58], which makes me think there is a problem with where the
> >origin is defined in the images. Also, can you explain what information is
> >contained in the transformation (Tr) matrix that is given as an output of
> >the normalise tool, please?
> >
> >I am also unsure about the dimensions to include for the bounding box. Why
> >is it defined from the anterior commissure? Where do the default values
> >come from?
> >
> >Thanks again. Best wishes,
> >Mustafa
> >========================================================================
|