Differences between revisions 31 and 32
Deletions are marked like this. Additions are marked like this.
Line 42: Line 42:
where [tkrR tkrA tkrS] is your point on the RAS on the surface is in
the "tkregister space" (eg, the "Volume coordinate" in tksurfer
) and
Torig is the Vox2tkrRAS obtained from "mri_info --vox2ras-tkr
orig.mgz" (note: this is the same for all orig volumes). 
where [tkrR tkrA tkrS] is the "Vertex RAS" as seen in the tksurfer
Tools window (also output of mris_
convert). Torig is the Vox2tkrRAS
matrix
obtained from "mri_info --vox2ras-tkr orig.mgz" (note: this is
the same for all orig volumes).
Line 54: Line 54:
2. I have a point on the surface and want to compute the MNI305 RAS
that corresponds to this point:
2. I have an RAS point on the surface (tkrR tkrA tkrS) ("Vertex RAS" from
tksurfer)
and want to compute the MNI305 RAS that corresponds to this
point:
Line 69: Line 70:
3. I have a point on the surface and want to compute the Scanner RAS
from the point
in orig.mgz that corresponds to this point:
3. I have a point on the surface ("Vertex RAS" in tksurfer) and want to
compute the Scanner RAS in orig.mgz that corresponds to this point:
Line 88: Line 89:
surface. Use the "Volume index" to compute tkrRAS. It "Save Point" in surface. Use the "Volume index" to compute tkrRAS. Hit "Save Point" in
Line 96: Line 97:
5. I have a point on the surface and want to compute the CRS for the 5. I have a point on the surface ("Vertex RAS") and want to compute the CRS for the
Line 115: Line 116:
origCRS = Torig * inv(Reg) * inv(Tmov) * [movC movR movS 1]' origCRS = inv(Torig) * Reg * Tmov * [movC movR movS 1]'

top

FreeSurfer Coordinate Systems

The "official" FreeSurfer Coordinate definitions can be found in the following power-points slides (SEE THESE FIRST):

or PDF:

This also includes a little intro to Affine Transformations.

See also: VOX2RAS(PDF)

Transformations between Freesurfer Surfaces and TrackVis

Also see: TrackVis Transforms <--- !!!

Use Cases

Below are several cases in which someone has a coordinate in one coordinate system and wants to transform it to some other coordinate system (eg, a point on the surface to MNI305 space). Each computation shows the matrices needed and how to get them as well as a check using tkmedit/tksurfer. The equations are based on those in FS Coordinates (PowerPoint). CRS is column-row-slice. RAS is right-anterior-superior.

The checks assume you have run tkmedit and tksurfer in the following way:

tkmedit subject orig.mgz -reg register.dat -ov mov.nii -surfs

tksurfer subject lh inflated -reg register.dat -ov mov.nii

Note on Talairach: FreeSurfer does not report true "Talairach" coordinates. The coordinates listed unter "Talairach" are actually based on Matthew Brett's 10/8/98 non-linear transform from MNI305 space (see http://www.mrc-cbu.cam.ac.uk/Imaging/mnispace.html). FreeSurfer also reports "Talairach MNI" coordinates. These are MNI305 space.

Transforms within a subject's anatomical space


1. I have a point on the surface and want to compute the CRS for voxel in the orig.mgz that corresponds to this point:

VoxCRS = inv(Torig)*[tkrR tkrA tkrS 1]'

where [tkrR tkrA tkrS] is the "Vertex RAS" as seen in the tksurfer Tools window (also output of mris_convert). Torig is the Vox2tkrRAS matrix obtained from "mri_info --vox2ras-tkr orig.mgz" (note: this is the same for all orig volumes).

Test: click on a point in tksurfer. Use "Vertex RAS" to compute Vox2CRS. Round Vox2CRS to the nearest integer. Hit Save Point in tksurfer. In tkmedit, Goto Saved Point. Compare VoxCRS to "Volume Index". Note: you may need to use the "Volume RAS" from tkmedit in the computation above to get an exact match.


2. I have an RAS point on the surface (tkrR tkrA tkrS) ("Vertex RAS" from tksurfer) and want to compute the MNI305 RAS that corresponds to this point:

