Creating Cortical Objects (5/02)

This is the protocol currently in use by EDEVEL group. (analyses: YALE, YALE2, leonard)

After the brains of a group of subjects have been masked, cortical objects are created.  To create cortical objects, follow the steps outlined below.  A copy of all scripts can be found in ~swelcome/SCRIPTS/CREATE_CORTICAL_OBJS.  Be sure to edit each script so they are referring to the desired directories and subjects.
NOTE: Many of the scripts run in the batch queue.  Use XPBS to check on the job progress (make sure it is complete) before continuing to the next step.  Every job in the batch queue will also output 2 files (standard error and output files with the process id number in the filename), which may be viewed to investigate problems.


Useful terms

1) Run 1_dilate_blur_mask.csh This script dilates the mask to include the CSF on the brain's surface and blurs the edges.  The final output is called {case#}_reslice_mask_1mm_blur.mnc.
2) Open the mask created in step 1 as a label over the reslice_mr volume.
Display case#_reslice_mr.mnc -label case#_reslice_mask_1mm_blur.mnc
The label is now in 1mm slices and is red.  Fill in CSF holes left in the ventricles and other sub cortical regions.  This is easiest to do if the raw image is in Gray Scale ("D" Color Coding menu) and the brush size is set to 10 (in "F" Segmenting menu: "F" XY Radius).  Overwrite the {case#}_reslice_mask_1mm_blur.mnc file to save.
case#_resliced_mask_1mm_blur.mnc
3) Run 2_nu_correct.csh.  This script uses the batch queue to run nu-correct, which reduces magnet inhomogeneity.  As with any script running in the batch queue, use XPBS to check on the progress before continuing on to the next step.  Output files have "rf" in the filename. NOTE: The number of iterations can be modified if necessary depending on severity of artifact in the mr images.  (The Leonard data required 200it.)
4) Run 3_skull_stripping.csh.  This script uses the segmentation tags to segment the rf-corrected volume created in step 3.  It uses the mask saved in step 2 to eliminate the skull in seg_rf, native_mr_rf, and reslice_mr_rf volumes.  The volumes without skull have "brain" in the filename.
5) Run 4_create_air_files.csh.  This script creates an air file, which will align each subject's brain with a standard brain (the average of 305 individuals).  To do this, the minc files must be converted to imgs, which occurs in this script as well.
6) Run 5_create_305_mnc.csh.  This script applies the air file to transform the reslice_mr_rf_brain into 305 space.  The imgs are then converted into minc format.
7) Open the {$subject}_avg_305_AIR1ord.mnc file in Display for each subject to determine a threshold for extracting the surface.  The threshold will be between the gray matter and fluid signal values.
Display case#_avg_305_AIR1ord.mnc
Looking at the histogram next to the contrast bar, place the bottom marker on the contrast bar at the point at which the slope begins to rise to the first peak (end of fluid signal intensities) and the other at the highest point of the first peak (gray matter signal intensities).  Calculate the value directly in between these two points (the average) Figure 1.  This will be the threshold for this subject.  Perform step 8, and repeat this process for each subject.
8) For each subject, nedit 6_create_cortical_objects.csh to include the subject number and threshold determined in step 7, a threshold .003 below this value, a threshold .006 below this value, a threshold .003 above this value, and a threshold .006 above this value. (ie. the threshold in step 7 was [.114], so the values in this script will be [.008 .111 .114 .117 .120].)
Use XPBS to check on the progress before continuing on to the next step.  It will take about 15 minutes for the objs to be created.  The ouput obj file is the cortical surface model. The value included in the file name is the threshold used to distinguish between gray matter and CSF.
10) In Display, select the object at which the cortical extraction looks best.
Display *.obj
In the menu box, each object will be listed on the right hand side.  Starting with the lowest threshold (number in filename), select the obj by clicking on it.  Then make it invisible by typing:
If a threshold is too high, the object with look too atrophied: Figure 2.  If a threshold is too low, the object will look too smooth: Figure 3.  Choose the object that looks good, closest to the center threshold (the one originally determined in step 7).  Delete the other objs from the subject's directory.  Repeat this for all subjects.  Example of 5 thresholds: Figure 4 in this example .114 was the threshold chosen.
9) Run 7_skull_strip_clean.csh to remove files that will not be used in further analysis and gzip those that take up a lot of space.

 

*NOTE: Sometimes the dilate and blur in the first step does not dilate far enough at the edge of the mask, and CSF gets missed.  Before creating csfonly mincs, it is necessary to fill in the areas inside the dura that segment as CSF.  To do this, open the rf-corrected segmented image and the blur_label.
Display case#_reslice_seg_rf.mnc.gz -label case#_reslice_mask_1mm_blur_label.mnc.gz case#_reslice_mr_rf.mnc.gz
Adjust the color of the segmented image so that each tissue type is a different color and missed csf is easy to see.  Usually it is adequate to leave the image in "hot metal" and to raise the top line of the color bar to the top (4) and leave the bottom on 1.  Increase the brush size to 3 ("F" Segmenting Menu & "F" XY Radius).  Set the threshold so as to only paint csf and background pixels ("F" Segmenting Menu & "Y" Set Threshold  Type "2.9 4.1" for the new threshold)  Progress slice-by-slice from anterior to posterior filling in CSF at the outer edge of the brain, inside the dura.  Missing CSF: Figure 5a, Figure 5b  Filled in: Figure 6a, Figure 6b
When the label is done, save the brain mask with addcsf in the filename. To do this, type:
case#_reslice_mask_1mm_blur_label_addcsf.mnc
Please see Surface Curve Drawing and Cortical Modeling protocol to draw lateral sulcal lines on the surface extraction.

Back to Protocols.

If you have any questions, please e-mail:

esowell@loni.ucla.edu


Updated by Amy and Suzanne (5/02)