Hi Garrett,
I was given a set of TRF log files from an Elekta Unity, and for that set I was able to make it decode and be readable. So, with the latest version of PyMedPhys you will be able to run `pymedphys trf to-csv *.trf` in a directory that contains Unity log files and they should decode.
I have been in need of someone with a Unity to verify that these decoded results are representative of reality. So, that's where it is up to. Ideally, what I need, is actually a reference set of DICOM plans and corresponding trf logfiles (really just one for each plan type) so that I can upload them to the PyMedPhys Zenodo (
https://zenodo.org/communities/pymedphys/search?page=1&size=20). Then I can use that test data to then automatically verify for each PyMedPhys release that it can appropriately decode those Elekta Unity log files with a delivery that is equivalent to the DICOM plan file provided.
Once the TRF files have been verified to have been decoding appropriately then you can use the following workflow to read and compare files:
-----------------------------
import pymedphys
trf_file_path = 'path/to/trf/file'
dicom_plan_path = 'path/to/dicom/plan'
logfile_delivery = pymedphys.Delivery.from_logfile(trf_file_path)
dicom_delivery = pymedphys.Delivery.from_dicom(dicom_plan_path)
logfile_mudensity = logfile_delivery.mudensity()
dicom_mudensity = dicom_delivery.mudensity()
GRID = pymedphys.mudensity.grid()
COORDS = (GRID["jaw"], GRID["mlc"])
GAMMA_OPTIONS = {
'dose_percent_threshold': 2, # Not actually comparing dose though
'distance_mm_threshold': 0.5,
'local_gamma': True,
'quiet': True,
'max_gamma': 2,
}
def to_tuple(array):
return tuple(map(tuple, array))
gamma = pymedphys.gamma(
COORDS,
to_tuple(mudensity_tel),
COORDS,
to_tuple(mudensity_icom),
**GAMMA_OPTIONS
)
--------------------------
As an extra note, you are not limited to DICOM plan files or TRF log files. You can also, if you wish, set up an iCOM listener which will create iCOM logs live. These can then be also directly compared to Monaco's plan file format directly. For more on that see also that above link (
http://simonbiggs.net/icom).
Let me know if you have any issues. Also happy to have a chat at some point if you think that'd help.
Cheers,
Simon