.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "demos/04_data/pRad_demo.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_pRad_demo.m: Proton radiography ================== Compute an optimised proton radiography. See :doc:`/user-guide/proton-ct`. Source: `MATLAB/Demos/pRad_demo.m `__ This demo is only available in MATLAB, so it is shown without output. .. GENERATED FROM PYTHON SOURCE LINES 6-8 pCT geometry definition ----------------------- .. GENERATED FROM PYTHON SOURCE LINES 11-19 .. code-block:: Matlab geo.dDetector = [0.25; 0.25]; % Pixel size of optimized pRad in mm. geo.DSID = 245; % Distance between source and upstream detector. geo.DSO = 300; % Distance between source and origin (center of rotation). geo.DSD = 355; % Distance between source and downstream detector. geo.hull = [0; 0; 0; 0]; % We won't use a convex hull here (all entries are % set to 0). geo.sDetector = [20; 20]; % Defines the size (in mm) of the optimized pRad. geo.mode = 'parallel'; % or 'cone' in case of cone beam geometry .. GENERATED FROM PYTHON SOURCE LINES 17-19 pCT initial beam energy ----------------------- .. GENERATED FROM PYTHON SOURCE LINES 22-23 .. code-block:: Matlab eIn = single(100); .. GENERATED FROM PYTHON SOURCE LINES 21-23 Load pCT data set. ------------------ .. GENERATED FROM PYTHON SOURCE LINES 26-33 .. code-block:: Matlab % The data set corresponds to one radiographic image (pRad) of an Aluminum % stair profile as used in https://arxiv.org/abs/2106.12890. However, our % test data set is based on Monte Carlo simulations (GATE: % doi.org/10.1016/S0920-5632(03)90969-8). The data set contains the % protons' upstream and downstream positions and directions as well as the % single proton WEPLs (all in mm). data = pCTdata(); .. GENERATED FROM PYTHON SOURCE LINES 31-33 Binning the data into an optimized pRad --------------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 36-42 .. code-block:: Matlab % Finally, the single proton data are binned into an optimized pRad. proj = pCTCubicSpline_mex(data.posIn, data.posOut, data.dirIn, ... data.dirOut, data.Wepl, eIn, geo); % We are only creating one test pRad here. Creating pRads at multiple % rotation angles would allow to use the collection as input for TIGRE's % reconstruction algorithms (see d04_SimpleReconstruction.m). .. GENERATED FROM PYTHON SOURCE LINES 40-42 Plot the result --------------- .. GENERATED FROM PYTHON SOURCE LINES 44-44 .. code-block:: Matlab imshow(proj, [0, 3], 'InitialMagnification', 500); .. _sphx_glr_download_demos_04_data_pRad_demo.m: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Matlab source code: pRad_demo.m ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: pRad_demo.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_