ROI Toolbox Docs

Documentation: Generate Tal ROIs (tal_roi.m)
--------------------------------------------
Jeff Cooper
12/13/02

1. Summary

tal_roi is a powerful script intended to generate anatomical
region-of-interest files that can be used for further 
analysis by many of the functions in the ROI Toolbox.  Its based
on the Talairach Daemon software, and it uses that programs
database to look up Talairach-space coordinates for various 
anatomical landmarks.
	The user is asked to choose from a variety of categories, 
optionally selecting a hemisphere, gyrus, Brodmann area or brain
structure, lobe, and tissue type; they may choose unions or 
intersections of various selections in those categories.  The 
program then generates an ANALYZE-format .img file, readable by 
SPM and related packages, which contains an ROI image  all zeros
outside the region of interest, all ones within that region.
	NOTE that the program bases its anatomical coordinates on 
the Talairach-Tournoux reference brain, which means that ROIS 
it generates may be incorrectly placed with respect to SPM results
or images normalized with SPM without a transformation into 
MNI space.  See documentation for tal2mni for more details.


2. Usage

tal_roi

This program may be invoked from the command line or by using the
Generate Tal ROIs button in the ROI Toolbox.  Either of these 
pops up the graphical interface for the ROI generation facility.
	There are five lists that the user may choose from: 
Hemisphere, Lobe, Gyrus, Tissue Type, and Brodmann Area (which also
lists a number of non-Brodmann structures, like Amygdala or Caudate).
The user makes selections from any or all of these boxes, and may
select as many elements from each list as he or she chooses. 
(Multiple selections can be made by holding down the control key 
while clicking within a list.)  The user then hits OK to generate
their ROI image, which is output into the present working 
directory.
	The ROI is generated from the users selection as follows:
Within each list, the union of all the selections within the list
is chosen.  The intersection of all of those unions is then taken,
and the resulting region is written as the ROI image. Leaving a 
given list at None is the same as choosing every item in the list.
If the choices between lists do not intersect, an error comes out
and no .img is generated.
	A few examples:
	- We choose Left Cerebrum for Hemisphere, None for Gyrus, 
Amygdala for Brodmann Area, None for Lobe, None for Tissue Type.
The resulting ROI will consist of the left amygdala, and nothing else,
since choosing none results in intersection with everything.
	- We choose None for Hemisphere, Superior Frontal Gyrus for 
Gyrus, Brodmann Area 9 for Brodmann Area, None for Lobe, None for 
Tissue Type.  We get the intersection of the superior frontal gyrus
and BA 9, bilaterally (since we didnt choose a lobe), and nothing 
else.
	- We choose Right Cerebrum for Hemisphere, None for Gyrus,
None for Brodmann Area, None For Lobe, Gray Matter for Tissue Type.
Our ROI will be all the gray matter in the right hemisphere.
	- We choose None for Hemisphere, Superior Frontal Gyrus for 
Gyrus, Brodmann Area 20 for Brodmann Area, None for Lobe, None
for Tissue Type.  We get an error, since BA 20 and the superior
frontal gyrus dont intersect.
	- We choose Right Cerebrum for Hemisphere, None for Gyrus,
Brodmann Areas 17, 18 and 19 for Brodmann Area (by holding down 
the control key when we make our BA selections), None for
Lobe, None for Tissue Type.  Well get the union of BA 17, 18 and 19
in the right hemisphere.
	Each time the OK button is hit, the script generates a single
image file, based on whats selected at that moment.  When all the
ROIS needed have been generated, the window can be closed to close
tal_roi.


3. Output
 
tal_roi outputs a single image file each time the OK button is
hit, and the image file is always written to the present working
directory.  The image file consists of an ROI mask  an .img file
with all zeros outside the region of interest and all ones within
it.  The filename of the output file is based on the selections
chosen within the tal_roi window  choosing Left Cerebrum, Amygdala,
Gray Matter, generates an image with the filename L_gray_Amg.img.



4. Last Bits

tal_roi.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 wraps
around roi_generate, written by Kalina Christoff a while back now.

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

