A lobotomy was a neurosurgical procedure which consisted of cutting away most of the connections to and from the prefrontal cortex.
Among Vulcans, repressed memories caused a physical reaction within the brain which in extreme cases could lead to the mind of the patient literally lobotomizing itself. (VOY: "Flashback")
In 2374, Tom Paris compared the Mari's Engramatic purge, a procedure to remove violent thoughts from someone's brain, to a lobotomy. (VOY: "Random Thoughts")