added temperature parameter for the distance transform