.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "demos/04_data/d23_DualEnergy.m" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_demos_04_data_d23_DualEnergy.m: Dual-energy CBCT ================ Material decomposition from two scans at different tube voltages. Source: `MATLAB/Demos/d23_DualEnergy.m `__ This demo is only available in MATLAB, so it is shown without output. .. GENERATED FROM PYTHON SOURCE LINES 6-8 Data loading (See d21\_ScannerDataLoader.m) ------------------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 11-20 .. code-block:: Matlab % We'll use VarianDataLoader as an example. Load two sets of scan data % at different kV settings into memory. Geo should be the same for both % scans, and so only needs to be loaded once. Beam hardening correction % is not needed. datafolder_low='~/your_data_path/varian/low_kV/2020-01-01_123456/'; datafolder_high='~/your_data_path/varian/high_kV/2020-01-01_123456/'; [proj_h, geo, angles_h] = VarianDataLoader(datafolder_high, 'bh', false); [proj_l, ~, angles_l] = VarianDataLoader(datafolder, 'bh', false); .. GENERATED FROM PYTHON SOURCE LINES 18-20 Material Decomposition ---------------------- .. GENERATED FROM PYTHON SOURCE LINES 23-34 .. code-block:: Matlab % DE-CBCT decomposes the two scans into equivalent thicknesses of two basis % materials. Generally, either Al and PMMA or Iodine and Water are used. % The calibration in TIGRE has uses Al and PMM, but other materials are % supported if the calibration files are updated with the data (contact % developers or make a PR for expanding this) % % The decomposition procedure defaults to taking scans at 80 and 140 kV. % Different energies can be specified using the 'kVl' and 'kVh' tags. [Al_proj, PMMA_proj, angles] = DeDecompose(proj_l, angles_l, proj_h, angles_h, ... % The following are defaults 'scanner','VarianTrueBeam','material1','Al','material2', 'PMMA','kVl', 80, 'kVh', 140); .. GENERATED FROM PYTHON SOURCE LINES 32-34 Image construction ------------------ .. GENERATED FROM PYTHON SOURCE LINES 37-46 .. code-block:: Matlab % Equivalent thickness projections can now be used to synthesize various % DE-derived image types. The most common of these are virtual % monoenergetic (VM) images. energy = 60; % keV VM_proj = MakeVMproj(Al_proj, PMMA_proj, energy,'material1','Al','material2','PMMA'); VMimg = FDK(VM_proj, geo, angles); VMimg = OS_SART(VM_proj, geo, angles, 100); .. GENERATED FROM PYTHON SOURCE LINES 44-46 Plot image ---------- .. GENERATED FROM PYTHON SOURCE LINES 48-48 .. code-block:: Matlab plotImg(VMimg) .. _sphx_glr_download_demos_04_data_d23_DualEnergy.m: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Matlab source code: d23_DualEnergy.m ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: d23_DualEnergy.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_