# Impact of Iterative Bilateral Filtering on the Noise Power Spectrum of Computed Tomography Images
## 2 Materials and Methods
### Implementation of Bilateral Filter, Measurement of Noise Power Spectrum and Spatial Resolution  
The noise power spectrum (NPS) describes the texture of noise in the frequency domain [29]. The 2D NPS is estimated as shown in Equation (3) [33].  
\[NPS_{(u,v)}=\frac{d_{x}d_{y}}{N_{x}N_{y}}.|\mathcal{F}[I(x,y)-P(x,y)]|^{2} \tag{3}\]  
where \(u\) and \(v\) are spatial frequency in the \(x\) and \(y\) direction, \(d_{x}\) and \(d_{y}\) are pixel size in mm, \(N_{x}\) and \(N_{y}\) are number of pixels in the \(x\) and \(y\) direction of the region of interest (ROI), \(\mathcal{F}\) denotes the 2D Fourier transform, \(I(x,y)\) is the pixel value in Hounsfield Units (HU), and \(P(x,y)\) is the second order polynomial fit of \(I(x,y)\).  
The description of NPS is Summarized as the peak frequency (\(f_{P}\)) and the average frequency (\(f_{A}\)) shown in Equations (4) and (5) [34].  
\[f_{P}=\text{argmax}[NPS(f)] \tag{4}\]  
\[f_{A}=\frac{\int\ f\cdot NPS(f)\ df}{\int\ NPS(f)\ df} \tag{5}\]  
where \(f\) is the radial spatial frequency, and \(NPS(f)\) is the radially averaged 1D NPS.  
Before filtering an image, we measured NPS using ImQuest (Duke University, Durham, NC, USA) [35] with a total ROI of 5, a size of 64 pixels, and a sampling angle of 10. This was carried out to obtain a description of the noise in the original image before filtering. The ROIs for measuring NPS is shown in Figure 2.  
The edge of the modulation transfer function (MTF) [36] was also measured automatically by IndoQCT [37] to get a more complete picture of the spatial resolution of the filtered image. The edge MTF was chosen as the spatial resolution parameter because the phantom used was a homogeneous phantom [36]. The steps to obtain the edge MTF are shown in Figure 3. A square ROI is placed on the edge of the phantom at the 12 o'clock position (Figure 3a) and then the pixels were averaged in the x-axis direction to obtain a curve called the edge spread function (ESF) (Figure 3b). Tail replacement is performed on this curve to obtain the corrected ESF shape (Figure 3c). The corrected ESF curve is then differentiated to produce a line spread function (LSF) curve (Figure 3d) which is then zeroed and normalized. The Fourier transform of the LSF curve gives the MTF curve (Figure 3e). Bilateral filtering, NPS and MTF measurements were performed sequentially on 5 selected images of a homogeneous phantom.  
The bilateral filter was applied to these images with the configuration of sigma space (\(\sigma_{d}\)) = 2, sigma intensity (\(\sigma_{r}\)) = noise level, and kernel size 5 \(\times\) 5 pixels. The noise (\(\sigma\)) was obtained using an automatic noise measurement algorithm [38] on the first image. After the images were filtered, the NPS and MTF measurement were performed using the same configuration as before. Filtering was performed repeatedly on the previously filtered image 5 times so that 6 NPS and 6 MTF curves were obtained including the original one. Both NPS and MTF measurement as well as the filtering processes were carried out on 5 slices of a homogeneous water phantom for each variation of tube current to obtain more stable and comprehensive results. Figure 4 shows an example of the filtered images.  
Figure 3: Edge MTF measurement. (**a**) ROI placement on the phantom, (**b**) ESF curve, (**c**) ESF curve after tail replacement, (**d**) LSF curve, and (**e**) MTF curve.  
Figure 2: NPS measurement using 5 regions of interest (ROIs).