Three Dimensional Localization With Time-Gated Photon Counting And Maximum Likelihood Analysis