The basal ganglia form a fundamental component of the cerebrum. In contrast to the cortical layer that lines the surface of the forebrain, the basal ganglia are a collection of distinct masses of gray matter lying deep in the brain not far from the junction of the thalamus. They lie to the side of and surround the thalamus. Like most parts of the brain, the basal ganglia consist of left and right sides that are virtual mirror images of each other.