forked from samuelpeet/conehead
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.py
46 lines (40 loc) · 1.36 KB
/
example.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
from conehead import (
Source, Block , SimplePhantom, Conehead
)
import numpy as np
import pydicom
from scipy.interpolate import RegularGridInterpolator
# Load test plan
plan = pydicom.dcmread("RP.3DCRT.dcm", force=True)
# Choose source
source = Source("varian_clinac_6MV")
source.gantry(0)
source.collimator(0)
# Set the jaws and MLC
# block = Block(source.rotation, plan=plan)
block = Block()
block.set_square(30)
# Use a simple cubic phantom
phantom = SimplePhantom()
# Calculation settings
settings = {
'stepSize': 0.1, # Stepsize when raytracing effective depth (cm)
'sPri': 0.90924, # Primary source strength
'sAnn': 2.887e-3, # Annular source strength
'zAnn': -4.0, # Height of annular source in beam coordinates
'rInner': 0.2, # Inner radius of annular source
'rOuter': 1.4, # Outer radius of annular source
'zExp': -12.5, # Height of exponential source in beam coordinates
'sExp': 8.289e-3, # Exponential source strength
'kExp': 0.4816, # Exponential source exponent coefficient
'softRatio': 0.0025, # cm^-1
'softLimit': 20, # cm
'hornRatio': 0.0065, # % per cm
'eLow': 0.01, # MeV
'eHigh': 7.0, # MeV
'eNum': 500, # Spectrum samples
'fluenceResampling': 3 # Split voxels for fluence calculatiion
}
conehead = Conehead()
conehead.calculate(source, block, phantom, settings)
conehead.plot()