ROI Toolbox Docs

Documentation: tal2mni (tal2mnigui.m)
--------------------------------------------
Jeff Cooper
12/13/02

1. Summary

tal2mnigui is a utility intended to transform an ROI listed in
a .tal file from Talairach coordinate space into MNI coordinate
space.  It is attached to the ROI Toolbox as a way of transforming
between the coordinate spaces of the Talairach daemon and that
of SPM results.
	The issue here is treated well by Matthew Brett, who wrote
the heart of this code, on his website:
http://www.mrc-cbu.cam.ac.uk/Imaging/mnispace.html
	but the summary in a nutshell is like this.  The Talairach-
Tournoux coordinate system is a very widespread method of imposing
generic coordinates on brain anatomy, such that one can refer to 
certain brain structures as being at certain coordinates, and thus
one can analyze brain activations at certain coordinates as being
in certain brain structures.
	The trouble is that Talairach and Tournoux, when they created
their system, used only a single brain as their reference brain, which
does not have identical shape to every other reference brain out 
there.  Specifically, SPMs template images  to which most SPM 
users normalize their data  are from the Montreal Neurological 
Institute and represent averaging of hundreds of brains.  They are
probably more standard than the Talairach reference brain, but
they are not exactly the same shape.
	Therefore, if one is trying to create an anatomical ROI
from data in the Talairach atlas  by using, say, the Talairach
Daemon, or the Generate Tal ROIs button in this Toolbox  that 
ROI may not in fact cover the brain structures its intended to
cover when its applied to SPM results, which are generally in MNI
coordinate space.
	This utility is intended to address this problem by converting
Talairach-space brain coordinates into MNI-space brain coordinates, by
applying an empirically designed nonlinear XYZ transform.  It operates
only on .tal files and produces other .tal files.


2. Usage

tal2mnigui
[outfiles, outpoints] = tal2mnigui(infiles)

tal2mnigui can be run either with the tal2mni button in the ROI
Toolbox, in which case the user selects all the files with the
standard SPM file selection window, or the command line, in which 
case the user may optionally supply a cell array of .tal filenames.
From the command line, the user can also request up to two output
arguments  a cell array of filenames for the new .tal files, and
a co-indexed cell array of the converted XYZ coordinates in each
file.
	From the Toolbox or without any arguments, the user is asked
to select a list of .tal files in Talairach space to convert.  
Note that there isnt any independent way that this program can 
verify that coordinates are in Talairach space, so the user is 
cautioned to be sure theyre actually selecting Talairach-space 
.tal files (or else theyll get weirdly warped new ROIs).  The 
user then selects an output directory for the new .tal files, and 
the program runs, usually without any screen feedback.


3. Output

tal2mnigui produces new .tal files, whose filenames are based off
the old filenames, but have _mni applied to the end.  So given an
input file named L_Temporal_Cluster.tal, the output would be a 
new .tal file named L_Temporal_Cluster_mni.tal.  These files are
produced in the chosen output directory.
	The output files contain coordinate lists with one-to-one
mappings to the input lists; each point in an input file has had
a nonlinear transform applied which takes it from the given point
in Talairach coordinate space into the equivalent point in the MNI 
template brain.  They are standard .tal files, suitable for
input into any of a variety of ROI Toolbox functions.


4. Using tal2mni By Hand

As a side note, if the user ever has a simple list of coordinates in
Talairach space that they need to put into MNI space thats not
contained in a .tal file  i.e., from a list of anatomical coords,
or output directly from the Talairach Daemon, there is a non-graphical
simple facility available, tal2mni, which will do the trick on the
command line.
	Given a matrix A, which is 3 x N or N x 3, where N is the number
of points of interest, the command B = tal2mni(A) at the MATLAB
command prompt will produce a matrix B which is of the same size as A
but has mapped each of its specified points from Talairach space to 
MNI space.
	This facility is available from the spm99, spm99-6, and 
spm99-6-devel MATLAB paths.


5. Last Bits

tal2mnigui.m was written as part of the Gabrieli Lab ROI Toolbox,
a package of utilities to examine ROI data in SPM99.  It requires 
several functions in both of those packages to be run.  It is a 
shallow wrapper around tal2mni.m, which was written by Matthew Brett
as an adjunct to the SPM99 package.

This code is in a very fluid state of development, and any suggested
modifications are welcomed and invited.  Please contact Jeff Cooper
in the Stanford Psychology Department at jcooper@stanford.edu with 
any questions about usage, bug reports, or suggestions for further
revision.  Good luck...

