Engramatic purge
An engramatic purge or engramatic extraction was a medical procedure used by the Mari which could erase memory engrams, remove certain images, and/or modify behavior. It carried some risk of neurological damage.

In 2374,  B'Elanna Torres was arrested by the Mari for having violent thoughts. The sentence to be carried out against her was an engramatic purge of those violent thoughts. Fortunately, Lieutenant Commander Tuvok was able to prevent the procedure from being carried out by proving that Torres's violent thought had been deliberately provoked, with The Doctor subsequently managing to repair the minor neurological damage that Torres had sustained before Tuvok had been able to produce his evidence. 

Tom Paris angrily called the procedure a lobotomy. ()

de: Engrammatische Reinigung
Medical procedures
Punishments