Hi,
it's a simple Problem: I want to rotate a high-res anatomy VMR with the
inverse matrix which I got from the corregistration, into the direction of
the corregistration input VMR, with changing the voxelsize and FOV.
The high-res anatomy VMR has the following parameters:
Voxelsize: -1 1,05625 1,05625
DIM: 160 256 256
The input VMR
Voxelsize: -0,9375 0,9375 6,5
DIM: 204 256 19
The size of the output VMR:
Voxelsize: -1 1 1
DIM: 240 240 256
My procedure:
-corregistrate the anatomy with the input VMR (works!)
-invert the corregistrationmatrix (works!)
-calculate the shift:
X_shift=(240-204*0,9375)/2=24,375
y_shift=(240-256*0,9375)/2=0
z_shift=(256-19*6,5)/2=66,25
-make an identity matrix with the shifts (matrix.mtx)
1 0 0 24,375
0 1 0 0
0 0 1 66,25
0 0 0 1
-use: convert_xfm -omat temp.mtx concat inverse_coregist.mtx matrix.mtx
-make an fake header with the new resolution: avwcreatehd 240 240 256 1 1 1
1 1 0 0 0 2 temp.hdr
- use flirt to reorient:
flirt -in anatomy -applyxfm -init temp.mtx -out output -paddingsize 0.0
-interp trilinear -ref temp.hdr
the last step runs wihtout error. But the output has a shift in the positive
y-direction. Why? The FOV in this direction doesn't change, only the voxelsize!
Best regards
Joerg
|