Skip to content

Commit

Permalink
commit for rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
alanphys committed Mar 11, 2021
1 parent 402e7e8 commit 0a7a46f
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions pylinac/fieldparams.py
Expand Up @@ -9,7 +9,7 @@

import matplotlib.pyplot as plt
import numpy as np
import math
from scipy.interpolate import interp1d

from pylinac.core.utilities import open_path
from .core.exceptions import NotAnalyzed
Expand Down Expand Up @@ -159,8 +159,19 @@ def penumbra_slope_right_infl(profile: SingleProfile, *args):

# Dose point values ----------------------------------------------------------------------------------------------------
def dose_point_left_20(profile: SingleProfile, *args):
left_edge = 0.2*left_edge_infl(profile)*profile.dpmm + profile.center()
return
"""Dose value at 20% of field size from CAX"""
left_edge_idx = profile.infl_points(pen_width, 'left')[0]
if norm in ['max', 'max grounded']:
cax_idx, cax_val = profile.fwxm_center(x=50, interpolate=interpolate)
else:
cax_idx, cax_val = profile.center()
dose_idx = cax_idx - (cax_idx - left_edge_idx)*0.2
if interpolate:
ydata_f = interp1d(profile._indices, profile.values, kind=profile.interpolation_type)
dose_val = ydata_f(dose_idx)
else:
dose_val = profile.values[round(cax_idx)]
return 100*dose_val/cax_val


# Field flatness parameters --------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -391,7 +402,8 @@ def deviation_max(profile: SingleProfile, ifa: float = 0.8):
'left penumbra: {:.1f} mm': penumbra_left_infl,
'right penumbra: {:.1f} mm': penumbra_right_infl,
'left penumbra slope {:.1f} %/mm': penumbra_slope_left_infl,
'right penumbra slope {:.1f} %/mm': penumbra_slope_right_infl
'right penumbra slope {:.1f} %/mm': penumbra_slope_right_infl,
'left dose point 20%: {:.1f} %': dose_point_left_20
}
# ----------------------------------------------------------------------------------------------------------------------
# End of predefined protocols - Do not change these. Instead copy a protocol, give it a new name, put it after these
Expand Down

0 comments on commit 0a7a46f

Please sign in to comment.