MATLAB plugins#

Optional parts of TIGRE in MATLAB/Plugins; compiled plugins must be built first (see Plugins). Proton CT: Compile pCT, see Proton CT. Dual energy: nothing to compile, see Dual-energy CBCT.

Function

What it does

pCTCubicSpline

Optimised proton radiography from single-proton data.

DeDecompose

Maps CBCT projections taken at two kVp settings to equivalent thicknesses of material1 and material2 using precalibrated transfer functions.

MakeVMproj

Synthesizes virtual monoenergetic (VM) projections from basis material thickness projections.

pCTCubicSpline#

function proj = pCTCubicSpline(posIn, posOut, dirIn, dirOut, Wepl, eIn, geo)

PCTCUBICSPLINE Optimised proton radiography from single-proton data.

proj = pCTCubicSpline(posIn, posOut, dirIn, dirOut, Wepl, eIn, geo)

Estimates each proton’s path through the object with a cubic spline and bins its water-equivalent path length (WEPL) along it (Collins-Fekete et al., Phys. Med. Biol. 61 (2016) 8232). Same function and arguments as Python tigre.plugins.pct.pCTCubicSpline.

posIn, posOut entry and exit positions in mm: N-by-2 ([x y]) or a vector of length 2N (x of every proton, then y) dirIn, dirOut entry and exit directions (x and y, z component 1), same layout Wepl WEPL of each proton in mm, N values eIn initial beam energy in MeV geo dDetector (pixel size) and sDetector (size of the radiography), both [x; y]; DSO, DSID (source to entry detector), DSD (source to exit detector); hull = [a; b; alpha; h] (h = 0: no hull); mode, ‘parallel’ or

Options:

'cone'

. Lengths in mm. proj is single, indexed proj(y, x). Pixels no proton crossed are NaN. Inputs of any numeric type are converted to single (the MEX function, pCTCubicSpline_mex, needs single). Needs the plugin compiled: Compile pCT

Help text as in MATLAB
PCTCUBICSPLINE Optimised proton radiography from single-proton data.

  proj = pCTCubicSpline(posIn, posOut, dirIn, dirOut, Wepl, eIn, geo)

  Estimates each proton's path through the object with a cubic spline and
  bins its water-equivalent path length (WEPL) along it (Collins-Fekete et
  al., Phys. Med. Biol. 61 (2016) 8232). Same function and arguments as
  Python tigre.plugins.pct.pCTCubicSpline.

  posIn, posOut  entry and exit positions in mm: N-by-2 ([x y]) or a
                 vector of length 2N (x of every proton, then y)
  dirIn, dirOut  entry and exit directions (x and y, z component 1), same
                 layout
  Wepl           WEPL of each proton in mm, N values
  eIn            initial beam energy in MeV
  geo            dDetector (pixel size) and sDetector (size of the
                 radiography), both [x; y]; DSO, DSID (source to entry
                 detector), DSD (source to exit detector); hull =
                 [a; b; alpha; h] (h = 0: no hull); mode, 'parallel' or
                 'cone'. Lengths in mm.

  proj is single, indexed proj(y, x). Pixels no proton crossed are NaN.
  Inputs of any numeric type are converted to single (the MEX function,
  pCTCubicSpline_mex, needs single).

  Needs the plugin compiled: Compile pCT

Source: MATLAB/Plugins/pCT/pCTCubicSpline.m

DeDecompose#

function [material1_proj, material2_proj, angles_out] = DeDecompose(proj_l, angles_l, proj_h, angles_h, varargin)

DEDECOMPOSE Maps CBCT projections taken at two kVp settings to equivalent thicknesses of material1 and material2 using precalibrated transfer functions.

[m1, m2, angles] = DeDecompose(proj_l, angles_l, proj_h, angles_h, ...)

proj_l and angles_l are the projections and angles (radians) of the low-kV scan; proj_h and angles_h those of the high-kV scan. Both scans must have the same detector size. For each high-kV projection, the low-kV projection at the same angle is found (see ‘interpolation’), and every pixel pair (L, H) is mapped to two thicknesses with third-degree transfer functions whose coefficients come from the scanner’s calibration (Common/data/dual_energy_calibrations.json). Other scanners, kV pairs or basis materials need calibration data added there.

m1 and m2 are the thicknesses of material1 and material2, projection by projection, at the angles in angles (the high-kV angles, minus any skipped with ‘skip’).

Optional arguments (name-value pairs, names not case sensitive):

'scanner'

calibration to use. Default ‘VarianTrueBeam’ (with a warning: results are only quantitative with your own scanner’s calibration).

'kVl'

, ‘kVh’ kV of the low- and high-kV scans. Default 80, 140.

'material1'

default ‘Al’

'material2'

default ‘PMMA’

'interpolation'

how to get the low-kV projection at a high-kV angle:

  • 'nearest': the low-kV projection with the closest angle (default)

  • 'linear': linear interpolation between the two low-kV projections either side of the angle

  • 'skip': like ‘nearest’, but high-kV projections with no low-kV projection within ‘tolerance’ are skipped

