MATLAB desktop

We want to come back to the topic of 2001, where we described some ways of analyzing sliding window (DMLC-) treatments on our Varian machines (Clinac 2300C/D with 80-leaf MLC). This can be used for pre-treatment fluence verification and daily treatment monitoring - a software alternative to hardware devices like DAVID or Compass.

Since MATLAB has become the standard of technical computing, we want to review the DMLC topic by using this tool.

Starter package

There are four very simple MATLAB scripts:

All scripts are heavily commented. It should become clear what they do after reading the comments in the source code.

Principle of fluence computation

In principle, photons are getting through the MLC (hitting some virtual film) whenever

In the 'flu.m' script, the difference in MU counter (1st column of the log files) from one record to the next is interpreted as current dose rate. Every 50 ms, the value of each exposed pixel in the fluence matrices 'fp' (planned fluence) and 'ft' (true fluence) are increased by the current dose rate. This is how the fluence maps build up.

Note that the fluence script uses a distance scale which is different from the position/gap/velocity scripts. The fluence script use the raw scale for the horizontal axis (the direction of leaf movement). In the other scripts distance is plotted as a function of time. The distance is in terms of [mm] at isocenter. The time (horizontal axis) is in terms of record number (20 records representing 1 second of delivery - see sidebar).

For the sake of simplicity, we ignore the jaws. Leaf pairs that will not move during a treatment are always 'parked' under the jaws. Since we ignore this, in our fluence computation closed leaf pairs 'burn a hole' into film. In the 'flu.m' skript, we therefore crop the fluence maps: 2 mm on the left border (where the closed leaf pairs are usually parked) are cut away.

Here is a ZIP of some sample DYNALOG files to play around with. The first line in each file is already removed (see comment in scripts), so they can be loaded without prior editing.

Clinical example

On our old machines with their old MLC controller running under DOS, it is uncommon to save logfiles after real patient treatments1. After saving the files, one has to exit the MLC controller software to get to DOS, ZIP the logs, copy them to floppy (here the doit script helps a lot), and reinitialize the MLC. This is unacceptable in a busy department.

Here is one example of a typical lateral prostate IMRT field. Planned and true fluence are visually indistinguishable:

Planned fluence

True fluence

The colormap of the error fluence was already adapted, so that a noticeable fraction of image pixels show up. Compared to the planned fluence, the maximum error is around 1%:

Error fluence

The zoom gives an idea of the high resolution. The stripes with the higher error are extremely small. Yellow dominates. This corresponds to a local fluence error of 0.3-0.4%:

Error fluence

Gravity tests

If there are gravity effects, they could be visible on the logs as well. In the following example, a field was treated at Gantry angles 0°, 90° and 270°. At 90° leaves are allowed to go 'down', at 270° they are forced to go 'up'. This is how the planned fluence looks like:

Planned fluence

One can use the 'flu.m' script for the 90° side, save away the true fluence ft90 to a new variable, (comment out the 'clear' command in the first line of the script, otherwise ft90 will be gone!) evaluate the 270° side, and calculate the difference of the true fluences ft270 - ft90. The resulting plot suggest that there is no dependence on gravity:

Error fluence

1 Of course one can always generate logfiles without the patient on the table!