MNI305RAS = TalXFM*Norig*inv(Torig)*[tkrR tkrA tkrS 1]'

  • TalXFM: subject/orig/transforms/talairach.xfm Norig: mri_info --vox2ras orig.mgz Torig: mri_info --vox2ras-tkr orig.mgz

Test: click on a point in tksurfer. Use "Vertex RAS" to compute MNI305RAS. Compare MNI305RAS to "Vertex MNI Talairach". Also, hit Save Point in tksurfer. In tkmedit, Goto Saved Point, compare MNI305RAS to "MNI Coordinates". Note: you may need to use the "Volume RAS" from tkmedit in the computation above to get an exact match.


3. I have a point on the surface ("Vertex RAS" in tksurfer) and want to compute the Scanner RAS in orig.mgz that corresponds to this point:

ScannerRAS = Norig*inv(Torig)*[tkrR tkrA tkrS 1]'

  • Norig: mri_info --vox2ras orig.mgz Torig: mri_info --vox2ras-tkr orig.mgz

Test: click on a point in tksurfer. Use "Vertex RAS" to compute ScannerRAS. Save Point. In tkmedit, Goto Saved Point, compare ScannerRAS to "Volume Scanner Coordinates".


4. I have a CRS from a voxel in the orig.mgz volume and want to compute the RAS in surface space (tkrRAS) for this point:

tkrRAS = Torig*[C R S 1]'

  • Torig: mri_info --vox2ras-tkr orig.mgz

Test: click on a point in tkmedit very close to the left hemi white surface. Use the "Volume index" to compute tkrRAS. Hit "Save Point" in tkmedit. In tksurfer, Goto Saved Point. Compare tkrRAS to "Vertex RAS". It might not be exactly the same because you might not have clicked exactly on a vertex in tkmedit.

Transforms within subject across imaging modalities


5. I have a point on the surface ("Vertex RAS") and want to compute the CRS for the corresponding voxel in my functional/diffusion/ASL/rawavg/etc "mov" volume:

movCRS = inv(Tmov)*Reg*[tkrR tkrA tkrS 1]'

  • Tmov: mri_info --vox2ras-tkr mov.nii Reg: register.dat
    • tkregister2 --mov mov.nii --reg register.dat

Test: click on a point in tksurfer and hit Save Point. Compute movCRS using the "Vertex RAS". Round movCRS to the nearest integer. In tkmedit, Goto Saved Point. Compare movCRS to "Functional Overlay Index Coordinates".


6. I have a CRS from a voxel in my functional/diffusion/ASL/rawavg/etc "mov" volume and want to compute the CRS for the corresponding point in the orig.mgz:

origCRS = inv(Torig) * Reg * Tmov * [movC movR movS 1]'

  • Torig: mri_info --vox2ras-tkr orig.mgz Tmov: mri_info --vox2ras-tkr mov.nii Reg: register.dat
    • tkregister2 --mov mov.nii --reg register.dat

Test: click on a point in tkmedit very close to the left hemi white surface. Use the "Functional Overlay Index Coordinates" to compute origCRS (round to the nearest integer). Compare origCRS to the "Volume index". Note: you may need to use the "Volume RAS" from tkmedit in the computation above to get an exact match.


7. I have a CRS from a voxel in my functional/diffusion/ASL/rawavg/etc "mov" volume and want to compute the tkrRAS for the corresponding point on the surface:

tkrRAS = inv(Reg) * Tmov * [movC movR movS 1]'

  • Tmov: mri_info --vox2ras-tkr mov.nii Reg: register.dat
    • tkregister2 --mov mov.nii --reg register.dat

Test: click on a point in tkmedit very close to the left hemi white surface. Use the "Functional Overlay Index Coordinates" to compute tkrRAS. Hit "Save Point" in tkmedit. In tksurfer, hit "Goto Saveed Point". Compare tkrRAS to "Vertex RAS". It might not be exactly the same because you might not have clicked exactly on a vertex in tkmedit.

CoordinateSystems (last edited 2019-07-29 17:18:06 by 172)