Methods and examples

Measurements use decoded native pixels. Images in one analysis must have equal width and height. Display zoom and DICOM window level affect the view, not the measured values. For colour images, the measured luminance is 0.2126 R+0.7152 G+0.0722 B0.2126\,R + 0.7152\,G + 0.0722\,B; the histogram can instead read the red, green or blue channel. For supported DICOM images, stored values are multiplied by Rescale Slope and shifted by Rescale Intercept before analysis.

PSNR and SSIM

The PSNR / SSIM panel of the workspace compares each image with a selected reference. For reference pixels rir_i, candidate pixels cic_i, image size NN, and selected data range DD:

MSE=1N∑i=1N(ci−ri)2,PSNR=10log⁡10D2MSE dB \mathrm{MSE} = \frac{1}{N} \sum_{i=1}^{N} (c_i - r_i)^2, \qquad \mathrm{PSNR} = 10 \log_{10} \frac{D^2}{\mathrm{MSE}} \ \mathrm{dB}

Perfect equality gives infinite PSNR. The range can come from the ground truth, the image pair, or a fixed user value. Record that choice when reporting PSNR. When the panel is bound to a selection, the ROI columns use the same range and the same formulas on the selected pixels.

SSIM uses a 7 x 7 uniform local window, sample covariance and constants C1=(0.01 D)2C_1 = (0.01\,D)^2, C2=(0.03 D)2C_2 = (0.03\,D)^2. It averages local values after excluding three border pixels on each side:

SSIM=(2μrμc+C1)(2σrc+C2)(μr2+μc2+C1)(σr2+σc2+C2) \mathrm{SSIM} = \frac{(2 \mu_r \mu_c + C_1)(2 \sigma_{rc} + C_2)} {(\mu_r^2 + \mu_c^2 + C_1)(\sigma_r^2 + \sigma_c^2 + C_2)}

These choices follow the structural similarity method and are aligned with the explicit data range and default uniform window of scikit-image in the reference tests.

Signal and background regions

The ROI contrast panel measures signal SS and background BB in two native-pixel selections. μ\mu is the mean and σ\sigma is population standard deviation:

CNR=∣μS−μB∣σB,SNR=μSσB,CV=100 σSμS,NSD=100 σBμS \begin{aligned} \mathrm{CNR} &= \frac{|\mu_S - \mu_B|}{\sigma_B}, & \mathrm{SNR} &= \frac{\mu_S}{\sigma_B}, \\ \mathrm{CV} &= 100\,\frac{\sigma_S}{\mu_S}, & \mathrm{NSD} &= 100\,\frac{\sigma_B}{\mu_S} \end{aligned}

Move the signal and background selections independently. The workspace JSON records their shapes and coordinates. Values with a zero denominator are undefined.

Error, histogram and profile views

The Difference panel reports mean absolute error, root mean squared error and maximum absolute error against the selected reference. The map shows absolute, squared or signed error; its colour map and gain are display settings. The Histogram and statistics panel counts values within an optional selection and a chosen channel. Percent display divides each bin by the selection’s sample count. Hiding the first bins and the log scale change the plot, not the source pixels. The Line profile panel samples along a line in native coordinates and can average a chosen thickness perpendicular to that line. Min-max normalization and subtracting one image’s profile are optional display steps; the table keeps the measured values.

Noise power spectrum

The Noise power spectrum panel extracts one or more full square patches without resampling. A patch is mean-subtracted or plane-detrended, optionally multiplied by a Hann window, transformed with a two-dimensional FFT, and averaged with other patches. For MM patches of side nn, pixel spacing Δx,Δy\Delta x, \Delta y in millimetres, window ww, and U=mean⁡(w2)U = \operatorname{mean}(w^2):

NPS2D(fx,fy)=Δx ΔyMn2U∑j=1M∣F{w⋅ej}(fx,fy)∣2 \mathrm{NPS}_{2D}(f_x, f_y) = \frac{\Delta x\,\Delta y}{M n^2 U} \sum_{j=1}^{M} \left| \mathcal{F}\{ w \cdot e_j \}(f_x, f_y) \right|^2

where eje_j is the residual of patch jj.

Radial averaging yields frequency in inverse millimetres and NPS in squared pixel-value millimetres squared. The integrated two-dimensional NPS equals the window-weighted residual variance, which the panel reports as a consistency check. CT images rescaled to Hounsfield units report HU-based NPS units. See the TG 233 report for the clinical context.

ROI robustness

The ROI robustness panel asks whether a comparison between two images, A and B, survives a small move of the shared ROI. With score QQ, reference XX and the ROI RtR_t shifted by t=(δx,δy)t = (\delta_x, \delta_y):

d(t)=Q(A,X;Rt)−Q(B,X;Rt)r∗=min⁡{max⁡(∣δx∣,∣δy∣):sign⁡τd(t)=−sign⁡τd(0)≠0} \begin{aligned} d(t) &= Q(A, X; R_t) - Q(B, X; R_t) \\ r^* &= \min \left\{ \max(|\delta_x|, |\delta_y|) : \operatorname{sign}_\tau d(t) = -\operatorname{sign}_\tau d(0) \neq 0 \right\} \end{aligned}

sign⁡τ\operatorname{sign}_\tau treats margins within the tie tolerance τ\tau as ties. The panel evaluates every shift up to the search radius exactly, using summed-area tables of the full-image SSIM map and squared error, and reports the smallest reversing shift with both margins, or that none exists within the radius. On the examples, a 64 × 64 ROI at (180, 180) with data range 255 gives BM3D a lower mean SSIM than Noise2Inverse (margin -0.00146), and a shift of (-1, -1) reverses it (+0.00047).

Reopen a worked comparison

Open the workspace, select Load examples (gt.png becomes the reference), draw a rectangle with Rect and add a PSNR / SSIM panel. The same native-pixel region is measured on every reconstruction. Select Export workspace to save source hashes, coordinates, settings and results. On a fresh page, select Import workspace to restore the analysis. The workspace reloads bundled examples automatically and checks whether the numbers match. Local images must be reopened from the original files. The sharing guide explains links, figures and methods exports.