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 ; 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 , candidate pixels , image size , and selected data range :
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 , . It averages local values after excluding three border pixels on each side:
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 and background in two native-pixel selections. is the mean and is population standard deviation:
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 patches of side , pixel spacing in millimetres, window , and :
where is the residual of patch .
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 , reference and the ROI shifted by :
treats margins within the tie tolerance 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.