Hemisphere Masking

This is the protocol currently in use by EDEVEL group.

We are masking hemispheres in the Yale data set.  Brain masks exist for each of the 176 brains used in analysis and by using these we can obtain a hemisphere mask.  The whole brain masks are called Subject#_reslice_mask_1mm_new_blur_label.mnc.gz and the hemisphere masks will be called Subject#_reslice_mask_1mm_R_nocereb.mnc and Subject#_reslice_mask_1mm_L_nocereb.mnc.

Begin by accessing the desired directory.

cd/loni/edevel/YALE_hemisphere/563
ls
LEFT HEMISPHERE:
Open the rf-corrected reslice mr and the blurred label in display.
Display 563_reslice_mr_rf_new.mnc.gz -label 563_reslice_mask_1mm_new_blur_label.mnc.gz
There should be an orangish mr and an orange brain mask in the Display window (figure 1).

*Specific to YALE* Before begining to mask, it is necessary to save the whole brain label with the crop save labels off.  On the display menu bar, select "T" file menu, "1" to turn crop save label: OFF, "W" save labels .mnc  The unix shell will ask for a filename.

563_reslice_mask_1mm_new_blur_label.mnc
Change the mr to gray scale.  In the Display menu select: "space" pop menu, "D" color coding menu, "D" gray scale.  Change the label opacity so the mr can be seen beneath: "C" label opacity.  The unix shell will ask for a new label color opacity.  Type ".3"  Now adjust the contrast bar on the left so that the csf is dark underneath the label and the brain can be seen (figure 2).

In the sagittal view find the center slice to erase the corpus callosum in.  This is easily done by clicking on and around the corpus callosum in the sagittal view and following the curser in the coronal plane.  Is is probably necessary to zoom in on the images by pressing the middle mouse button and shift as you slide the mouse up in each view.  (figure 3 and figure 4)  When the center slice has been established, erase the corpus callosum, brain stem, and cerebellum in the sagittal slice by pressing shift and the right mouse button (figure 5).

Since we will be removing the cerebellum as well, we will need to set a plane in the brain stem which we will not remove above.  Set this plane by moving the curser to the point at the top crux of the pons and the brain stem in the same sagittal slice where the corpus callosum midline was established (figure 6).  Enlarge the axial view.  A smaller brush size is now necessary so in the Display menu, select "space" pop menu, "F" segmenting menu, "F" XY radius:  In the shell it asks for xy brush size.  Type "0".  Erase the brain stem in this axial plane (figure 7).

Now begin masking the left hempsphere by erasing the right.  Begin in the most anterior coronal slice in which there is a label and erase the right hemisphere.  In the display menu select, "space" pop menu, "F" segmenting menu, "T" clear fill to clear a label.  Be sure that the right hempsphere label is not touching the left hemisphere label when you select clear fill or you will clear all of the label in that slice.  If this is done, select "7" undo, to undo the mistake and erase the leak.  The first few slices are usually not touching so it is easy to clear the right hemisphere label.  Watch out for dura between the hemispheres and be sure to erase any that may be included in the mask.  It will interfere with the 3-D midline extraction. (figure 8, Midline erased: figure 9, Right Hem (and dura) Clear Fill: figure 10)  With the curser in the coronal view move back to the next slice by pressing the "-" key on the keyboard.  Erase the right hemisphere in this slice and continue back slice by slice in this manner.

When you reach the level at which you established a corpus callosum midline, it will be necessary to only erase the midline above and below this section.  Another region to watch out for is when the temporal lobes begin to appear.  Often the first few slices aren't connected to the rest of the brain and therefore will not get erased with the Clear Fill.  Check to be sure the right temporal lobes are completely erased as well.

Some left hemisphere mask examples:  (figure 11, figure 12, figure 13)

The next region to be on the lookout for is the anterior portion of the cerebellum.  It will be seen coming in between the brain stem and temporal lobes as you move posterior.  In the anterior-most slice in which the cerebellum can be seen, erase it and the bottom portion of the brain stem (to the plane that was erased earlier).  (figure 14, Erased line separating: figure 15, Cleared cerebellum and brain stem: figure 16)  Scroll back through the slices anterior to the anterior most portion of the cerebellum, filling in the erased line through the brian stem.

