Deconvolution Kernel Fit Program

For pre-treatment and exit kernels

13 August 2010

 

Deconvolution Kernel Fit Program... 1

Introduction.. 1

Fit Exit Deconvolution Toolbar.. 1

Fit File. 2

Guess Section. 3

Set Description.. 5

Read prior exit kernel file for guess. 5

Show initial guess result.. 5

Fit Kernel. 6

Example screen plots. 6

Report on Fit.. 8

 

 

 

Introduction

This program will fit the deconvolution kernel for both pre-treatment and exit dose reconstruction.  The fitting routine provided with ConvertxxxxImages may still be used for pre-treatment kernels, but this routine can do both.  For a pre-treatment kernel only, you would only fit for zero thickness.  Since a kernel for multiple thicknesses includes zero thickness, it can be used for either case. There is little affect in taking images at different source image distances on the deconvolution kernel.

 

Fit Exit Deconvolution Toolbar

The fit toolbar has only one pull down menu on it.   You will first select to read in the fit file which will contain the input information directing the fit.

 

 

 

Fit File

The fit file contains all the information needed to run a fit.  You must edit this file with your data.   Once you have written this file, you can run it again if the need arises.  This saves time from having to select a multitude of files and specifying data.

 

An example file follows below with explanations.  The file follows the ASCII file standard for System2100 (see the System2100 manual).  The first part of the file defines the machine name and the energy.  If narrow beam correction is on, then the file InWaterTransmissionFitnn must be in the energy directory, where nn is the energy (06 here for 6 MV). 

 

The next field is the OCR option.  For Siemens and Elekta this will be 1. For Varian probably 2 as by default Portal Vision will multiply the OCR into the integrated images.  That feature can be turned off in Portal Vision in which case you would select 1 below.  This choice is passed on the kernel file and can be changed there.

Next there is a description field which is passed on to the kernel file.

 

Next you must enter the number of fields measured.  You must use the same field sizes for all thicknesses.  With each field size enter the collimator scatter factor.  You can read the Sc factors from the file FieldSizeFactors_nn in the beam data directory.  If this file does not have the field size you need, make an entry in the output file for this energy and run GenerateBeamParameters.  Be sure the dose rates in the output file are consistent with the calibration file.

 

Example fit file:

 

/* file type:  exit dose data for fit */ 18

/* format version */ 1

/*  machine name:  */  <*ARCNY*>

/*  energy    MeV  */   6

 

/*  Narrow Beam Correction:  0 no, 1 yes*/ 1

 

/*  in air OCR option:

        1 multiply in OCR

        2 make no correction:  */  2

 

// Description:

<* Fit with Varian attenuation data.

*>

 

/* number of field sizes */  5

 

/*  list of field sizes in order (both dimensions each) in

 increasing order. Last would be 25 25 or 25 20 for example.

 field size cm   Sc factor  */

 

  5.0   5.0        0.9661

 10.0  10.0        1.0000

 15.0  15.0        1.0168

 20.0  20.0        1.0260

 25.0  20.0        1.0313

 

Next will come the list of thicknesses that were measured.  You must enter the number of thicknesses that are to follow.  Follow that with an entry for each thickness that specifies the thickness in cm, the file name for each field size and the monitor unit used for that file.  The field sizes must be listed in the same order.  

 

/* number of thicknesses, to start with zero */ 13

 

// for each thickness (in order of increasing thickness) enter:

 

// thickness  in cm

// list of file names for each field size with the mu used

// for each field in same order as above!

// file name       mu

      0

  5x5_00.rmu  100

10x10_00.rmu  100

15x15_00.rmu  100

20x20_00.rmu  100

25x20_00.rmu  100

 

 

  5

  5x5_05.rmu  100

10x10_05.rmu  100

15x15_05.rmu  100

20x20_05.rmu  100

25x20_05.rmu  100

 

Continue for all the thicknesses.  In this example the last thickness was 60.0 cm.

Guess Section

The next section of the file is not normally to be disturbed.   It contains an initial guess for various thicknesses.  The thicknesses do not have to be the same as in the above list to be fitted.  Rather the program will use the closest thickness that it finds in the below list when fitting a thickness specified above.  The values were found below from prior successful fits.

 

A iterative method for fitting parameters depends upon having a good initial guess.  Once a good fit is found, those fit parameters can be used in the future as an initial guess for future problems.  But getting that first guess often requires a great deal of trial and error.  The file provided for this purpose has the results of a good fit for the starting guess.  One also has the option of selecting an exiting or prior kernel file for the initial guesses after reading in the fit file.  One can simply cycle back and read the kernel file just produced for a second go around which usually will give improved results.  If a particular thickness is not fitting well, try using as a guess the parameters for the next adjoining thickness.

 

The guess section also specifies the number of exponentials that are to be fitted up to five.  The guess sections appears as below:

 

//  Initial guess.  Closest thickness is used.

/* number of thickneses: */ 13

 

 

/* thickness cm : */ 0.000000

 

/* number of exponentials: */ 5

           66.6448            22.9857

         0.0684604            2.24048

        0.00626482           0.526565

      6.53152e-005          0.0650131

      2.39305e-007         0.00566613

 

/* thickness cm : */ 5.000000

 

/* number of exponentials: */ 5

           64.6899            23.0435

         0.0691486            2.24048

         0.0061963           0.557187

       0.000130266            0.05228

      1.79497e-007         0.00543618

 

