HOME | SCANNING | RESOURCES | PUBLICATIONS | PEOPLE |


ORTHO 2005

An interactive  Matlab GUI tool for time series extraction , visualization and analysis.
(latest version 1/2009 - works a lot better)




The FMRI Toolbelt


Luis Hernandez-Garcia at UM 




Brief User's Manual:

Installation

1.  Download the .tar file below (LuisTools.tar) and expand it in a directory of choice.
   
 tar xvf LuisTools.tar


2.  Add that directory to your Matlab  path


Starting ORTHO


Run Matlab  and execute the command:

    ortho

(The GUI portion does not work with prior versions to Matlab 7, but y
ou can still run ortho as a command line tool, though!)

If you want to run ortho without the GUI, take a look at the file  ortho_nogui.m  . You can edit that file by filling in the fields that you need, and use it as a "fake GUI".  Once you have filled it in, all you have to do is execute it. 
Similarly, If you want to use the programs in batch mode to run through all your subjects, edit the file  ortho_batch.m and execute it.

But, if you are one of the lucky ones to have Matlab 7 and later and you are using the GUI, the interface looks  like this:



Using Ortho

Ortho works on Analyze format files  (.img) and NIFTI (.nii. nii.gz).   Please note that ORTHO disregards the .mat files that are generated by SPM.  It does use the header information like origins, voxel sizes and Scaling Factor.

Now that ORTHO is running, its main functions are to
- display the images in orthogonal views,
- overlay statistical maps on top of them and
- extract time series from selected voxels.  You can easily select the type or ROI you want.
- show you pixel values of the anatomical and the statistical images.

ORTHO can also (if you check the options)
- average events from a time series,
- show you a movie of the image in orthogonal sections.
- filter the data,
- display the temporal frequency content. The user is allowed to navigate the images interactively, and ORTHO updates the time series display accordingly.
- save the time series data into ASCII files.
- ortho is VERY easy to run as a batch script.  Type " help ortho2005 " at the matlab command prompt for details.

Ortho's interface is designed so that
when you press the GO button, it displays as much as it can with whatever fields are filled in by the user,  (... but some combinations are not implemented yet).   ORTHO shows you the images and it updates the display interactively as you select voxels by clicking on them.  Information about the pixel (or pixels) gets displayed in the matlab command window.  When you RIGHT CLICK, all that information gets put into ASCII files.

Here is a brief description of how to do a few basic things using the GUI:

1. Extracting and Looking at a time series:

If you fill in the "time series" only, you will get a plot of the time series at whatever voxel you click on.  To fill in the "Time Series" field, select one of the images in the time series.  ORTHO will assume that they all are named the same except for the numbers at the end of the name. eg-

vol_e2343_10_12_03_0001.img
vol_e2343_10_12_03_0002.img
...etc

If you have a single 4D file, ORTHO will recognize it and read it in as well.  If you fill in the "anatomical" image only, you will get a display of the image you select along with a nice histogram of the pixels values.


2. Stuff you can do to the time series:

You can also add detrending (3rd order polynomial) and gaussian filtering to the time series by checking the appropriate box.  The filter parameters are hard-coded.  They should be user defined, but that's not implemented yet... sorry... it's easy to hack if you have the inclination, though...

If you click with the RIGHT mouse button, the extracted waveforms get stored as ASCII files for easy access outside of matlab.

You can display the FFT's magnitude and phase in a separate window by checking the "FFT" box (near the bottom)


If you provide a set of onset times, and a time window,  you will get trial averages over the desired widow of time.  Note - ortho looks at time in units of scans - does not know your sampling rate or TR. It also displays a nice image of a matrix made up of the individual events that you are averaging.  This is really handy because you can notice changes in the events from trial to trial, things like habituation or drifts in HRF parameters, errors in the timing of the experiment...

 
You can also look at a movie of the time series through the selected location be checking the "Movie" checkbox

3. Ovelaying a Statistical Map:

If you fill in the "anatomical"  and "stats map 1", you will get a display of the anatomical image with the statistical map overlayed on it.   You can select the threshold by filliing in the threshold value field. These images must be coregistered previously.   They can have different resolutions, but they need to be in the same orientation with the same origin.  Remember that ORTHO does not use the .mat files generated by SPM's coregistration so it doesn't apply the transformations on the fly the way SPM does.

You can also display two statistical maps to find overlapping voxels by filling in "stats map 2" as well.  Overlapping pixels in the statistical maps are shown in green.

You can change the threshold interactively by filling in a new value in the interface and clicking on a pixel to update the display.

4. Selecting ROI types:

If you fill in the "Anatomical", "Stats Maps" and "Time Series", you can also select a specfic set of voxels to extract the information from.  The values in those voxels get averaged together.  You can choose what kind of ROI to use in the upper right side of the interface:
  1. Cube:  means that you get the voxel you click on plus the number of neighbors in each direction specified in the field labeled "ROI size".  The default is cube with zero neighbors.
  2. Thresholded Sphere: means a sphere with the radius in mm specified in the field labeled ROI size.
  3. Mask File: means an Analyze format image in which the voxels of interest have value 1.  All others have value of zero.
  4. Voxel File means that the ROI consists of a list of voxels specified in an ASCII file, which you have to select by clicking the "Mask File / Vox. File" Button, or just typing in the file name in the field below that button.  About the aforementioned voxel file, it needs to be an ascii (text) file that looks like this example:
12 43 45
12 44 46
23 45 89

...etc.
Those coordinates are in voxel units and they are relative to the first voxel in the file - the one in the lower left corner, NOT the orgin!

5.  Computing Granger Causality Maps:

There is a CheckBox at the bottom of the GUI that says "Do Granger".  IF this is checked, as soon as you RIGHT-click on a pixel, the program will compute the Granger Causality F score between the current ROI and the rest of the image.  The resulting files are named :

grangerFab    -  F score of the influence of seed on each voxel
grangerFba    -  F score of the influence of each voxel on the seed.
grangerF        -  difference between the two above:  a measure of the directionality of the relationship.  If it's positive, it means that the seed granger-Causes the  voxel in question.
grangerlog10P  - a p-value associated with the F score above (I'm not very confident on this p-value computation though)

You also get histograms of the different outputs


Example:

Here is a screen shot of what the output typically looks like:




WARNING!

This page contains some of the programs that I've written over the last couple of years at the University of Michigan and I often use in my work.  

This site contains primarily a library of matlab files to extract time series data from VOIs, do trial averaging, filtering, visualiation, and other useful things.  The mfiles also include a few useful functions to help you manipulate Analyze and NIFTI format data.  There are a few calls to the the signal processing and statistics toolboxes.



I'm happy to share my work with others, but I would like to ask that you send me an email if you download the programs, so that I know whether the stuff is useful.  You can modify anything you want to suit your needs.

DISCLAIMER:   I am not responsible for what happens to your data. Just because it works for me doesn't mean that it will work for you.  Having said that, please let me know if you find bugs. Chances are you will find quirks here and there.


Download the ORTHO Library here ->    
LuisTools.tar     <- :

This TAR file containts a set of simple, yet useful tools for image manipulation within matlab. Some of these functions call other of these functions, so I recommend that you download the whole package.

For instructions on how to use function "blah.m", simply type (within matlab)

            > help blah

and you will get instructions on the usage and output.

Page created and maintained by    Luis Hernandez-Garcia at UM