1) When analysis is begun, all the lines from all the subjects should be put into one directory. The right lines should be flipped into the left hemisphere's space. The colored surfaces in a space that matches the lines should be put in a subdirectory under the line directory.
2) Run the script 01_analyze.csh. This script converts the sulcal line objs into ucfs and stores them in a UCFs subdirectory under the directory on which it is run. It reslices the ucfs into rsps by dividing the ucfs into an equal number of points and stores these in an RSPs subdirectory under the directory on which is is run. This script also computes the average position and variance in position of each line and stores them in AVG and VAR subdirectories. To run this script, type 01_analyze.csh followed by the path of the directory containing the objs for all subjects that was created in step 1.
3) Run the script 02_makeSHORT.csh. This script shortens the rsps created in step 2 by removing redundant information, outputting a SHORTRSP3 file for each line for each subject.
4) Run the script 03_script_divide_lines.csh. Certain lines (5, 21, and 1) are known to "fall off" the flatmaps, meaning that they extend beyond the boundary used to split each hemisphere into two maps so they do not fall entirely within either map. To fix this problem, the RSPs for these lines are split in half, so that half of each line can fall in each map. Each of these half lines is then turned into its own RSP and shortened.
5) The script 04_make_directories.csh will set up the HEMISPHERE_FLATMAPS directory and copy over the files needed for the next step. Under the HEMISPHERE_FLATMAPS directory will be a directory for each subject. Under these directories will be a LEFT_CORT and RIGHT_CORT directory, each containing the colored object and shortened rsps for that subject and that hemisphere.
6) The scripts 05_script_LOCAL_dual_medial_flatten_catch_script_left.csh
and 05_script_LOCAL_dual_medial_flatten_catch_script_right.csh
flatten the surface and lines for each hemisphere. This script tries
to detect which lines have fallen off each map and put them into "LsurrR_FELL_OFF"
and "RsurrL_FELL_OFF" directories under the CORT directory for each hemisphere.
7) Use seg to view the flatmaps
and lines for each map for each hemisphere to see if the remaining lines
fell off. The flattened lines with filenames starting with FLAT go
with the LsurrR maps and the lines starting with DUALFLAT go with the RsurrL
maps. Lines that have fallen off may look like one of the following
examples: Figure3
Figure4
seg -line 3 DUALflat.uvl FLAT*ucf
Magnify by choosing "x3" from the Zoom
menu in the Image Display window.
Click on LsurrR_BIGCord (Level #4) in
the theUvl window.
To display lines on the flattened surface,
highlight the Level #0 line in the window for each line. An Editing
Controls window will pop up. Click on "End Edit Session".
To change the color of the line, double
click on the leftmost colored box next to the words "Current Color" in
the window for the line. A Current Contour Window will pop up.
Drag the bars to change the color, then click "OK" and "Close".
seg -line 3 DUALflat.uvl DUALFLAT*ucf
Magnify by choosing "x3" from the Zoom
menu in the "Image Display" window.
Click on the RsurrL_BIGCord (Level #7)
in the "theUvl" window.
Pull up the lines as described above.
8) The script 06_script_mk_AVG_FLAT.csh will copy the flattened lines that have not fallen off the maps into 2 directories - one for the FLATSHORTRSP3s and one for the DUALFLATSHORTRSP3s.
9) The scripts 07_script_flat_map_average_script_medial_LandR.csh and 07_script_flat_map_average_script_DUAL_medial_LandR.csh average the flattened lines to create 2 sets of targets. The left and right lines are averaged together since the right lines already have been flipped to fall in the left hemisphere's space. This means that asymmetry analysis and between subject analysis can be carried out using the same targets. Since some lines are likely to fall off one of the maps in all or almost all of the subjects, the window will say the script could not find enough lines to average when it comes to one of these lines. The number of lines averaged will not necessarily match the number of subjects in the study because different lines will have fallen off for different subjects.
10) A version of the scripts 08_script_dual_warper_COMPLETE_L_temp.csh and 08_script_dual_warper_COMPLETE_R_temp.csh will have to be created for each subject since the combination of missing and fallen off lines will be different. Include only lines that the subject has (2c, 20, 22, and 32c can be missing from each hemisphere) and only lines that did not fall off of each map. Lines that have fallen off should have been found in the LsurrR_FELL_OFF and RsurrL_FELL_OFF directories and when the flatmaps were examined. The target for warping can be changed in this script. The script will create a WARP directory under the subject number and hemisphere for which it was made and then warp the each flatmaps (LsurrR and RsurrL) to its set of target lines.
NOTE: When doing longitudinal analyses, it is important to keep in mind that different lines might fall of the same subject at time 1 and time 2, leading to differences in how anatomy will be matched. To keep matching consistent, warp using only lines that do not fall off at either time 1 or time 2.
11) Check the warped flatmap for holes and violent warps using seg (seg precise_DUALflat.uvl). The files that are most important are shown as Level 17, the LsurrR map after warping, and Level 23, the RsurrL map after warping. See Troubleshooting for information on getting rid of holes.
12) Run 09_script_decoder_blend_all.csh to blend the RsurrL and LsurrR maps together. The script opens the blended ucf for each hemisphere for each subject using vu, so it must be run from an Autarch window. The UCF should look like a hemisphere, like Figure 5. Usually a problem with the UCF will show up as lines extending far away from the hemisphere, like Figure 6. After each ucf has been checked, close the window by double clicking on the upper left corner. If a problem with the warped flatmap is discovered during this step, rerun the warping script for that subject after troubleshooting and re-run this script.
13) Run 10_script_avg_var_maps.csh. This script will add the subject numbers to the names of the flatmaps. It will then create average and variability maps for each hemisphere using all the subjects. These can be viewed with data explorer.
14) Run 11_clean_script.csh. This script will remove files that are duplicates from the LEFT_CORT and RIGHT_CORT directories, keeping all the files that exist only in one location. The shortened UCFs are removed from the CORT directories, but a copy should remain in the RSPs directory under the directory holding all the lines. The colored objects are removed from the CORT directories, but a copy should remain in the CLRD directory under the directory holding the lines. The flattened lines are removed from the WARP directories, but a copy should remain in the AVG_FLATor AVG_DUALFLAT directory.
Gray Matter Distribution
1) Binary gray volumes in which voxels inside the brain mask that segmented as gray matter have a signal value of 1 and everything else has a signal value of 0 will be needed for each hemisphere in the space in which the analysis has been done (sulcal or 305). The right hemisphere volumes should be flipped to match the object models. The script 01A_binary_gray_hemispheres.csh is an example of creating binary gray hemisphere volumes in sulcal space.
2) The script 02A_script_add_gray_to_inflated_T1_L.csh will compute the percentage of gray matter present in a 15 millimeter sphere centered at each surface point for each hemisphere for each subject. To change the radius, change the 15 after the command name. The filename of the binary gray image will have to be changed with the project.
DFCH (Distance from the Center of the Hemisphere)
1) The command ~thompson/SEG/SGI/ucf_to_centroid 1 2 3 4 5 6 average.ucf > center.ucf can be used to find the center of mass of the average hemisphere (left and right should be combined). The center of the average hemisphere of the YALE 176 group is /loni/edevel/bin/MEDIAL/center_of_hem.ucf.
2) The script 01B_calculate_dfch.csh will find the distance from each surface point to the center of the hemisphere calculated in step 1. This measure represents local brain size and can be used to compare brain size and shape across groups.
Surface Asymmetry
1) The script calc_indiv_surf_asym.csh will calculate the displacement between an individual's left hemisphere and right hemisphere. The output will be a map showing the distance between matched surface points in millimeters. These files can be used to create correlation maps showing whether surface asymmetry differs between groups.
2) To assess whether significant surface asymmetry exists, the y-coordinate of the two hemispheres should be compared using a paired T-test. The y-coordinate can be placed into the 4th dimension using the script put_y_in_4_D.csh. The left and right hemispheres' values can be compared directly; no flipping or reversing of level orders is necessary).
Gray Matter Asymmetry
1) The script calc_gray_asym_ratio.csh will calculate the ratio of gray matter on the left hemisphere to gray matter at matched surface points on the right hemisphere. The output will be a map showing the ratio of gray matter on the left to right hemisphere, with values greater than 1 showing places in which the left hemisphere has more gray matter and values less than 1 showing places in which the right hemisphere has more gray matter. These files can be used to create correlation maps showing whether gray matter asymmetry differs between groups.
2) To assess whether significant
gray matter exists, the gray matter maps for the right and left hemispheres
should be compared using a paired
T-test.
Creating ROIs
The ROIs in sulcal space should be created following the same steps that were followed in the whole brain analysis. Each ROIs in sulcal space should be pulled up as a label over an average brain volume using Display. The midline should be found in each ROI. Clear the label from the midline slice and 5 slices to each side of it and save the label as a lateral ROI. Display the whole label over the average brain again, clear everything besides the slices that were cleared previously (the 11 middle slices), and save the label as a medial ROI. The midline can be defined differently for different ROIs. Use the mincmath command to combine the lobar lateral ROIs into a lateral ROI for the whole brain and the lobar medial ROIs into a medial ROI for the whole brain ( mincmath -add lateralroi1.mnc lateralroi2.mnc lateralroi3.mnc whole_lateral.mnc. ) The ROIs that will be used with right hemisphere files should be flipped using the flip_volume command since the right hemisphere's maps have all been flipped (flip_volume roi.mnc flip_roi.mnc).
Calculating Hemisphere Volumes from Segmented Images
The script calc_thresholded_volumes_hem.csh calculates the volume of each tissue type within each hemisphere's mask. The process is very similar the that used for the whole brain; the difference is that volumes are broken down into left and right hemispheres.
Getting Data from Center Points of Medial Lines
The script get_gray_dfch_asym_at_medial_lines.csh
is
set up to find the 4th dimension at the center of the medial sulcal lines
based on coordinates from the YALE 176 group. The final output of
the script is a text file with the x, y, and z -coordinate and 4th dimension
for each line as a column and each subject as a row. This file can
be read into Systat as described in Viewing
Data in Systat. The script get_gray_dfz_at_lateral_from_medial_maps.csh
is
set up to find the 4th dimension at the center of the lateral sulcal lines
in the hemisphere maps based on coordinates from the YALE 176 group.
The output of this script can be used to compare values at matching surface
points between hemisphere analysis and whole brain analysis. This
script requires that DFZ be calculated for the medial maps; the script
/loni/edevel/bin/CREATE_FLATMAPS/1b_calculate_dfz.csh
can
be modified to do this.