and continues for all 13 thicknesses in this example file.

 

The last section contains information for the fitting routine:

 

/* min and max value for each variable

   5 exponentials maximum allowed

 

     Minimum             Maximum */

 

     1.0                 200.   // multiplier

     10.0                100.0   // exponent

 

 

     1.0e-8               100.0   // multiplier

     1.0e-2               10.0  // exponent

 

     1.0e-8               10.0  // multiplier

     1.0e-3               10.0   // exponent

 

     1.0e-10              10.0  // multiplier

     1.0e-4               10.0  // exponent

 

     1.0e-12              10.0  // multiplier

     1.0e-5               10.0  // exponent

 

 

/*  starting step size fraction, and stopping step size fraction, fraction of the inital guess above. Up to 5 exponentials

 

    step      stop   */

     1.0      0.001

     1.0      0.001

 

     1.0      0.001

     1.0      0.001

 

     1.0      0.001

     1.0      0.001

 

     1.0      0.001

     1.0      0.001

 

     1.0      0.001

     1.0      0.001

 

For each of the up to five possible exponentials will be a list of the minimum and maximum value allowed for that exponential, in order of the multiplier followed by the exponent.  This list always goes up to five pairs.

 

Then follows the starting and stopping fraction step size for each variable.  This list always goes to ten variables, two for each exponential.  The start value of 1.0 means the algorithm will begin with a step size of 1 times the initial guess.  The stopping fraction of 0.001 means the algorithm will stop when the step size is 0.001 times the initial guess.  Making the stopping fraction smaller will increase the number of iterations. 

 

Set Description

You can change the description that was in the fit file.

 

Read prior exit kernel file for guess

You can override the values of the initial guess in the fit file by reading in an existing kernel file.   This must occur after reading in the above fit file but can occur after doing a fit for a second run.  Results usually improve by doing so.

 

Show initial guess result

This function will draw a graph for each field size and thickness showing the initial profile through the image file in the x and y directions, and the profile for both the x and y directions using the initial guess values.   Plotted also will be the Sc factor times the in air off center ratio for the machine and energy selected.  Ideally the processed profiles will lie on top of the off center ratio plot.  Running this option will detect any errors in the input image files before attempting a fit.  See the below section for an example screen display.

 

Fit Kernel

Runs the fit.  As there are separate fits done for each thickness, this could take an hour or two.  When it is done the result is plotted as described above.  The dotted curves should agree with the Sc factor on the central axis (see below examples).  If you run this program from a command prompt window, you will see information written to standard out during the iteration process.

 

A kernel file is written out to the location of deconvolution kernel files.  At the end of the kernel file is a report on the fit (see the below example).

 

Example screen plots

An example screen display showing the plotted results beside the image of each file after deconvolution as described above in “Show initial guess result”:

 

 

The top solid line is the Sc factor times the in air off center ratio.  The two dotted lines are x and y profile after deconvolution of the input image file.   The bottom solid lines are the x and y profile through the original image for the field size.  Shown below is a 10x10 cm field size with 30 cm thick phantom in the beam:

 

 

As the thickness gets larger and the field size gets larger, the computed profile will deviate considerably from the Sc factor times the in air off axis factor as shown below.   This is presently a limitation on the method as we are assuming that the scatter is a constant across the EPID.  This will be addressed in future improvements.  This is not a serious limitation for small modulated fields.

 

Report on Fit

The report is at the end of the kernel file, and will show the Sc factor that is computed for each field size after the deconvolution of the field image with the fitted kernel, and compared to the intended Sc factor, for each thickness. An example of the report at the end of the kernel file is shown below:

 

/*      Report on fit

 

    Field size response:

 

  Field Size   Raw c.a.     After       Sc         %      Ratio

     cm        Signal        c.a.                 diff

 

     Thickness = 0.000

 5.0 x  5.0    91.0515      0.9676     0.9661       0.15  0.0106

10.0 x 10.0   100.0159      0.9953     1.0000      -0.47  0.0100

15.0 x 15.0   106.0612      1.0187     1.0168       0.18  0.0096

20.0 x 20.0   109.6966      1.0285     1.0260       0.24  0.0094

25.0 x 20.0   110.9918      1.0293     1.0313      -0.19  0.0093

 

     Thickness = 5.000

 5.0 x  5.0    67.9764      0.9709     0.9661       0.49  0.0143

10.0 x 10.0    75.0576      0.9976     1.0000      -0.24  0.0133

15.0 x 15.0    80.1096      1.0142     1.0168      -0.26  0.0127

20.0 x 20.0    84.7627      1.0294     1.0260       0.34  0.0121

25.0 x 20.0    86.6026      1.0300     1.0313      -0.12  0.0119

 

...

 

     Thickness = 60.000

 5.0 x  5.0     6.0280      0.9736     0.9661       0.78  0.1615

10.0 x 10.0     7.2605      0.9976     1.0000      -0.24  0.1374

15.0 x 15.0     8.6962      1.0126     1.0168      -0.41  0.1164

20.0 x 20.0    10.2015      1.0323     1.0260       0.61  0.1012

25.0 x 20.0    10.9144      1.0283     1.0313      -0.29  0.0942

 

*/

 

and so on for the rest of the thicknesses that were fitted.   One wants to see the % difference less than 1% for all field sizes and thicknesses.