50def compare_results(egslst, inp_name):
53 phant_vols =
read_vols(
"phantom", inp_name)
54 sph_phant_vols =
read_vols(
"sph_phantom", inp_name)
56 vsource = float(re.findall(
"Volume of Source\s*=\s*(.*)\s*cm", egslst, re.IGNORECASE)[0])
57 bounding_vols = list(map(float, re.findall(
"Bounding shape volume\s*=\s*(.*)\s*cm", egslst, re.IGNORECASE)))
60 "source_volume": vsource,
61 "bounding_shape_volume": bounding_vols[0],
62 "extra_bounding_shape_vol": bounding_vols[1],
63 "box_reg_0": box_vols[0][0],
64 "phantom_reg_0": phant_vols[0][0],
65 "phantom_reg_1": phant_vols[1][0],
66 "sph_phantom_reg_0": sph_phant_vols[0][0],
67 "sph_phantom_reg_1": sph_phant_vols[1][0],
71 for k,v
in list(expected_volumes.items()):
73 print((
"Vol comparison failed for %s: Actual=%E Expected=%E" % (k, actual[k], v)))
76 return all_close, actual, expected_volumes