Methods for treating an infection in a tissue sample are described. Tissue samples that are harvested from a patient may be infected with either bacteria or a virus. A rhodamine compound is mixed with the infected tissue sample to form a mixture. The mixture is then exposed to radiant energy to inhibit or kill the bacteria. The exposed mixture is then transplanted into the patient. The rhodamine compounds may be 2′-(6-dimethylamino-3-dimethylimino-3H-xanthen-9-yl) 4′, 5′-dichloro-benzoic acid methyl ester hydrochloride.