A computer program for controlling a heat treatment of tissue. The computer program comprising a plurality of code segments for obtaining a measured temperature value from inside or outside a boundary of a predefined treatment lesion. The program further comprises controlling, during a warm-up period, a power output of a light source connected to a heating probe being interstitially inserted in the predefined treatment lesion, and controlling, during a treatment period, the power output for maintaining the measured temperature at a target temperature.