# CycleGAN-Driven MR-Based Pseudo-CT Synthesis for Knee Imaging Studies
## 2 Materials and Methods
### Evaluation Metrics  
Differences between the synthesized and ground-truth CT were assessed voxel-wise. Only voxels included in the knee were used for comparison, avoiding the inclusion of the background in the computation of the metrics.  
Relative Change (RC) maps were calculated in a voxel-wise manner for qualitative assessment following Equation (2):  
\[RC(x,y,z)=\frac{pCT(x,y,z)-CT(x,y,z)}{|CT(x,y,z)|+\epsilon}, \tag{2}\]  
where \(\epsilon=0.001\) and pCT(x,y,z) and CT(x,y,z) denote the voxel values at a given (x,y,z) image position of the pseudo-CT and ground-truth CT, respectively.  
Voxel-by-voxel correlation plots, Bland-Altman plots, bias, and variability Pearson correlation coefficients were calculated for quantitative comparisons. Statistical significance was considered when the p value was lower than 0.01.  
The Mean Absolute Error (MAE), Peak Signal-to-Noise Ratio (PSNR), Structural Similarity Index Measure (SSIM), Zero-Normalized Cross Correlation (ZNCC), Mutual Information (MI), Relative Change (RC), and absolute Relative Change ( 1 RC ) metrics were computed to quantitatively measure the quality of the synthesized pseudo-CT volumes compared with the ground-truth CT volumes, following Equations (3)-(9):  
\[MAE=\frac{1}{N}\sum_{x,y,z}|pCT(x,y,z)-CT(x,y,z)|, \tag{3}\]  
\[PSNR=10 log_{10}(\frac{MAX^{2}}{\frac{1}{N}\sum_{x,y,z}(pCT(x,y,z)-CT(x,y,z))^{2 }}), \tag{4}\]  
\[SSIM=\frac{(2\mu_{pCT}\mu_{CT}+C_{1})+(2\sigma_{pCT,CT}+C_{2})}{(\mu_{pCT}^{2} +\mu_{CT}^{2}+C_{1})(\sigma_{pCT}^{2}+\sigma_{CT}^{2}+C_{2})}, \tag{5}\]  
\[ZNCC=\frac{1}{N}\sum_{x,y,z}\frac{(pCT(x,y,z)-\mu_{pCT})(CT(x,y,z)-\mu_{CT})}{ \sigma_{pCT}\sigma_{CT}}, \tag{6}\]  
\[MI=H(CT)+H(pCT)-H(CT,pCT), \tag{7}\]  
\[RC= \frac{1}{N}\sum_{x,y,z}\frac{pCT(x,y,z)-CT(x,y,z)}{|CT(x,y,z)|+\varepsilon}, \tag{8}\]  
\[|RC|= \frac{1}{N}\sum_{x,y,z}\frac{|pCT(x,y,z)-CT(x,y,z)|}{|CT(x,y,z)|+\varepsilon}, \tag{9}\]  
where, again, \(x\), \(y\), and \(z\) are the three-dimensional image dimensions, and pCT\((x,y,z)\) and CT\((x,y,z)\) are the pseudo-CT and ground-truth CT voxel values for a given \((x,y,z)\) position, respectively; \(N\) is the total amount of voxels; \(\mu_{pCT}\) and \(\mu_{CT}\) are the mean HU pseudo-CT and ground-truth CT images, respectively; \(\sigma_{pCT}\) and \(\sigma_{CT}\) are the standard deviations for the pseudo-CT and ground-truth CT images, respectively; \(\sigma_{pCT,CT}\) is the joint standard deviation; \(C_{1}=(k_{1}L)^{2}\) and \(C_{2}=(k_{2}L)^{2}\) are two variables to stabilize the division with weak denominator depending on L=dynamic range of pixel values (typically \(2^{\#bigsppixel}-1\)), \(k_{1}=0.01\) and \(k_{2}=0.03\) by default; \(H(pCT)\) and \(H(CT)\) are the entropies for the pseudo-CT and ground-truth CT images, respectively; \(H(pCT,CT)\) is the joint entropy, defined by Equations (10)-(12):  
\[H(pCT)=-\sum_{x\in pCT}p(pCT(x))\log_{2}p(pCT(x)), \tag{10}\]  
\[H(CT)=-\sum_{y\in CT}p(CT(y))\log_{2}p(CT(y)), \tag{11}\]  
\[H(pCT,CT)=-\sum_{x\in pCT,y\in CT}p(pCT(x),CT(y))\log_{2}p(pCT(x),CT(y)), \tag{12}\]  
where \(p(pCT(x))\) and \(p(CT(y))\) represent the individual probability of observing a particular intensity value at a specific voxel in the pseudo-CT and ground-truth CT images, respectively. Similarly, \(p(pCT(x),CT(y))\) represents the joint probability of visualizing determined intensity values in both the pseudo-CT and ground-truth CT images.