Script to calculate gamma metric for scans