Sample thickness can be estimated using twoBeamGUI from a convergent beam electron diffraction pattern (CBED) in two beam approximation. The procedure is based on an automated extraction of the intensity profile across the diffracted disk in the following steps:
# diffraction disk radius is determined using multi-scale Hough transform,
# the transmitted and diffracted disks are localized and the reflection is indexed,
# the disks are horizontally aligned, cropped out and profiles are measured across the disks,
# the profile across the diffracted disk is matched with a series of profiles automatically simulated for given material, reflection and specified thickness range.
Once the procedure is completed, the measured profile and the most similar simulated profile are displayed with the diffracted disk on the background. This allows the user to verify correctness of the automated estimate and easily check the similarity of other intensity profiles within the specified thickness range.