'tolerance'

for ‘skip’, the largest angle difference in radians. Default: half the low-kV angular step. Method: Keeler A. et al., Technical note: TIGRE-DE for the creation of virtual monoenergetic images from dual-energy cone-beam CT, Med Phys 2024, https://doi.org/10.1002/mp.17002 (citeme(‘TIGRE-DE’)). Coded by: Andrew Keeler Contact: akeeler@luc.edu Date: February 28, 2024

Help text as in MATLAB
DEDECOMPOSE Maps CBCT projections taken at two kVp settings to equivalent
thicknesses of material1 and material2 using precalibrated transfer functions.

  [m1, m2, angles] = DeDecompose(proj_l, angles_l, proj_h, angles_h, ...)

  proj_l and angles_l are the projections and angles (radians) of the
  low-kV scan; proj_h and angles_h those of the high-kV scan. Both scans
  must have the same detector size. For each high-kV projection, the
  low-kV projection at the same angle is found (see 'interpolation'), and
  every pixel pair (L, H) is mapped to two thicknesses with third-degree
  transfer functions whose coefficients come from the scanner's
  calibration (Common/data/dual_energy_calibrations.json). Other
  scanners, kV pairs or basis materials need calibration data added there.

  m1 and m2 are the thicknesses of material1 and material2, projection by
  projection, at the angles in angles (the high-kV angles, minus any
  skipped with 'skip').

  Optional arguments (name-value pairs, names not case sensitive):
      'scanner'        calibration to use. Default 'VarianTrueBeam' (with
                       a warning: results are only quantitative with your
                       own scanner's calibration).
      'kVl', 'kVh'     kV of the low- and high-kV scans. Default 80, 140.
      'material1'      default 'Al'
      'material2'      default 'PMMA'
      'interpolation'  how to get the low-kV projection at a high-kV angle:
          'nearest'  the low-kV projection with the closest angle (default)
          'linear'   linear interpolation between the two low-kV
                     projections either side of the angle
          'skip'     like 'nearest', but high-kV projections with no
                     low-kV projection within 'tolerance' are skipped
      'tolerance'      for 'skip', the largest angle difference in
                       radians. Default: half the low-kV angular step.

  Method: Keeler A. et al., Technical note: TIGRE-DE for the creation of
  virtual monoenergetic images from dual-energy cone-beam CT, Med Phys
  2024, https://doi.org/10.1002/mp.17002 (citeme('TIGRE-DE')).

  Coded by: Andrew Keeler
  Contact: akeeler@luc.edu
  Date: February 28, 2024

Source: MATLAB/Plugins/DualEnergy/DeDecompose.m

MakeVMproj#

function [VM_proj] = MakeVMproj(material1_proj, material2_proj, energy, varargin)

MAKEVMPROJ Synthesizes virtual monoenergetic (VM) projections from basis material thickness projections.

VM_proj = MakeVMproj(m1, m2, energy, 'material1', 'Al', 'material2', 'PMMA')

m1 and m2 are the thickness projections from DeDecompose, energy is in keV. VM_proj = mu1(energy)*m1 + mu2(energy)*m2, with the attenuation coefficients mu from Common/data/NIST_material_attenuation.json, interpolated with a cubic spline. Reconstruct VM_proj with any TIGRE algorithm to get a VM image.

Optional arguments (name-value pairs, names not case sensitive):

'material1'

default ‘Al’

'material2'

default ‘PMMA’ Method: Keeler A. et al., Technical note: TIGRE-DE for the creation of virtual monoenergetic images from dual-energy cone-beam CT, Med Phys 2024, https://doi.org/10.1002/mp.17002 (citeme(‘TIGRE-DE’)). Coded by: Andrew Keeler Contact: akeeler@luc.edu Date: February 28, 2024

Help text as in MATLAB
MAKEVMPROJ Synthesizes virtual monoenergetic (VM) projections from basis
material thickness projections.

  VM_proj = MakeVMproj(m1, m2, energy, 'material1', 'Al', 'material2', 'PMMA')

  m1 and m2 are the thickness projections from DeDecompose, energy is in
  keV. VM_proj = mu1(energy)*m1 + mu2(energy)*m2, with the attenuation
  coefficients mu from Common/data/NIST_material_attenuation.json,
  interpolated with a cubic spline. Reconstruct VM_proj with any TIGRE
  algorithm to get a VM image.

  Optional arguments (name-value pairs, names not case sensitive):
      'material1'  default 'Al'
      'material2'  default 'PMMA'

  Method: Keeler A. et al., Technical note: TIGRE-DE for the creation of
  virtual monoenergetic images from dual-energy cone-beam CT, Med Phys
  2024, https://doi.org/10.1002/mp.17002 (citeme('TIGRE-DE')).

  Coded by: Andrew Keeler
  Contact: akeeler@luc.edu
  Date: February 28, 2024

Source: MATLAB/Plugins/DualEnergy/MakeVMproj.m