# Image Quality Improvement and Memory-Saving in a Permanent-Magnet-Array-Based MRI System
## 4 The Memory-Saving Reconstruction  
To make the encoding matrix sparse, it can be done by transforming the matrix from time domain to frequency domain by 1D fast Fourier transfer (FFT) [15; 17]. Figure 7 shows an illustration of the transformation. As shown in Figure 7a, each element in each row in \(\tilde{E}\) (time domain) contains the encoding information of each image pixel. By doing the FFT along the readout direction, as shown in Figure 7c, the distribution of the row in the resultant matrix in frequency domain concentrates in a much smaller area (Figure 7d) rather than widely spread out in time domain (Figure 7b), which makes the matrix in frequency domain much sparser than that in time domain. For the plots in time domain and in frequency domain as shown in Figure 7b,d, respectively, the data from the first row of the encoding matrices were used. The non-linear SEM in Figure 2b1 was used with a total rotation angle number (\(N_{\theta}\)) of 72, the maximum rotation angle (\(\theta_{\text{Max}}\)) of 2\(\pi\), and a number of the total sampling points (\(N_{t}\)) of 256. As shown in Figure 7, in the time domain, most of the entries of the encoding matrix contribute to the signal point equally, whereas in the frequency domain, only the entries from a narrow area (the bright curve) have countable contributions to the signal point. By doing FFT for the signal array and the encoding matrix, Equation (7) is rewritten as below,  
\[DFT(\tilde{s})=DFT(\tilde{E})\bar{m} \tag{7}\]  
where the 1D FFT of \(\tilde{E}\) in Equation (3) is column-wise. Let \(DFT(\tilde{s})=\tilde{f}\), \(DFT(\tilde{E})=\tilde{E}_{f}\), Equation (7) can be re-written as following,  
\[\tilde{f}=\tilde{E}_{f}\bar{m} \tag{8}\]  
Solving Equation (8) gives the same reconstructed image as that by solving Equation (3) yet the encoding matrix in Equation (8) is much more sparse than that in Equation (3). The transformation results in a much sparser matrix for image reconstruction, which will lead to a reduction in the memory that is required. Furthermore, to further reduce the memory consumption during the image reconstruct, for the sparse encoding matrix in the frequency domain in Equation (8), the entries that are relatively small are zeroed/truncated. A row-wise truncation of the encoding matrix is used where the truncation is conducted based on the maximum value of the entries of each row. The row-wise truncation further reduces the memory slightly compared to a global one [17] where the global truncation is used as a  
Figure 7: The sequence of memory-saving method on the encoding matrix \(\tilde{E}\) in time domain. (**a**) the encoding matrix \(\tilde{E}\) in time domain; (**b**) a 2D plot of one \(1\times N_{t}N_{r}\) row in \(\tilde{E}\) re-arranged into a \(N_{r}\times N_{r}\) matrix in time domain; (**c**) a 2D plot of one \(1\times N_{r}N_{r}\) row in \(\tilde{E}\) after it is converted to frequency domain using 1D FFT and re-arranged into a \(N_{r}\times N_{r}\) matrix in frequency domain. reference value for a truncation. Denote the row-wise threshold in percentage as \(th_{\text{r-w}}\), Equation (8) can be re-expressed as,  
\[\bar{f}=\bar{\bar{E}}_{f-th_{\text{r-w}}}\bar{m} \tag{9}\]  
where \(\bar{\bar{E}}_{f-th_{\text{r-w}}}\) is the encoding matrix after the row-wise truncation. In \(\bar{\bar{E}}_{f-th_{\text{r-w}}}\), the entries in each row are zeroed when they are less than \(th_{\text{r-w}}\) percent of the maximum values of the entries in that row. Table 2 shows the memory consumption of the system with \(N_{\theta}=90\) and \(N_{t}=512\) when the image reconstruction was conducted in the frequency domain. As shown in Table 2, when the threshold was set at 5%, the total memory for calculation was reduced from 15,617 MB to 4436 MB by 71.6%. When this threshold increases, the total memory drops further, i.e., a further reduction of 294 MB when the threshold increases from 5% to 50%. It is noticed that the decrease rate in memory slow down when the threshold is more than 5%.