An analysis software was developed for the high aspect ratio optical scanning system in the Detec- tor Laboratory of the University of Helsinki and the Helsinki Institute of Physics. The system is used e.g. in the quality assurance of the GEM-TPC detectors being developed for the beam diagnostics system of the SuperFRS at future FAIR facility. The software was tested by analyzing five CERN standard GEM foils scanned with the optical scanning system. The measurement uncertainty of the diameter of the GEM holes and the pitch of the hole pattern was found to be 0.5 {mu}m and 0.3 {mu}m, respectively. The software design and the performance are discussed. The correlation between the GEM hole size distribution and the corresponding gain variation was studied by comparing them against a detailed gain mapping of a foil and a set of six lower precision control measurements. It can be seen that a qualitative estimation of the behavior of the local variation in gain across the GEM foil can be made based on the measured sizes of the outer and inner holes.