plan#
Base Class#
- class Plan(**data)[source]#
Bases:
PyRadPlanBaseModel,ABCAbstract base class for a treatment plan using PyRadPlanBaseModel.
- prop_stf#
Properties of the stf.
- Type:
Dict[str, Any]
- prop_opt#
Properties of the optimization.
- Type:
Dict[str, Any]
- prop_dose_calc#
Properties of the dose calculation.
- Type:
Dict[str, Any]
- prop_seq#
Properties for the sequencer
- Type:
Dict[str, Any]
- num_of_fractions#
Number of fractions in the plan.
- Type:
int
- machine#
Machine used for the plan.
- Type:
str
- prescribed_dose#
Prescribed dose for the plan. Serves mainly as normalization value.
- Type:
float
- radiation_mode#
Will return the radiation modality (e.g. photons or protons).
- Type:
str
- Attributes:
model_extraGet extra fields set during validation.
model_fields_setReturns the set of fields that have been explicitly set on this model instance.
Methods
copy(*[, include, exclude, update, deep])Returns a copy of the model.
model_construct([_fields_set])Creates a new instance of the Model class with validated data.
model_copy(*[, update, deep])!!! abstract "Usage Documentation"
model_dump(*[, mode, include, exclude, ...])!!! abstract "Usage Documentation"
model_dump_json(*[, indent, ensure_ascii, ...])!!! abstract "Usage Documentation"
model_json_schema([by_alias, ref_template, ...])Generates a JSON schema for a model class.
model_parametrized_name(params)Compute the class name for parametrizations of generic classes.
model_post_init(context, /)Override this method to perform additional initialization after __init__ and model_construct.
model_rebuild(*[, force, raise_errors, ...])Try to rebuild the pydantic-core schema for the model.
model_validate(obj, *[, strict, extra, ...])Validate a pydantic model instance.
model_validate_json(json_data, *[, strict, ...])!!! abstract "Usage Documentation"
model_validate_strings(obj, *[, strict, ...])Validate the given object with string data against the Pydantic model.
to_matrad([context])Create a dictionary ready to save the Plan model to a mat-file.
Validate the workflow property dictionaries.
Validate the radiation mode.
construct
dict
from_orm
json
parse_file
parse_obj
parse_raw
schema
schema_json
update_forward_refs
validate
- machine: Dict | str#
- model_config: ClassVar[ConfigDict] = {'alias_generator': AliasGenerator(alias=<function to_camel>, validation_alias=None, serialization_alias=None), 'arbitrary_types_allowed': True, 'from_attributes': True, 'populate_by_name': True, 'validate_assignment': True, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- mult_scen: ScenarioModel#
- num_of_fractions: int#
- prescribed_dose: float#
- prop_dose_calc: Dict[str, Any]#
- prop_opt: Dict[str, Any]#
- prop_seq: Dict[str, Any]#
- prop_stf: Dict[str, Any]#
- radiation_mode: str#
- to_matrad(context='mat-file')[source]#
Create a dictionary ready to save the Plan model to a mat-file.
- Return type:
Any- Returns:
Dict: A dictionary containing the data of the Plan model in a format suitable for saving to a mat-file.
Plans for different modalities#
- class PhotonPlan(**data)[source]#
Bases:
PlanClass for a photon treatment plan.
- Inherits all attributes from Plan.
- radiation_mode : str
Returns the radiation mode as ‘photons’.
- Attributes:
model_extraGet extra fields set during validation.
model_fields_setReturns the set of fields that have been explicitly set on this model instance.
Methods
copy(*[, include, exclude, update, deep])Returns a copy of the model.
model_construct([_fields_set])Creates a new instance of the Model class with validated data.
model_copy(*[, update, deep])!!! abstract "Usage Documentation"
model_dump(*[, mode, include, exclude, ...])!!! abstract "Usage Documentation"
model_dump_json(*[, indent, ensure_ascii, ...])!!! abstract "Usage Documentation"
model_json_schema([by_alias, ref_template, ...])Generates a JSON schema for a model class.
model_parametrized_name(params)Compute the class name for parametrizations of generic classes.
model_post_init(context, /)Override this method to perform additional initialization after __init__ and model_construct.
model_rebuild(*[, force, raise_errors, ...])Try to rebuild the pydantic-core schema for the model.
model_validate(obj, *[, strict, extra, ...])Validate a pydantic model instance.
model_validate_json(json_data, *[, strict, ...])!!! abstract "Usage Documentation"
model_validate_strings(obj, *[, strict, ...])Validate the given object with string data against the Pydantic model.
to_matrad([context])Create a dictionary ready to save the Plan model to a mat-file.
validate_prop(v)Validate the workflow property dictionaries.
Validate the radiation mode for a PhotonPlan.
construct
dict
from_orm
json
parse_file
parse_obj
parse_raw
schema
schema_json
update_forward_refs
validate
- model_config: ClassVar[ConfigDict] = {'alias_generator': AliasGenerator(alias=<function to_camel>, validation_alias=None, serialization_alias=None), 'arbitrary_types_allowed': True, 'from_attributes': True, 'populate_by_name': True, 'validate_assignment': True, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- radiation_mode: str#
- class IonPlan(**data)[source]#
Bases:
PlanClass for an ion treatment plan.
- ionType#
Type of ion used in the plan.
- Type:
str
- Inherits all other attributes from Plan.
- radiation_mode : str
Returns the radiation mode as the ion type.
- Attributes:
model_extraGet extra fields set during validation.
model_fields_setReturns the set of fields that have been explicitly set on this model instance.
Methods
copy(*[, include, exclude, update, deep])Returns a copy of the model.
model_construct([_fields_set])Creates a new instance of the Model class with validated data.
model_copy(*[, update, deep])!!! abstract "Usage Documentation"
model_dump(*[, mode, include, exclude, ...])!!! abstract "Usage Documentation"
model_dump_json(*[, indent, ensure_ascii, ...])!!! abstract "Usage Documentation"
model_json_schema([by_alias, ref_template, ...])Generates a JSON schema for a model class.
model_parametrized_name(params)Compute the class name for parametrizations of generic classes.
model_post_init(context, /)Override this method to perform additional initialization after __init__ and model_construct.
model_rebuild(*[, force, raise_errors, ...])Try to rebuild the pydantic-core schema for the model.
model_validate(obj, *[, strict, extra, ...])Validate a pydantic model instance.
model_validate_json(json_data, *[, strict, ...])!!! abstract "Usage Documentation"
model_validate_strings(obj, *[, strict, ...])Validate the given object with string data against the Pydantic model.
to_matrad([context])Create a dictionary ready to save the Plan model to a mat-file.
validate_prop(v)Validate the workflow property dictionaries.
Validate the radiation mode for IonPlan.
construct
dict
from_orm
json
parse_file
parse_obj
parse_raw
schema
schema_json
update_forward_refs
validate
- available_radiation_modes: ClassVar[List[str]] = ['protons', 'helium', 'carbon', 'oxygen', 'VHEE']#
- model_config: ClassVar[ConfigDict] = {'alias_generator': AliasGenerator(alias=<function to_camel>, validation_alias=None, serialization_alias=None), 'arbitrary_types_allowed': True, 'from_attributes': True, 'populate_by_name': True, 'validate_assignment': True, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- radiation_mode: str#
- classmethod validate_radiation_mode(v)[source]#
Validate the radiation mode for IonPlan.
- Parameters:
cls (class) – The class object.
v (
str) – The radiation mode to be validated.
- Returns:
The validated radiation mode.
- Return type:
str- Raises:
ValueError – If the radiation mode is not one of the available radiation modes.