## 5 Conclusions  
In this paper, we present for the first time the characterization of a GEM-based detector with optical readout based on a matrix of OPDs fabricated on top of a TFT backplane using low energy X-rays. The results presented in this paper show that the current LaGEMPix prototype achieves a spatial resolution of a few millimeters. The value obtained from the ESF using a 2.5 cm lead block underestimates the intrinsic spatial resolution when comparing it to the ability of the detector to resolve features such as two holes spaced by 3 mm. Similar conclusions can be extracted from the GEMPix measurements and the FLUKA simulation. Several avenues of investigation are being explored to improve the spatial resolution and reach the desired target for QA in hadron therapy. Considering the better spatial resolution obtained with the GEMPix, the major limitation to the spatial resolution stems from the isotropic emission of the photons, and its effect on the spatial resolution depends on the distance between the places of production and detection of the photons. Therefore, a new detector prototype is under design in which the distance between GEM3 and the readout is reduced from 3 to 1.5 mm. To further improve on spatial resolution, an optical collimator film could be placed between the ITO on quartz and the thin-film imager, such that emitted photons under larger off-normal angles to the imaging plane are prevented to reach the optical imager frontplane. Another general improvement is to employ a different type of OPD to increase the signal strength by providing a better match between the emission spectrum in the gas and the acceptance spectrum of the OPD. The ITO transparent anode with the fused quartz substrate will be replaced by the ITO coated fused silica glass following results of recent measurements [57]. Measurements with clinical hadron beams are also planned in the future. An alternative solution currently being assessed is to eliminate the OPD frontplane, leaving a TFT-only electronic readout. With this approach, secondary electrons produced in the avalanche would be directly measured by the readout, yielding an even more compact and possibly more efficient device with a higher signal-to-noise ratio. In this case, a sub-millimeter resolution can be expected based on the MTF results obtained with the GEMPix. All the authors conceptualized the system, [PERSON]; [PERSON]; [PERSON]; [PERSON] and [PERSON] contributed to the design and construction of the prototype with the help of [PERSON], [PERSON] and [PERSON] for the merging. [PERSON], [PERSON], [PERSON] and [PERSON] developed the methodology; [PERSON], [PERSON] and [PERSON] developed the software, [PERSON] collected the data and was responsible for the data curation, [PERSON] and [PERSON] contributed to the formal data analysis, [PERSON], [PERSON] and [PERSON] validated the data; [PERSON] performed the FLUKA Monte Carlo simulations; [PERSON], [PERSON], [PERSON] and [PERSON] conducted the investigation process, specifically performing the experiments. [PERSON] prepared the original draft and [PERSON] wrote Sections 2.5 and 3.5.; [PERSON] and [PERSON] supervised the research activities. [PERSON] and [PERSON] acquired the financial support for the project leading to this publication. All the authors revised the paper. All authors have read and agreed to the published version of the manuscript. This project has received funding from the ATTRACT project funded by the EC under Grant Agreement 77/7222. The project has also been supported by CERN's Budget for Knowledge Transfer to Medical Applications. [PERSON] was co-supported by a grant from FCT with reference SFRH/BEST/142965/2018.