pyskindose.settings package
Submodules
pyskindose.settings.normalization_settings module
- class NormalizationSettings(normalization_settings: List[Dict[str, Any]])
Bases:
objectA class to normalize RDSR for PySkinDose compliance.
- trans_offset
See class variables of _TranslationOffset
- trans_dir
See class variables of _TranslationDirection
- rot_dir
See class variables of _RotationDirection
- field_size_mode
method for calculating field size at image receptor plane. Choose either “CFA” (collimated field area) or “ACD” (actual shutter distance). For more info, see calculate_field_size in geom_calc.py.
- Type:
str
- detector_side_length
side length of active image receptor area in cm.
- Type:
str
- to_printable_string(color: str = 'blue')
- update_attrs_str()
- update_used_settings(data_parsed: DataFrame)
pyskindose.settings.patient_offset module
- class PatientOffset(offset: dict)
Bases:
objectA class for setting patient - table offset.
In PyskinDose, the table isocenter is located centered at the head end of the support table. The attributes in this class is used to offset the patient phantom from this isocenter, in order to get correct patient positioning.
- d_lat
latertal offset from table isocenter
- Type:
int
- d_ver
Vertical offset from table isocenter
- Type:
int
- d_lon
longitudianl offset from table isocenter
- Type:
int
- Raises:
NotImplementedError – Raises error if other units then cm are used.
- update_attrs_str()
pyskindose.settings.phantom_dimensions module
- class PhantomDimensions(ptm_dim: dict)
Bases:
objectA class for setting the phantom dimensions for mathematical phantoms.
- plane_length
Lenth of plane phantom.
- Type:
int
- plane_width
Width of plane phantom.
- Type:
int
- plane_resolution
Select either ‘sparse’ or ‘dense’ resolution of the skin cell grid on the surface of the plane phantom. Note: dense is more computational expensive.
- Type:
str
- cylinder_length
Length of cylider phantom.
- Type:
int
- cylinder_radii_a
First radii of the cylindrical cross section of the cylindrical phantom, which lies in the “width” direction.
- Type:
float
- cylinder_radii_b
Second radii of the cylindrical cross section of the cylindrical phantom, which lies in the “thickness” direction. radii a should be greater than radii b.
- Type:
float
- cylinder_resolution
Select either ‘sparse’ or ‘dense’ resolution of the skin cell grid on the surface of the elliptical cylinder. Note: dense is more computational expensive.
- Type:
str
- table_thickness
Thickness of the support table phantom.
- Type:
int
- table_length
Length of the support table phantom.
- Type:
int
- table_width
Width of the support table phantom.
- Type:
int
- pad_thickness
Thickness of the patient support table phantom.
- Type:
int
- pad_width
Width of the patient support table phantom.
- Type:
int
- pad_length
Length of the patient support table phantom.
- Type:
int
- to_dict_cylinder()
- to_dict_pad()
- update_attrs_str()
pyskindose.settings.phantom_settings module
- class PhantomSettings(ptm_dim: dict)
Bases:
objectA class for setting all the phantom related settings required.
- model
Select which model to represent the skin surface for skindose calculations. Valid selections: “plane” (2D planar surface), “cylinder” (cylinder with elliptical cross section) or “human” (phantom in the shape of a human, created with MakeHuman.)
- Type:
str
- human_mesh
Select which MakeHuman phantom to represent the patient when model = “human” is selected. Valid selections: Any of the .stl files in the folder phantom_data. Enter as a string without the .stl file ending.
- Type:
str
- patient_offset
Instance of class PhantomOffset containing patient - table isocenter offset.
- Type:
PhantomOffset
- patient_orientation
patient orientation on table. Choose between ‘head_first_supine’ and ‘feet_first_supine’.
- Type:
str
- dimension
Instance of class PhantomDimensions containing all dimensions required to create any of the mathematical phantoms, which is all but human.
- Type:
- to_printable_string(color: str = 'light_slate_blue')
- update_attrs_str()
pyskindose.settings.plot_settings module
- class Plotsettings(plt_dict)
Bases:
objectA class for setting plot settings.
- interactivity
Toggle for interactive mode when plotting dosemaps. If True, the dosemap will be plotted in a .html file with full interactivity. If False, the dosemap will be saved as static images. Static mode is provided to enable PySkinDose to run smooth on machines with limited RAM.
- Type:
bool
- dark_mode
dark mode boolean
- Type:
bool
- notebook_mode
Set true if main is called from within a notebook. This optimizes plot sizing for notebook output cells.
- Type:
bool
- plot_dosemap
Whether dosemap should be plotted after dose calculation
- Type:
bool, default is True
- max_events_for_patient_inclusion
maximum number of irradiation event for patient inclusion in plot_procedure. If the SR file contains more events than this number, the patient phantom is not shown in plot_procedure to avoid memory error.
- Type:
int
- plot_event_index
Index for the event that should be plotted when mode=”plot_event” is chosen.
- Type:
int
- to_printable_string(color: str = 'blue')
- update_attrs_str()
pyskindose.settings.pyskindose_settings module
- class PyskindoseSettings(settings: str | dict, normalization_settings: Path | str | dict | NormalizationSettings | None = None, file_result_output_path: str | Path | None = None, output_format: str = 'html')
Bases:
objectA class to store all settings required to run PySkinDose.
- mode
Select which mode to execute PySkinDose with. There are three different modes:
mode = “calculate_dose” calculates the skin dose from the RDSR data and presents the result in a skin dose map.
mode = “plot_setup” plots the geometry (patient, table, pad and beam in starting position, i.e., before any RDSR data has been added.) This is useful for debugging and when manually fixating the patient phantom with the function “position_patient_phantom_on_table”.
mode = “plot_event” plots the geometry for a specific irradiation event with index = event.
mode = “plot_procedure” plots geometry of the entire sequence of RDSR events provided in the RDSR file. The patient phantom is omitted for calculation speed in human phantom is used.
- Type:
str
- rdsr_filename
filename of the RDSR file, without the .dcm file ending.
- Type:
str
- estimate_k_tab
Whether k_tab should be approximated or not. You should set this to true if you have not conducted table attenuation measurements.
- Type:
bool
- k_tab_val
Value of k_tab, in range 0.0 -> 1.0.
- Type:
float
- inherent_filtration
X-ray tube inherent filtration, for backscatter and medium correction.
- Type:
float
- phantom
Instance of class PhantomSettings containing all phantom related settings.
- plot
Instance of class Plotsettings containing all plot related settings
- print_parameters(return_as_string: bool = False)
Print entire parameter class to terminal.
- Parameters:
return_as_string (bool, optional) – Return the print statement as a string, instead of printing it to the terminal. The default is False.
- initialize_settings(settings: str | dict | PyskindoseSettings) PyskindoseSettings
pyskindose.settings.rotation_direction module
- class RotationDirection(directions: Dict[str, str] | None = None)
Bases:
objectSwitch pos/neg direction of beam- and table angles.
- keys of __init__ parameter directions
Value of each attribute (i.e. key) is integers of either +1 or -1 to be used as a multiplicative correction factor to switch pos/neg direction in each angle. PySkinDose default angles are all +1.
- update_rotation_direction(directions: Dict[str, str])
pyskindose.settings.translation_direction module
- class TranslationDirection(directions: Dict[str, str] | None = None)
Bases:
objectSwitch pos/neg direction of table translations.
- keys of __init__ parameter directions
Value of each attribute (i.e. key) is integers of either +1 or -1 to be used as a multiplicative correction factor to switch pos/neg direction in each direction. PySkinDose default angles are all +1.
- update_translation_direction(directions: Dict[str, str])
- x: int | None
- y: int | None
- z: int | None
pyskindose.settings.translation_offset module
- class TranslationOffset(offset: Dict[str, float] | None = None)
Bases:
objectSet translation offset of patient support table.
Use this class to set the translation offset (in cm) between the machine origin (the unit that generated the RDSR) and the machine origin of PySkinDose (which is located at (x,y,z) = (0, 0, 0)).
- keys of __init__ parameter offset
Value of each attribute (i.e. key) is a float specifying the offset in cm.
- update_translation_offset(offset: Dict[str, float])