Pathophysiology
The brain itself is not sensitive to pain, because it lacks pain receptors. However, several areas of the head and neck do have pain receptors and can thus sense pain. These include the extracranial arteries, middle meningeal artery, large veins, venous sinuses, cranial and spinal nerves, head and neck muscles, the meninges, falx cerebri, parts of the brainstem, eyes, ears, teeth, and lining of the mouth. Pial arteries, rather than pial veins are responsible for pain production.Headaches often result from traction to or irritation of the meninges and blood vessels. The pain receptors may be stimulated by head trauma or tumors and cause headaches. Blood vessel spasms, dilated blood vessels, inflammation or infection of meninges and muscular tension can also stimulate pain receptors. Once stimulated, a nociceptor sends a message up the length of the nerve fiber to the nerve cells in the brain, signalling that a part of the body hurts.Primary headaches are more difficult to understand than secondary headaches. The exact mechanisms which cause migraines, tension headaches and cluster headaches are not known. There have been different hypotheses over time that attempt to explain what happens in the brain to cause these headaches.Migraines are currently thought to be caused by dysfunction of the nerves in the brain. Previously, migraines were thought to be caused by a primary problem with the blood vessels in the brain.
MRI is more sensitive for identifying intracranial problems, however it can pick up brain abnormalities that are not relevant to the persons headaches.The American College of Radiology recommends the following imaging tests for different specific situations:

Lumbar puncture
A lumbar puncture is a procedure in which cerebral spinal fluid is removed from the spine with a needle. A lumbar puncture is necessary to look for infection or blood in the spinal fluid. A lumbar puncture can also evaluate the pressure in the spinal column, which can be useful for people with idiopathic intracranial hypertension (usually young, obese women who have increased intracranial pressure), or other causes of increased intracranial pressure. In most cases, a CT scan should be done first. Classification
Headaches are most thoroughly classified by the International Headache Societys International Classification of Headache Disorders (ICHD), which published the second edition in 2004. The third edition of the International Headache Classification was published in 2013 in a beta version ahead of the final version. This classification is accepted by the WHO.Other classification systems exist. One of the first published attempts was in 1951. The US National Institutes of Health developed a classification system in 1962. ICHD-2
The International Classification of Headache Disorders (ICHD) is an in-depth hierarchical classification of headaches published by the International Headache Society. It contains explicit (operational) diagnostic criteria for headache disorders. The first version of the classification, ICHD-1, was published in 1988. The current revision, ICHD-2, was published in 2004. The classification uses numeric codes. The top, one-digit diagnostic level includes 14 headache groups.