ROI Toolbox Docs

Documentation: mni2tal (mni2talgui.m)
--------------------------------------------
Jeff Cooper
12/13/02

1. Summary

mni2talgui is a utility intended to transform an ROI listed in
a .tal file from MNI coordinate space into Talairach 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
MNI-space brain coordinates into Talairach-space brain coordinates, by
applying an empirically designed nonlinear XYZ transform.  It operates
only on .tal files and produces other .tal files.


2. Usage

mni2talgui
[outfiles, outpoints] = mni2talgui(infiles)

mni2talgui can be run either with the mni2tal 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 MNI space to convert.  Note that
there isnt any independent way that this program can verify that
coordinates are in MNI space, so the user is cautioned to be sure 
theyre actually selecting MNI-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

mni2talgui produces new .tal files, whose filenames are based off
the old filenames, but have _tal 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_tal.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 MNI coordinate space into the equivalent point in the Talairach 
reference brain.  They are standard .tal files, suitable for
input into any of a variety of ROI Toolbox functions.


4. Using mni2tal By Hand

As a side note, if the user ever has a simple list of coordinates in
MNI space that they need to put into Talairach space, thats not
contained in a .tal file  i.e., from a spreadsheet of results coordinates,
or output directly from glassbrain, there is a non-graphical
simple facility available, mni2tal, 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 = mni2tal(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 MNI space to Talairach
space.
	This facility is available from the spm99, spm99-6, and 
spm99-6-devel MATLAB paths.


5. Last Bits

mni2talgui.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 mni2tal.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...

