Create a folder structure for each field in the treatment plan.
The function creates a folder structure in a given folderPath for each field separately.
The folder structure is in the form:
folderPath/folderName:
/ 1_Field2
/ 2_Field3
/ 3_Field1
…
The number at the beginning of the folder name is the delivery number
and the number after Field is the ID of the field.
Parameters:
folderPath (path) – Path to a folder to create the structure.
RNfileName (path) – Path to RN dicom file of a treatment plan.
folderName (string, optional) – Name of the folder to create. (def. ‘FRED’)
overwrite (bool, optional) – Determine if the folder should be overwritten.
If true, then all the data in the existing folder will be
removed. (def. False)
displayInfo (bool, optional) – Displays a summary of the function results. (def. False)
Read FRED simulation statistics information from the log file.
The function reads some statistics information from a FRED run.out logfile.
If some information is unavailable, then a NaN or numpy.np.nan is returned.
Parameters:
fileNameLogOut (string) – A string path to FRED output logfile (usually in out/log/run.out)
displayInfo (bool, optional) – Displays a summary of the function results. (def. False)
The function writes the beam model parameters in YAML format for a beam model file.
The beam model must be defined as a dictionary. If a value of a given key is a pandas DataFrame,
it will be saved to a nicely formatted table.
Parameters:
beamModel (dict) – Beam model defined as a dictionary with the required keys.
fileName (string) – A string path to beam model YAML file. It is recommended to use .bm file extension.
The function reads the beam model parameters from a YAML beam model file.
The beam model must be defined as a dictionary. All the pandas DataFrame-like lists
will be converted to pandas.DataFrame objects, whereas any items in square
brackets will be converted to a numpy array object.
Parameters:
fileName (string) – A string path to beam model YAML file.
Returns:
A dictionary with the beam model and required kays.
Interpolate beam model for a given nominal energy.
The function interpolates all the beam model parameters for a given nominal energies
which must be in range of the defined nominal energies in the beam model. The possible
interpolation methods are ‘nearest’, ‘linear’ or ‘spline’ with order in range 0-5.
Parameters:
beamModel (DataFrame) – Beam model defined as a pandas DataFrame object.
nomEnergy (scalar or list) – The list of nominal energies to interpolate the beam model parameters for.
The function reads hits results of GATE active volume saved
to numpy pickle (.npy) or root (.root) file. All the columns
are read but some of them are renamed:
The function reads hits results of GATE active volume saved
to numpy pickle (.npy) or root (.root) file. All the columns
are read but some of them are renamed:
The function calculates the ray position and direction versor from the target position.
The target point can be a 3-element iterable or Nx3 iterable for multiple points.
The Source-To-Axis Distance (SAD) describes the absolute distances of the spreading
devices in order [X, Y]. It does not matter if the first divergence is in X or Y, the function
takes this information from the distances, but the order [X,Y] must be preserved.
Parameters:
targetPoint (3-element or Nx3 iterable) – The position of a single target point or positions of N target points.
SAD (2-element iterable) – The absolute distances of the spreading devices in order [X,Y].
Returns:
A tuple with two Nx3 arrays, where the first is the ray position and the second is the ray direction versor.