pyskindose.calculate_dose package
Submodules
pyskindose.calculate_dose.add_correction_and_event_dose_to_output module
- add_corrections_and_event_dose_to_output(normalized_data: DataFrame, event: int, hits: List[bool], table_hits: List[bool], patient: Phantom, back_scatter_interpolation: List[CubicSpline], field_area: List[float], k_tab: List[float], corrections_db: str, output: Dict[str, Any]) Dict[str, Any]
Add correction factors and event dose to output dictionary.
- Parameters:
normalized_data (pd.DataFrame) – RDSR data, normalized for compliance with PySkinDose.
event (int) – Irradiation event index.
hits (List[bool]) – A boolean list of the same length as the number of patient skin cells. True for all entrance skin cells that are hit by the beam for a specific irradiation event.
table_hits (List[bool]) – A boolean list that specfies (for each hit), if the bean passes through the patient support table, by default None
patient (Phantom) – Patient phantom, either of type plane, cylinder or human, i.e. instance of class Phantom
back_scatter_interpolation (List[CubicSpline]) – List of interpolation objects to used to estimate backscatter correction from the correction database
field_area (List[float]) – X-ray field area in (cm^2) for each phantom skin cell that are hit by the X-ray beam
k_tab (List[float]) – List of table correction factors
corrections_db (str) – A string defining the path to the corrections SQLite db
output (Dict[str, Any]) – Dictionary containing outputs to store from the calculations. E.g. dose map and correction factors.
- Returns:
Dictionary containing outputs to store from the calculations. E.g. dose map and correction factors.
- Return type:
Dict[str, Any]
pyskindose.calculate_dose.calculate_dose module
- calculate_dose(normalized_data: DataFrame, settings: PyskindoseSettings, table: Phantom, pad: Phantom) Tuple[Phantom, Dict[str, Any] | None]
Calculate skin dose.
This function initializes the skin dose calculations.
- Parameters:
normalized_data (pd.DataFrame) – RDSR data, normalized for compliance with PySkinDose.
settings (PyskindoseSettings) – Settings class for PySkinDose
table (Phantom) – Patient support table phantom
pad (Phantom) – Patient support pad phantom
- Returns:
[description]
- Return type:
Tuple[Phantom, Optional[Dict[str, Any]]]
pyskindose.calculate_dose.calculate_irradiation_event_result module
- calculate_irradiation_event_result(normalized_data: DataFrame, event: int, total_events: int, new_geometry: List[bool], k_tab: List[float], hits: List[bool], patient: Phantom, table: Phantom, pad: Phantom, back_scatter_interpolation: List[CubicSpline], output: Dict[str, Any], corrections_db: str, table_hits: List[bool] = None, field_area: List[float] = None, k_isq: array = None, pbar: tqdm = None) Dict[str, Any]
Conducts skin dose calculation.
This function loops though all irradiation events in the the normalized data, and calculates the skin dose contribution from each event.
- Parameters:
normalized_data (pd.DataFrame) – RDSR data, normalized for compliance with PySkinDose.
event (starting event index) – Index of starting irradiation event
total_events – Total number of irradiation events
new_geometry (List[bool]) – A boolean list that specifies whether the irradiation geometry has changes since the preceding event. See the function check_new_geometry
k_tab (List[float]) – List of table correction factors
hits (List[bool]) – A boolean list that specifies (for a single event) the hit/miss status of each skin cell upon the patient phantom.
patient (Phantom) – Patient skin surface phantom
table (Phantom) – Patient support table phantom
pad (Phantom) – Patient support pad phantom
back_scatter_interpolation (List[CubicSpline]) – List of interpolation objects to used to estimate backscatter correction from the correction database
output (Dict[str, Any]) – Dictionary containing outputs to store from the calculations. E.g. dose map and correction factors.
corrections_db (str) – A string defining the path to the corrections SQLite db
table_hits (List[bool], optional) – A boolean list that specfies (for each hit), if the bean passes through the patient support table, by default None
field_area (List[float], optional) – X-ray field area in (cm^2) for each phantom skin cell that are hit by the X-ray beam, by default None
k_isq (np.array, optional) – Inverse-square-law correction factors, by default None
pbar (tqdm) – progress bar object
- Returns:
Dictionary containing skin dose calculation results.
- Return type:
Dict[str, Any]