image compareImages

Medical Imaging Integrity Check with Strict PSNR Thresholds

Scénario de test & Cas d'usage

Business Context

A hospital IT department is compressing historical MRI scans to save storage. Before deleting originals, they must verify that the compressed version retains extremely high fidelity. The protocol requires a Peak Signal-to-Noise Ratio (PSNR) specifically between 30dB and 100dB. Comparisons should be done on the overall intensity (grayscale), ignoring minor color channel shifts.
About the Set : image

Image processing, manipulation, and analysis.

Discover all actions of image
Data Preparation

Setup 'ORIGINAL_SCANS' and 'COMPRESSED_SCANS' tables. The filenames match exactly to facilitate pairing.

Copied!
1DATA casuser.original_scans;
2 LENGTH _path_ $255 patient_id $20;
3 INPUT _path_ $ patient_id $;
4 _image_ = 'FFFF'b;
5 DATALINES;
6scan_001.dcm P_101
7scan_002.dcm P_102
8scan_003.dcm P_103
9;
10RUN;
11
12DATA casuser.compressed_scans;
13 LENGTH _path_ $255 patient_id $20;
14 INPUT _path_ $ patient_id $;
15 _image_ = 'FFFF'b;
16 DATALINES;
17scan_001.dcm P_101
18scan_002.dcm P_102
19scan_003.dcm P_103
20;
21RUN;

Étapes de réalisation

1
Run PSNR comparison with strict 'minimum' and 'maximum' thresholds, and disable channel separation for global intensity check.
Copied!
1PROC CAS;
2 image.compareImages /
3 sourceImages={TABLE={name='compressed_scans', caslib='casuser'}}
4 referenceImages={TABLE={name='original_scans', caslib='casuser'}}
5 casOut={name='validation_log', caslib='casuser', replace=true}
6 method='PSNR'
7 minimum=30
8 maximum=100
9 separateChannels=false
10 copyVars={'patient_id'};
11RUN;
2
Review the validation log to ensure no corrupted (low PSNR) images exist.
Copied!
1PROC CAS;
2 SIMPLE.summary /
3 TABLE={name='validation_log', caslib='casuser'};
4RUN;

Expected Result


The 'validation_log' table will only contain records for scans that meet the strict PSNR criteria (30-100). Any scan falling below 30 (severe data loss) is automatically excluded from the success log, alerting the admins.