This information is very old...most machines where this stuff were installed are gone...still, it is a lot of information, so I'd hate to just delete it when it might be useful to someone, somewhere.  Dianne Patterson 10/25/2006

Together with Caret, Surefit makes it possible to prepare and display activations on a flattened representation of the brain. Surefit will segment and prepare the anatomical file for Caret. Caret will actually flatten the anatomical file, and import and overlay the functional file. The procedures for preparing files for Surefit and Caret can be accomplished with Afni as described here and on the accompanying Caret page.

Getting and Installing SUREfit

Surefit can be downloaded from the VanEssen Labs after a simple registration process. See the Surefit home page. Keep in mind that if you would like to display functional activations on flat maps, you'll also want to download their program, Caret.

Surefit will install on several unix platforms (sun, sgi and linux). Identify and download the correct set of binaries for your system. A user manual (*.pdf) and a demo and test data set are included in the zipped up tar file you downloaded. Select an area for the install and untar and unzip the program. It will create a SUREfit directory and dump everything in there. Enter the SUREfit directory and type ./INSTALL to install the program. As the program installs, it will tell you valuable information. Especially important are the lines to be added to your .cshrc.

Note that if you are also running Freesurfer from MGH, there will be a conflict between the TCL library that SUREfit calls and the TCL library that Freesurfer calls. On our machine, I have solved this problem by adding two aliases to the .cshrc for each user:

alias surefit 'setenv TCL_LIBRARY $SFHOME/lib/tcl8.0; SureFit'
alias freesurfer 'setenv TCL_LIBRARY $FREESURFER_HOME/lib/tcl8.3; csurf'

After establishing that you can start Surefit, you should go to the Caret page on this website and setup and install Caret. The reason for doing this now, is that the SUREfit demo and tutorial will end by having you open and manipulate data in Caret because the programs really work together.

Learning SUREfit

Print out the UserManual you find in the distribution. In the data subdirectory of your SUREfit directory, you'll find SUREFIT.DEMO and SUREFIT.TEST. Begin with SUREFIT.DEMO and follow the instructions in the user manual. When you are comfortable with the demo, work through the SUREFIT.TEST data. The SUREFIT.TEST data actually has you do processing steps that take hours, so be prepared.

Preparing your Own Data for Surefit

Before you import your own 3D anatomical data into Surefit, you need to center the 3D image and align it to the 2D anatomical (and, by extension, to the functional image). This works for the U of A researchers because we align our 2Ds with the functionals. Other folks out there should check to see if these techniques would be appropriate for them.

Surefit requires that the image be in MINC format, LPI orientation and have isotropic 1x1x1 mm voxels. If you would like a copy of the centered 3dbrain, look in the Finished Afni Tutorial Data area. Beginning with an afni *.BRIK and HEAD file (brain3d+orig.*), run the following:

>3ddup -prefix aaa brain3d+orig

In afni, click "Define Datamode", select cubic resample (Anat resam mode: Cu), select "Write Anat". Close Afni. 3ddup and the "Write Anat" command will create a resampled image with 1x1x1 voxels.

>3daxialize -prefix aaa_lpi -orient LPI aaa+orig

3daxialize will flip the image over into the Left-Posterior-Inferior orientation surefit likes (Left-Posterior-Inferior refers to the corner of the image cube that the program will use as the 0,0,0 voxel).

You'll need to keep the resampled anatomy file in your directory when you resample the functional image, because afni will use the available anatomical image as a "parent" to the functional image and give you the wrong output if it finds the wrong anatomical parent.

>3dinfo aaa_lpi+orig.

3dinfo will tell you the dimensions of your resampled anatomy file. For the Study1 3D anatomical tutorial data, that should be 186x250x250. Use the dimensions that 3dinfo reports when you run the Raw2Minc command. Raw2Minc creates the *.mnc anatomy file for Surefit:

>Raw2Minc aaa_lpi+orig.BRIK 186 250 250

You may wish to resample and flip the functional file as soon as you are done with the anatomical file...after all, you'd be miserable if you did all the work to segment, correct and flatten the anatomical file and then found that there was some problem that prevented the functional file from being resampled and flipped into the same space.

An Alternative

WARNING: If you need an anatomical parent (with 1x1x1 voxels) for your functional data, you should use the Afni and Raw2Minc procedures instead of this alternative. If you only need a quick anatomical, Afni2Minc does a nice job.

The Afni2Minc command line utility will read the HEAD file and identify the orientation and voxel size of an Afni BRIK. It will then reorient and reslice the image, as needed to produce a *.mnc file in the correct orientation and voxel size, e.g.,

>Afni2Minc brain3D+orig.BRIK

In the example, the command "Afni2Minc" is followed by the name of a BRIK file (brain3d+orig.BRIK) to be flipped and resampled. The command will create new files: axialized BRIK and HEAD and an LPI *.mnc file. It will leave your original file intact. At this point you should be able to follow the example in the DEMO and TEST tutorials to choose a partial volume, perform segmentation, surface render a fiducial surface prepared for flattening, and correct topological errors.