Dear Doug,

Following up on tkregister (lets see if my logic make sense).
So, if I use --regheader, the actual transformation that will be written to register.dat will be this one ?

T* = Tk_vox2ras(B) * inv(vox2rasB) * T * vox2rasA * inv(tkvox2rasA)

where T maps X,Y,Z of volume A (in mm) to X,Y,Z of volume B (in mm) when mm space was obtained using vox2ras.

This way, things will be compatible when I call tkregister again without the regheader?

What bothered me was that if you use vox2ras to map things you get transformation T, which is actually different than 
the transformation you would get if you use tkvox2ras (i.e., T*).

If this is the case, then I think I finally understand whats going on :)

-- Shay


Date: Fri, 01 Jun 2012 12:03:13 -0400
From: Douglas N Greve <greve@nmr.mgh.harvard.edu>
Subject: Re: [Freesurfer] tkregister question
To: freesurfer@nmr.mgh.harvard.edu
Message-ID: <4FC8E7C1.6060806@nmr.mgh.harvard.edu>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

When you use --regheader, then it uses the vox2ras transform in the
header. If you pass it a register.dat file as input, then vox2ras is
ignored.
doug

On 05/31/2012 06:39 PM, Shay Ohayon wrote:
> Hi,
>
> Bump?
>
> Can someone please explain to me the puzzle described below regarding
> tkregister2 and vox2ras0 (which I thought should be ignored for
> registration purposes?)
>
> Thanks!
>
> -- Shay
>
>
> On Sat, May 26, 2012 at 2:23 PM, Shay Ohayon <shay.ohayon@gmail.com
> <mailto:shay.ohayon@gmail.com>> wrote:
>
>     Hi,
>
>     Here's a question to Doug / anyone else who mastered the intricate
>     way of volume transformations:
>
>     I'm a bit puzzled.
>     According to Free surfer's documentation (fscoordinates.pdf), the
>     way two volumes are registered to each other using tkregister is
>     always using
>     the fixed transformation (tkvox2ras) (see page 6).
>
>     However, when I do the following little experiment (using matlab's
>     freesurfer API)
>
>     A = '001.nii';
>     B = '002.nii';
>     X=MRIread(A);
>     X.vox2ras0(1,4) = 40;
>     MRIwrite(X,B);
>
>     tkregister2 --targ 001.nii --mov 002.nii --regheader -reg R.reg
>
>     The two volumes are not in alignment when they are loaded into
>     tkregister.
>     Now, what am I missing here?
>     If both were loaded using the fixed transform, they should still
>     be in alignment (i.e., vox2ras should be ignored for registration
>     purposes).
>
>     Thanks in advance,
>
>     -- Shay
>     Tsao lab
>     Caltech
>
>
>
>
>
>
>
> _______________________________________________
> Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer