An optical coherence tomography (OCT) system comprising: at least one light source that provides a beam of light; at least one detector ; the OCT system being configured to scan a physical object that has a surface and a depth with a beam of light that has a beam width and a direction; and acquire OCT signals from the scan; the OCT system further comprising at least one processor being configured to obtain and analyze the OCT signals formed by the at least one detector and form at least one image of the physical object ; generate discretized A-scan data and B-scan data from the acquired OCT signals; assign the discretized A-scan data into pixels; form at least one B-scan cluster set using the acquired OCT signals that each includes at least one B-scan cluster that includes at least two B-scans that are parallel to one another and form planes that are parallel to the direction of the beam of light; form B-scan pairs from the at least two B-scans in each B-scan cluster; calculate a total phase error for each B-scan pair before any shift of any B-scan and then shift one B-scan of each B-scan pair at least two times, or shift one B-scan of each B-scan pair at least three times; wherein each shift is one pixel and in a direction parallel to the beam of light; calculate a total phase error for each B-scan pair after each shift; identify the smallest calculated total phase error among all of the calculated total phase errors for each B-scan pair; identify the shift amount for each B-scan pair that resulted in the identified smallest calculated total phase error; calculate a cumulative axial shift for each B-scan within the at least one B-scan cluster; and align all B-scans within the at least one B-scan cluster. at least one light source that provides a beam of light; at least one detector ; the OCT system being configured to scan a physical object that has a surface and a depth with a beam of light that has a beam width and a direction; and acquire OCT signals from the scan; the OCT system further comprising at least one processor being configured to obtain and analyze the OCT signals formed by the at least one detector and form at least one image of the physical object ; generate discretized A-scan data and B-scan data from the acquired OCT signals; assign the discretized A-scan data into pixels; form at least one B-scan cluster set using the acquired OCT signals that each includes at least one B-scan cluster that includes at least two B-scans that are parallel to one another and form planes that are parallel to the direction of the beam of light; form B-scan pairs from the at least two B-scans in each B-scan cluster; calculate a total phase error for each B-scan pair before any shift of any B-scan and then shift one B-scan of each B-scan pair at least two times, or shift one B-scan of each B-scan pair at least three times; calculate a total phase error for each B-scan pair before any shift of any B-scan and then shift one B-scan of each B-scan pair at least two times, or shift one B-scan of each B-scan pair at least three times; wherein each shift is one pixel and in a direction parallel to the beam of light; calculate a total phase error for each B-scan pair after each shift; identify the smallest calculated total phase error among all of the calculated total phase errors for each B-scan pair; identify the shift amount for each B-scan pair that resulted in the identified smallest calculated total phase error; calculate a cumulative axial shift for each B-scan within the at least one B-scan cluster; and align all B-scans within the at least one B-scan cluster. <EOS>