# Image Quality Improvement and Memory-Saving in a Permanent-Magnet-Array-Based MRI System
## 2 Theory
### Effects on Memory Consumption  
During the image reconstruction, the requirement on the memory of the computer depends on the algorithm and the size of matrix. As shown in Equation (5), the need for memory mainly comes from \(\vec{E}^{\dagger}\vec{E}\), \(\vec{E}\), and \(\vec{s}\) matrix in conjugate gradient methods. Table 1 tabulates the details of the memory consumption for each matrix in different systems. In the system in Equation (5), the size of both the encoding matrix (\(\vec{E}\)) and the signal array (\(\vec{s}\)) increase linearly with an increase in \(N_{\theta}\) and \(N_{t}\). In terms of the memory consumption, as shown in the table, those consumed by \(\vec{E}\), \(\vec{s}\), and the total memory increase with an increment in \(N_{t}\) and/or \(N_{\theta}\). When \(N_{t}\) is increased from 128 to 512 when \(N_{\theta}=90\), The memory consumed by \(\vec{E}\) increases from 2880 MB to 11,520 MB, that by \(\vec{s}\) increases from 0.1758 MB to 0.7031 MB, and the total memory increases from 6976 MB to 15,617 MB. On the other hand, it is noticed that \(\vec{E}^{\dagger}\vec{E}\) has a fixed memory consumption (4096 MB) while that of \(\vec{E}\) increases from 2880 MB to 11,520 MB.  
For the encoding matrix \(\vec{E}\), as indicated by the expression of its entry in Equation (4), the row number of \(\vec{E}\) is decided by the number of sampling points (\(N_{t}\)), rotation angles (\(N_{\theta}\)) and receive coils (\(N_{a}\)) meanwhile the column number of \(\vec{E}\) always equal to the number of pixels in the target image (\(N_{r}N_{r}\)). Therefore, when \(N_{t}\) or \(N_{\theta}\) increases, the memory consumption of \(\vec{E}\) increases linearly with them, as can be seen in Table 1. On the other hand, the Hermite positive semi-definite matrix, \(\vec{A}=\vec{E}^{\dagger}\vec{E}\), has a size fixed at \(N_{r}N_{r}\,\times\,N_{r}N_{r}\). Therefore, the memory consumption does not increase with an increase in either the number of sampling point or the number of rotation angles. As shown in Table 1, the increase in the total memory required is mainly caused by an increase in the memory of the encoding matrix.  
To improve the image quality in a PMA-based system, it has been shown that increasing \(N_{t}\) or/and \(N_{\theta}\) are effective approaches. However, taking this approach can considerably higher the memory required for image reconstruction, which makes it difficult to be handled by a handheld computer. In the example when \(N_{t}\) increases from 128 to 512 when \(N_{\theta}=90\) shown in Table 1, the memory requirement increases from around 7 GB to more than 14 GB, which is easily doubled. In reality, to obtain good image quality by increasing the number of sampling points or rotation angles, denser sampling points are needed and the required memory can easily go beyond the memory of a normal laptop (e.g., 64 GB). Therefore, image reconstruction that requires memory that can be handled  
\begin{table}
\begin{tabular}{l l l l l} \hline  & \(\vec{A}=\vec{E}^{\dagger}\vec{E}\) & \(\vec{E}\) & \(\vec{s}\) & **Total** \\ \hline \(N_{\theta}=90\), \(N_{t}=128\) & 4096 MB & 2880 MB & 0.1758 MB & 6976 MB \\ \(N_{\theta}=180\), \(N_{t}=128\) & 4096 MB & 5760 MB & 0.3515 MB & 9856 MB \\ \(N_{\theta}=90\), \(N_{t}=256\) & 4096 MB & 5760 MB & 0.3515 MB & 9856 MB \\ \(N_{\theta}=360\), \(N_{t}=128\) & 4096 MB & 11,520 MB & 0.7031 MB & 15,617 MB \\ \(N_{\theta}=180\), \(N_{t}=256\) & 4096 MB & 11,520 MB & 0.7031 MB & 15,617 MB \\ \(N_{\theta}=90\), \(N_{t}=512\) & 4096 MB & 11,520 MB & 0.7031 MB & 15,617 MB \\ \hline \end{tabular}
\end{table}
Table 1: The memory occupation in image reconstruction.  
by a portable computer is crucial. In the next section, we make the encoding matrix sparse for a memory-saving image reconstruction in such a PMA-based MRI system.