Hi Wenwen,

The fields of view of your two images may not line up, so voxel (0, 0, 0) in your source image may be out of bounds of the FOV of your reference image.

On Mon, 3 Feb 2020, 17:13 LI Wenwen, <[log in to unmask]> wrote:
Dear FSL experts,

I am using FLIRT to register an MRI template with dimension (182 * 512 * 512) to a CT scan space e.g., with the dimension of (634 * 512 * 37). In other words, the MRI template is the input scan and the CT scan is the reference scan. Both are in NIFTI format. (NB: the purple dimension is the number of slices). 

After the registration, I got a registered MRI scan which has the same dimension as the CT scan (634 * 512 * 37). Gladly, each slice of the registered MRI matches the corresponding CT slice. Meanwhile, I also got a transformation matrix as follows. 

-0.93 0.02 0.04 159.43
0.00 -0.98 -0.02 243.98
0.03 -0.01 1.04 -79.57
0 0 0 1


I try to find out each CT voxel's corresponding voxel coordinate in the MRI template through the transformation matrix. But I don't know how to work this out. May I ask how to achieve this in FSL?

I have tried the function img2imgcoord which suppose to give me each MRI template voxel's corresponding voxel coordinate in the CT space. (I know it doesn't do exactly as I want, but this is the closest that I can find to figure out the voxel coordinate mapping between the input and reference space.)

I tried a few examples, however, the results are rather confusing to me.

Example 1: echo 0 0 0 | img2imgcoord -src Template-T1-U8-RALPFH-BR.nii -dest patient_1_CT.nii -xfm transformation_matrix.mat

It gives me the output of 
-27.7708  743.009  -14.6961. After rounding to the nearest integer, it will be -28 743 -15.

Why does it have negative voxel coordinates e.g., -27.7708  and -14.6961
While the reference space is only 634 * 512 * 37, how does the result give one of the voxel coordinates of 734? 
 In addition, using (0, 0, 0) coordinate in the MRI template, shouldn't it give the offset position which is (159.43, 243.98, -79.57)?

The same issues (negative voxel coordinates and exceeding the range of the reference space) happen to other examples: echo 1 0 0, img2img2coord gives me -24.9326  743.013  -14.7028 and echo 181 511 511, I got 539.221  -33.5049  36.7852.

Many thanks,
Wenwen


The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336.


To unsubscribe from the FSL list, click the following link:
https://www.jiscmail.ac.uk/cgi-bin/webadmin?SUBED1=FSL&A=1



To unsubscribe from the FSL list, click the following link:
https://www.jiscmail.ac.uk/cgi-bin/webadmin?SUBED1=FSL&A=1