pyRadPlan.io package#

Submodules#

pyRadPlan.io.matLabFileHandler module#

pyRadPlan.io.matRad module#

pyRadPlan.io.readHLUT module#

Module contents#

Data input/output and file handling.

class MatlabFileHandler(temp_path)[source]#

Bases: object

Handler for Matlab files.

Methods

delete

load

save

delete(*args)[source]#
load(*args)[source]#
save(**kwargs)[source]#
load_patient(filename, extra_plan_data=None, extra_data=None)[source]#

Load a patient from a file.

Chooses loader from the extension.

Parameters:
  • filename (PathLike) – Path to the file.

  • additional_plan_data (Optional[dict]) – Additional data structures known to pyRadPlan that were present in the mat file

Return type:

tuple[CT, StructureSet]

load_tg119()[source]#

Load the included TG119 phantom.

This is a helper function to load the TG119 phantom included in the package data using importlib.resources.

Returns:

The CT and StructureSet objects.

Return type:

tuple[CT, StructureSet]

validate_matrad_patient(mdict, remove_matrad_structures=True)[source]#

Load a matRad-like patient from a mat file.

Assumes that the file uses matRad’s data structures and tries to validates them.

Parameters:
  • mdict (dict[str]) – Dictionary imported from a .mat file. Modified if remove_matrad_structures is True.

  • remove_matrad_structures (bool) – Pop the input data recognized/named as matRad structures from the dictionary.

Returns:

A dictionary with the validated data.

Return type:

dict[str]