A mass of nervous tissue containing many cell bodies and synapses, usually enclosed in a connective-tissue sheath. In vertebrates most ganglia occur outside the central nervous system; exceptions are the basal ganglia in the brain. In invertebrates ganglia occur along the nerve cords and the most anterior pair (cerebral ganglia) are analogous to the vertebrate brain; invertebrate ganglia constitute a part of the central nervous system.