Flowchart of the system control software. Imaging control includes programming and synchronization of PCIe based DAQ board and camera link frame grabber. Two stepper motor based translation stages have the same control flowchart. In “Home” process, the stepper motor receives the command to find the “zero” position according to the built-in limit switch. In “Test” process, the program constantly queries the status of the motor until receiving an “Idle” signal, which indicates that the stage finishes translation and is ready for next command. This is function is designed for spectrometer alignment and system debugging by system engineers and inaccessible for clinical imaging technicians. All the slave loops also use state machine architecture. ML, master loop; Spec SL, the slave loop for displaying spectral interferogram in real time; OCT SL, the slave loop for OCT acquisition; Proc SL, the slave loop for offline OCT image reconstruction and processing; OCT, optical coherence tomography.