Differences between revisions 29 and 30
Deletions are marked like this. Additions are marked like this.
Line 23: Line 23:
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 checks assume you have run tkmedit and tksurfer in the following way: 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 '''[[attachment:fscoordinates.ppt|FS Coordinates (PowerPoint)|&do=get]]'''. The checks assume you have run tkmedit and tksurfer in the following way:
Line 26: Line 26:
Line 34: Line 35:
I have a point on the surface and want to compute the CRS for 1. I have a point on the surface and want to compute the CRS for
Line 51: Line 52:
I have a point on the surface and want to compute the MNI305 RAS 2. I have a point on the surface and want to compute the MNI305 RAS
Line 66: Line 67:
I have a point on the surface and want to compute the Scanner RAS 3. I have a point on the surface and want to compute the Scanner RAS
Line 78: Line 79:
I have a CRS from a voxel in the orig.mgz volume and want to 4. I have a CRS from a voxel in the orig.mgz volume and want to
Line 93: Line 94:
I have a point on the surface and want to compute the CRS for the 5. I have a point on the surface and want to compute the CRS for the
Line 108: Line 109:
I have a CRS from a voxel in my functional/diffusion/ASL/rawavg/etc 6. I have a CRS from a voxel in my functional/diffusion/ASL/rawavg/etc
Line 125: Line 126:
I have a CRS from a voxel in my functional/diffusion/ASL/rawavg/etc 7. I have a CRS from a voxel in my functional/diffusion/ASL/rawavg/etc

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). 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 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).

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 a point on the surface 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 and want to compute the Scanner RAS from the point 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. It "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 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 = Torig * inv(Reg) * inv(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)