nifty - apply transformation matrix without resampling
Posted: Thu Mar 27, 2014 4:39 pm
Hi,
Here is my problem.
I have two images in nifty format:
- one time of flight image (tof.nii, with a transformation matrix inside), 3D volume, with high resolution and a partial field of view
- one magnitude image (mag.nii), 3D volume in a lower resolution.
Using FSL ( FLIRT 2 times, with 3DOF and 6 DOF), I computed a transformation matrix (tof2mag.mat) and when looking at the resampled tof image (in the same resolution as mag.nii) it is ok, this registration worked well.
But I don't want to resample my tof image. I want to keep its high resolution, but changes the transformation matrix in the header (by composing the current transformation matrix I have by the tof2mag.mat). And in FSL I did not manage to do this...
Is there a way to do this in aims/pyaims or brainvisa ?
I tried in pyaims:
I converted the tof2mag.mat to .trm (using Brainvisa > Tools > Converters).
I load the tof image in pyaims:
tof = aims.read('tof.nii')
here is the current tof image transformation:
tof.header()['transformations']=
Out[24]: [ [ -0.999968945980072, 2.90168227365938e-05, 0.00788639020174742, 104.844856262207, 0.00112898182123899, -0.989195644855499, 0.146790638566017, 156.384750366211, -0.00780521612614393, -0.146799236536026, -0.989136099815369, 0.940803527832031, 0, 0, 0, 1 ] ]
I read the tof2mag.mat trm file:
tof2magtrm = aims.read('./tof2mag.trm') (type: soma.aims.AffineTransformation3d)
And then, I am blocked, I just don't know how to combine these two transformations...
Thanks a lot in advance for your help !!
Here is my problem.
I have two images in nifty format:
- one time of flight image (tof.nii, with a transformation matrix inside), 3D volume, with high resolution and a partial field of view
- one magnitude image (mag.nii), 3D volume in a lower resolution.
Using FSL ( FLIRT 2 times, with 3DOF and 6 DOF), I computed a transformation matrix (tof2mag.mat) and when looking at the resampled tof image (in the same resolution as mag.nii) it is ok, this registration worked well.
But I don't want to resample my tof image. I want to keep its high resolution, but changes the transformation matrix in the header (by composing the current transformation matrix I have by the tof2mag.mat). And in FSL I did not manage to do this...
Is there a way to do this in aims/pyaims or brainvisa ?
I tried in pyaims:
I converted the tof2mag.mat to .trm (using Brainvisa > Tools > Converters).
I load the tof image in pyaims:
tof = aims.read('tof.nii')
here is the current tof image transformation:
tof.header()['transformations']=
Out[24]: [ [ -0.999968945980072, 2.90168227365938e-05, 0.00788639020174742, 104.844856262207, 0.00112898182123899, -0.989195644855499, 0.146790638566017, 156.384750366211, -0.00780521612614393, -0.146799236536026, -0.989136099815369, 0.940803527832031, 0, 0, 0, 1 ] ]
I read the tof2mag.mat trm file:
tof2magtrm = aims.read('./tof2mag.trm') (type: soma.aims.AffineTransformation3d)
And then, I am blocked, I just don't know how to combine these two transformations...
Thanks a lot in advance for your help !!