Continue erasing the right hemisphere, cerebellum, and inferior portion of the brain stem (figure 17, figure 18).  When you are posterior to the brain stem, erase the right hemisphere and cerebellum (figure 19).
 

Sometimes there is not visible CSF between the cerebrum and cerebellum and it may be hard to tell where a bit of tissue belongs.  Use the other views to help in this case, and if it is still unclear, include it in the label.  It is better to include a little extra than to exclude brain we want.

When you have finished masking the left hemisphere, scroll back through to the front slice by slice ("+" key on the keyboard) looking for random labeled pixels that may have been missed or any other mistakes.  Look especially in the cerebellum and temporal lobe regions.  Sometimes they are hard to see in the very dark regions so it is a good idea to adjust the contrast bar on the left so that brain is lighter.

Then save the labels.  On the display menu, select "space" pop menu, "T" file menu, "W" save labels .mnc (Crop save labels should still be OFF).  At the prompt type the filename of the left hemisphere mask

563_reslice_mask_1mm_L_nocereb.mnc
Once the label has been saved, quit out of Display: "7"quit, "Z" really quit.

In the unix shell, gzip the masks. (Yes, ok to overwrite the old whole brain mask)

gzip *.mnc
To create a mask for the right hemisphere, we will essentially subtract the new left hemisphere mask from the whole brain mask with 2 commands.  The first command turns the left label into zeros.  The second command multiplies the whole brain label by the zero-left brain label resulting in a right brain label.
mincmath -not 563_reslice_mask_1mm_L_nocereb.mnc total-left.mnc

mincmath -mult 563_reslice_mask_1mm_new_blur_label.mnc.gz total-left.mnc 563_reslice_mask_1mm_R_nocereb.mnc


RIGHT HEMISPHERE:
It is necessary to touch up the right brain label and remove the cerebellum from the label.

Open the mr and the right hemisphere label in display.

Display 563_reslice_mr_rf_new.mnc.gz -label 563_reslice_mask_1mm_R_nocereb.mnc
Adjust the image as before.  Change the mr to gray scale.  In the Display menu select: "space" pop menu, "D" color coding menu, "D" gray scale.  Change the label opacity so the mr can be seen beneath: "C" label opacity.  The unix shell will ask for a new label color opacity.  Type ".3"  Now adjust the contrast bar on the left so that the csf is dark underneath the label and the brain can be seen (figure 20).

Since we will be removing the cerebellum as well, we will need to set a plane in the brain stem which we will not remove above.  Set this plane by moving the curser to the point at the top crux of the pons and the brain stem in the same sagittal slice where the corpus callosum midline was established (figure 21).  Enlarge the axial view.  A smaller brush size is now necessary so in the Display menu, select "space" pop menu, "F" segmenting menu, "F" XY radius:  In the shell it asks for xy brush size.  Type "0".  Erase the brain stem in this axial plane (figure 22)

In the coronal view, begin in the most anterior section scrolling back slice by slice, touching up the mask.  Be sure to erase dura along the midline that is included in the mask (figure 23 & figure 24).  It may be necessary to add some pixels along the midline to the mask as well.

When the cerebellum is visible below the right temporal lobe, erase it and the brain stem up to the plane that was previously erased (figure 25 & figure 26).  Then scroll anterior filling in the strip of brain stem that was erased (slices where cerebellum is not present).  Continue posterior slice by slice, touching up the midline and removing the cerebellum (figure 27 & figure 28).  After finishing the label, scroll anterior through the brain looking for missed pixels or other mistakes.  It helps to see the label if the brain is lighter so adjust the contrast bar on the left.

Save the labels.  On the display menu, select "space" pop menu, "T" file menu, "1" crop save labels (turn OFF) "W" save labels .mnc.  At the prompt type the filename of the right hemisphere mask.

563_reslice_mask_1mm_R_nocereb.mnc
(Yes, ok to overwrite the old right hemisphere mask)

Once the label has been saved, quit out of Display: "7"quit, "Z" really quit.

In the unix shell, gzip the mask.

gzip *.mnc