EGS Brachy
An egs++ user code for rapid brachytherapy calculations
Loading...
Searching...
No Matches
test.py
Go to the documentation of this file.
1"""
2
3Compare dose from a source definition that uses local transforms plus a
4source coordinate transform against the seeds_in_xyz gold standard, which
5uses pre-composed world transforms directly.
6
7Local transforms subtract (0.1, 0.2, 0.3) cm from each world placement;
8the source coordinate transform adds that offset back during initialization.
9
10"""
11
12import os
13
14from eb_tests.utils import compare_3ddose_files, read3ddose
15
16EGSINP = "source_coordinate_transform.egsinp"
17TIME_LIMIT_S_PER_MHZ = 25/2993. # s / MHz
18
19
20def compare_results(egslst, inp_name):
21
22 gold_standard = os.path.join(
23 os.path.dirname(os.path.abspath(__file__)),
24 "..",
25 "seeds_in_xyz",
26 "gold_standard.3ddose",
27 )
28 run_doses = inp_name + ".phantom.3ddose"
29
30 doses_close = compare_3ddose_files(
31 gold_standard, run_doses, max_percent_diff=0.01
32 )
33
34 return doses_close, read3ddose(run_doses), read3ddose(gold_standard)