georges.ptw package#

Submodules#

georges.ptw.ptw module#

TODO

georges.ptw.ptw.compute_dvh(dose_data, voxel_volume)[source]#
Parameters:
  • dose_data – 3D-array of the dose values.

  • voxel_volume – The volume of a unique voxel. We consider the same size for all voxels.

Returns:

The dvh stored into a 2 columns dataframe

Return type:

dvh_dataframe

exception georges.ptw.ptw.BraggPeakException(m: str = '')[source]#

Bases: Exception

class georges.ptw.ptw.BraggPeakAnalysis(bp: DataFrame, method: str, low_dose=1, high_dose=70)[source]#

Bases: object

This class processes a normalized 1D depth dose profile, or a pristine Bragg peak, to extract key information such as the maximum dose position, the distal range at a given percentage of the maximum, and the distal fall-off (DFO). The user must provide both the dose data and the corresponding positions in depth.

get_distal_interval()[source]#
get_bp_interval()[source]#
compute_percentage(x)[source]#
fitting_function(x)[source]#
fit_bp()[source]#

This function fits a Bragg peak using a 8th order polynom. Based on reference xxx.

Args: Returns:

get_coefficients() array[source]#
get_xrange(val)[source]#
get_r90() float[source]#
get_r80() float[source]#
get_r20() float[source]#
get_r10() float[source]#
get_maximum() float[source]#
compute_distal_fall_off() List[float][source]#
compute_dfo_90_10() float[source]#
compute_dfo_80_20() float[source]#
class georges.ptw.ptw.SpreadOutBraggPeakAnalysis(dose_data: ~pandas.core.frame.DataFrame | None = None, method: str = <module 'scipy.optimize' from '/home/runner/work/georges/georges/.venv/lib/python3.10/site-packages/scipy/optimize/__init__.py'>, z_axis: ~numpy.array | None = None, color: str = 'blue', str_on_legend: str = '', adjust_last_peak: float = 1.0)[source]#

Bases: object

This class takes a set of Bragg peaks, or a Bragg peak library, as input and computes the relative weights required to obtain a uniform depth dose profile, known as the SOBP. Additionally, this class processes the resulting SOBP and provides the flatness, DFO, and distal range at a given percentage of the maximum to the user.

get_library_max_ranges()[source]#
sobp_data() array[source]#
compute_weights() array[source]#
get_final_weights()[source]#
compute_sobp_profile() array[source]#
view_sobp(with_pristine_peaks=False)[source]#
recompute_sobp_for_another_range(bp_to_leave)[source]#
recompute_sobp_for_another_width(bp_to_leave)[source]#
compute_ranges()[source]#
get_sobp_r10()[source]#
get_sobp_r20()[source]#
get_sobp_r80()[source]#
get_sobp_r90()[source]#
get_sobp_flatness()[source]#
get_ur_min_dose()[source]#
get_ur_max_dose()[source]#
class georges.ptw.ptw.LateralProfileAnalysis(dose_profile: array, positions: array)[source]#

Bases: object

This class takes a normalized 1D transverse dose profile as input and computes various parameters such as the field size, the uniform region (defined as 80% of the field size), the transverse flatness of the uniform region, and the lateral penumbra at the left and right of this region. The user must provide both the dose data and the corresponding transverse positions.

set_data()[source]#
define_f()[source]#
get_position_left(percentage)[source]#
get_position_right(percentage)[source]#
get_p_20_left()[source]#
get_p_50_left()[source]#
get_p_80_left()[source]#
get_p_20_right()[source]#
get_p_50_right()[source]#
get_p_80_right()[source]#
get_field_size()[source]#
get_ur_left()[source]#
get_ur_right()[source]#
get_ur_size()[source]#
get_ur_min_dose()[source]#
get_ur_max_dose()[source]#
get_ur_flatness()[source]#
get_penumbra_left()[source]#
get_penumbra_right()[source]#
get_penumbra()[source]#
plot()[source]#
class georges.ptw.ptw.GammaAnalysis[source]#

Bases: object

class georges.ptw.ptw.RegularSpotScanning(sigma, fieldsize, n_spots_per_axis)[source]#

Bases: object

This class provides a method to calculate the required spot spacing for a regular grid irradiation scheme in order to obtain a two-dimensional uniform dose deposition profile for a given spot width (1 sigma) and a targeted circular field. The user inputs the half value of the field size, the desired number of spots along each axis of the field, and the standard deviation (1 sigma) of the beam. The required spot spacing to achieve a 2D dose uniformity of at least 98% is directly outputted.

double_gaussian_function(x, y, a, mu_x, mu_y)[source]#
compute_2d_scanned_profile(spot_space)[source]#
optimize_regular_grid_spots_placement()[source]#
class georges.ptw.ptw.ContourSpotScanning(sigma, fieldsize, desired_angle, shoot_on_aperture: bool = True, angle_imposed: bool = False)[source]#

Bases: object

This class works similarly to RegularSpotScanning but uses a circular, contour-based irradiation scheme with a central spot placed at the center of the field. The user can choose whether to impose the irradiation radius. The output of the calculation includes the relative weight of the contour spots compared to the central spot and the angle spacing between these spots.

double_gaussian_function(x, y, a, mu_x, mu_y)[source]#
compute_2d_contour_scanned_profile(angle, weight)[source]#
compute_2d_contour_scanned_profile_angle_imposed(weight)[source]#
compute_2d_contour_scanned_profile_radius_not_imposed(angle, weight, shoot_at)[source]#
optimize_contour_spots()[source]#

Module contents#