Cortical Stimulation Mapping is a fairly gruesome procedure used by neurosurgeons prior to brain surgery to determine what bits of brain they can safely remove without causing serious loss of motor, sensory, or communication/language abilities.
First, the patient is put to sleep, and then an area of scalp is peeled back and a portion of skull is removed. The meninges are peeled away from the brain, leaving a large section of brain completely exposed. Then, they wake the patient up. After the patient is relatively calm, they begin asking the patient to perform simple tasks (like object naming, counting, reading words aloud, etc.) while electrically stimulating small areas of the cerebral cortex. If stimulation of an area produces a change in the patient's ability to perform a task, the physician labels this area with a little, sterile, numbered paper (brain post-it notes!). When the procedure is complete, the surgeon has a map of all the critical language, sensory, and motor areas that he or she must avoid when operating on the patient.