The present disclosure provides a visualization system for performing optimized optical coherence tomography (OCT) by determining the absolute distance between the OCT source and a sample. The present disclosure also provides a method for optimizing OCT, which includes determining an absolute distance between the OCT source and a sample using data relating to the focal length or position of an autofocus imager lens.