USER NOTE: To perform the anatomical processing you must have SPM2 on your Matlab path and the Matlab Image Processing Toolbox. Nearly all of mrVista code relies on the Image Processing Toolbox. Not much relies on SPM2.
Many portions MrVista rely upon having a high quality anatomical (T1-weighted) scan. The anatomical data and various types of processing of these data (e.g., the gray/white segmentation) are stored in a special anatomy directory. On our system this is
/biac1/wandell/data/anatomy/subjectName
The location of this anatomy directory should be defined automatically when mrVista is invoked. The directory name can be set as a Matlab preference by the command
setpref (‘ VISTA ', ‘ defaultAnatomyPath ', ‘ nameOfYourAnatomyDirectory ')
You need to run this command once and then it will be saved whenever you start Matlab again.
(Programming note: The variable is retrieved in the function getAnatomyPath ())
For each subject we often collect multiple T1-weighted SPGRs , co-register, and average these measurements together. We find that this produces a high quality image that is easier to segment into gray and white matter. Below is an average of 6 scans collected over 3 different scan sessions.

The procedure for creating a file named ‘ vAnatomy.dat ' located in the subject-specific anatomical directory follows:
1. Perform the MR measurements and retrieve the raw image files from the scanner. If you are going to average multiple T1s together, each group of I-files should be in its own sub-directory, say spgr1, spgr2, and so forth.
2. Create an Analyze format file for each of the T1-weighted scans. The function is
makeAnalyzeFromIfiles ( ifileDir , outFileName );
Despite its name, this function will accept either GE I-files or DICOM format files from any scanner. It will try to reorient your data (based on the Rx information in the header, and without reslicing ) so that the resulting images are transverse (axial) with the left-most, anterior-most, superior -most corner at the upper left of the first slice. A small white marker is inserted to identify this corner.
3. Next, we run a function that (a) aligns the first T1 scan to the MNI template brain (using only a rigid body transform – no warping), (b) aligns the other T1 weighted scans to the first, (c) reslices each to 1 mm isotropic voxels , and (d) averages the scans, and (e) saves out the averaged/ resliced /Analyze file.
mrAnatAverageAcpcAnalyze ( fileNameList , outFileBaseName )
Even if you only have just one T1-weighted scan, use this function. It will still do the MNI ac-pc alignment and the 1mm isovoxel reslicing .
The registration to the MNI template may not always give good results (most likely because there is no scaling in the registration). You can also specify the ac-pc coordinates as follows: (a) Determine the coordinates using (on a terminal window):
startmricro
(b) File-open analyze, (c) find ac and add the coordinates to the Origin, (d) Header-Save header, (e) note coordinates of the pc and midsaggital plane, then
mrAnatAverageAcpcAnalyze ( fileNameList , outFileBaseName, [pc-coordinates; mid-saggital plane coordinates] ) 4. Finally, run
createVolAnat
This routine will query you for the name of the Analyze file created above. It reads the file and then shows you some example slices and the intensity histogram. The slices and histogram appear in a window. In the subplot for the histogram (upper left), select lower and upper limits to the MR values. The routine shows you the effect on the MR data for these values. Choose upper and lower values that maximize the gray/white contrast, without saturating the white matter completely.
If you don't understand this, click a few times and you will get the idea. After each click you are given the option of keeping or not the particular choice. (We should improve the UI here.)
When you accept your selection, the vAnatomy.dat file and the UnfoldParams.mat file will be written to disk. You can select where they are written. The default is the current directory. |