Quantitative light dosimetry in vitro and in vivo