## 2 Materials and Methods  
In this study, we have developed a modified CASH approach for extending the CAI method to the online FTIRm system of the Australian Synchrotron with a 36\(\times\) SOL as the coded aperture. In this method, the 36\(\times\) SOL of the FTIRm system was retained, unlike in [12], and a scanning approach has been introduced with the single pixel MCT detector. The schematic of the FTIRm system is shown in Figure 1. The IR beam is extracted along with X-rays from the synchrotron, and the X-rays are removed by a gold coated mirror with a central slit as shown in Figure 1. This unique extraction results in a fork-shaped beam, as shown in the same figure. This FTIRm system consists of 765 channels ranging from 899 to 3845 cm\({}^{-1}\). The intensity of the IR synchrotron beam is >10\({}^{5}\) times that of a Globar source. The FTIRm system consists of a visible lamp that generates white light which is aligned collinearly with the IR beam to achieve optical alignment, as the IR beam is invisible to the human eye. Both visible and IR beams were collected and focused on the sample plane using a 36\(\times\) SOL. The light from the sample plane is collected by another 36\(\times\) SOL and reimaged using a high-resolution visible camera and an IR sensor. The IR sensor can be either a single pixel MCT detector or a 64 \(\times\) 64 FPA detector. In this study, a single pixel MCT detector has been used. In the FTIRm system, in principle, two microscopes (visible and MIR microscopes) are integrated. Since the MIR beam is not visible to the human eye, visible light is used as a guiding beam for sample mounting and the calibration procedure. Microscopy with visible light is well established with sophisticated refractive lenses. Refractive lenses are indicated by the letter L in Figure 1, and work based on the principles of refraction. However, microscopy with an IR beam is complicated, because manufacturing lenses on calcium fluoride and barium fluoride substrates is challenging, and so for microscopy with IR to work, reflective optics are used. The mirrors indicated by the letter M in Figure 1 are all concave mirrors. The MSP has been used to switch between visible and IR imaging modes for sample alignment and calibration. The visible microscope works based on both refractive as well as reflective optics, whereas the IR microscope works based on only reflective optics. The aperture stops indicated by the letter 'A' are used to reduce aberrations at the expense of light throughput. In the conventional direct imaging mode, there is point-to-point mapping, i.e., every object point creates an image point. Since the synchrotron beam is spatially incoherent, there is only intensity addition between neighbouring points, unlike complex addition as in coherent light sources. The image formation can be expressed as \(I_{\text{O}}=O\bigotimes I_{\text{PSF}}\), where \(O\) is the object information, \(I_{\text{O}}\) is the recorded image, \(I_{\text{PSF}}\) is the diffraction limited spot, and '\(\otimes\)' is a 2D convolutional operator. As it is seen, the object information \(O\) is sampled by the diffraction limited spot. If the NA is large, then the spot size is small and a better sample is obtained. If the NA is small, then the spot size is large resulting in a poor sample and blurred image. When there is an axial aberration due to the object distance not meeting the imaging condition \(1/u+1/v=1/f\), a blurred image of the object is obtained even with a large NA, where \(u\), \(v\), and \(f\) are the object, image distances, and focal length, respectively. This condition prevails in all planes which do not satisfy the imaging condition. Therefore, in order to image such planes, it is necessary to repeat the imaging process after achieving the imaging condition for those planes. Therefore, in direct imaging mode, the imaging process is time consuming, resulting in a total of \(M^{2}N\) camera shots, where \(M\) is the number of pixels along the \(x\) and \(y\) directions and \(N\) is the number of planes.