# Prospects of Structural Similarity Index for Medical Image Analysis
## 2 Historical Review and Basic Principles of SSIM
To simplify Equation (1) into three important components, \(Q\) can be defined as  
\[Q=\frac{\sigma_{xy}}{\sigma_{x}\sigma_{y}}\cdot\frac{2\overline{x}\overline{y}}{ \overline{x}^{2}+\overline{y}^{2}}\cdot\frac{2\sigma_{x}\sigma_{y}}{\sigma_{x}^ {2}+\sigma_{y}^{2}}\, \tag{2}\]  
Because an image is space-variant, for measuring an image, a local assessment is preferred over a global evaluation that quantifies the image by employing a sliding window. This window slides over the entire image from the left-top to right-bottom corners pixel by pixel both horizontally and vertically. During each stride, we obtain \(Q_{j}\), and thus if the window slides over the image for \(M\) strides, we acquire the total quality \(Q_{tot}=\sum_{j=1}^{M}Q_{j}\), and \(Q\) can be written as  
\[Q=\frac{1}{M}\sum_{j=1}^{M}Q_{j}, \tag{3}\]  
indicating the mean quality score. Furthermore, [PERSON] and [PERSON] indicated that the new quality metric is superior to the MSE. They employed the same MSE value with various distortions to the \"Lena\" image. They set the MSE value to approximately 255; however, the \(Q\) score could validate the quality by showing the different scores with respect to the perception of a human observer. However, in this first effort, they did not claim to use any HVS models. Two years later, in 2004, they published their study on SSIM with the help of two additional co-authors [10]. They reported that the assumption of HVS can be well adapted with the perception of the structural information and that human observers have limitations in recognizing errors. This is reasonable because humans can easily identify changes in physical information while complicatedly detecting the variations of an error in the images. To match with the HVS, SSIM demonstrates comparisons of \(l\) luminance, \(c\) contrast, and \(s\) structure, which are specified as  
\[l(\mathbf{x},\mathbf{y})=\frac{2\mu_{x}\mu_{y}+C_{1}}{\mu_{x}^{2}+\mu_{y}^{2}+C_{1}}\, \tag{4}\]  
\[c(\mathbf{x},\mathbf{y})=\frac{2\sigma_{x}\sigma_{y}+C_{2}}{\sigma_{x}^{2}+\sigma_{y}^ {2}+C_{2}}\, \tag{5}\]  
\[s(\mathbf{x},\mathbf{y})=\frac{\sigma_{xy}+C_{3}}{\sigma_{x}\sigma_{y}+C_{3}}\, \tag{6}\]  
where \(\mu_{x}\) and \(\mu_{y}\) denote the mean intensity for reference image \(\mathbf{x}\) and distorted image \(\mathbf{y}\), respectively. Compared with Equation (2), Equations (4) and (5) have the same definitions as luminance and contrast comparisons, and meanwhile, Equation (6) has a different description from the correlation to be applied in a structural comparison. Likewise, SSIM considers constant values to avoid instability when \(\mu_{x}^{2}+\mu_{y}^{2}\), \(\sigma_{x}^{2}+\sigma_{y}^{2}\), and \(\sigma_{x}\sigma_{y}\) are extremely close to zero. These constants are \(C_{1}=(K_{1}L)^{2}\), \(C_{2}=(K_{2}L)^{2}\), and \(C_{3}=C_{2}/2\). In addition, \(K_{1}\) and \(K_{2}\) should be \(\ll 1\) and \(L\) is 255 for an 8-bit grayscale image or an image in three channels, such as red, green, and blue (RGB). As in Equation (2), the SSIM also can be formulated as  
\[SSIM(\mathbf{x},\mathbf{y})=[l(\mathbf{x},\mathbf{y})]^{\alpha}\cdot[c(\mathbf{x},\mathbf{y})]^{\beta} \cdot[s(\mathbf{x},\mathbf{y})]^{\gamma}, \tag{7}\]  
with \(\alpha=\beta=\gamma=1\), and thus a specific form can be defined as  
\[SSIM(\mathbf{x},\mathbf{y})=\frac{\left(2\mu_{x}\mu_{y}+C_{1}\right)\left(2\sigma_{xy }+C_{2}\right)}{\left(\mu_{x}^{2}+\mu_{y}^{2}+C_{1}\right)\left(\sigma_{x}^{2 }+\sigma_{y}^{2}+C_{2}\right)}. \tag{8}\]  
Figure 1 shows a diagram of the SSIM measurement procedure. First, the luminance is calculated over the two images by utilizing Equation (4) when employing a sliding window;  
here, image \(\mathbf{x}\) is a reference image, whereas image \(\mathbf{y}\) denotes a noise-degraded image. The contrast is then measured using Equation (5). To obtain the structure, the covariance between \(\mathbf{x}\) and \(\mathbf{y}\) must be computed using Equation (6).