[Insight-users] itkResampleImageFilter and transformation matrix

Gomez, Alberto alberto.gomez at kcl.ac.uk
Tue Nov 9 09:24:03 EST 2010


Hello all,

I am resampling one volume (1) into another (2) to compare them. They 
have different origin, orientation, etc. I can think of two ways of 
achieving this, but only one works for me and I wonder why, maybe you 
can help me.

1st way: Using itk::ResampleImageFIlter with no transformation, setting 
useReferenceImageOn and using volume (2) as reference. This works fine.

2nd way: Not using reference image, but instead using a transformation 
from volume(1) to volume(2). For some reason this does not work.
I obtain transformation matrix from the orientation and offset of each 
image, and I am sure that both matrices (lets call them M1 and M2) are 
correctly computed. What I do next is compute M = inv(M1)*M2
and transform image 1 through M (actually through its inverse, since the 
transform operates from output to input). In addition I fix the output 
spacing, origin, startindex and size  to those of image (2) so that my 
resulting transformed image is in the same space as the image (2) and i 
can display both together.
My guess is that this does not work because even if I set 
useReferenceImageOff(), the input orientation is taken into account and 
therefor my matrix is not the right one...

Anyone can give any advice on this??

Thank you,

Alberto

-- 
Alberto Gomez

Division of Imaging Sciences
The Rayne Institute
4th Floor, Lambeth Wing
St Thomas' Hospital
London SE1 7EH

email: alberto.gomez at kcl.ac.uk




More information about the Insight-users mailing list