.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "demos\02_algorithms\d06_Algorithms01.py" .. 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_02_algorithms_d06_Algorithms01.py: FDK and its filters =================== Filtered backprojection for cone beam, with the available filters. Source: `Python/demos/d06_Algorithms01.py `__ ยท `MATLAB/Demos/d06_Algorithms01.m `__ .. dropdown:: MATLAB version of this demo :icon: code .. literalinclude:: /../MATLAB/Demos/d06_Algorithms01.m :language: matlab .. GENERATED FROM PYTHON SOURCE LINES 17-19 Initialize ---------- .. GENERATED FROM PYTHON SOURCE LINES 19-26 .. code-block:: Python import tigre import numpy as np from tigre.utilities import sample_loader from tigre.utilities import CTnoise import tigre.algorithms as algs .. GENERATED FROM PYTHON SOURCE LINES 27-29 Geometry -------- .. GENERATED FROM PYTHON SOURCE LINES 29-32 .. code-block:: Python geo = tigre.geometry_default(high_resolution=False) .. GENERATED FROM PYTHON SOURCE LINES 33-35 Load data and generate projections ---------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 35-45 .. code-block:: Python # define angles angles = np.linspace(0, 2 * np.pi, 100, endpoint=False) # Load thorax phantom data head = sample_loader.load_head_phantom(geo.nVoxel) # generate projections projections = tigre.Ax(head, geo, angles) # add noise noise_projections = CTnoise.add(projections, Poisson=1e5, Gaussian=np.array([0, 10])) .. GENERATED FROM PYTHON SOURCE LINES 46-48 Usage of FDK ------------ .. GENERATED FROM PYTHON SOURCE LINES 48-77 .. code-block:: Python # the FDK algorithm has been taken and modified from # 3D Cone beam CT (CBCT) projection backprojection FDK, iterative reconstruction Matlab examples # https://www.mathworks.com/matlabcentral/fileexchange/35548-3d-cone-beam-ct--cbct--projection-backprojection-fdk--iterative-reconstruction-matlab-examples # The algorithm takes, as any of them, 3 mandatory inputs: # PROJECTIONS: Projection data # GEOMETRY : Geometry describing the system # ANGLES : Projection angles # And has a single optional argument: # FILTER: filter type applied to the projections. Possible options are # 'ram_lak' (default) # 'shepp_logan' # 'cosine' # 'hamming' # 'hann' # The choice of filter will modify the noise and some discretization # errors, depending on which is chosen. # imgFDK1 = algs.fdk(noise_projections, geo, angles, filter="hann") imgFDK2 = algs.fdk(noise_projections, geo, angles, filter="ram_lak") # They look quite the same tigre.plotimg(np.concatenate([imgFDK1, imgFDK2], axis=1), dim="Z") # but it can be seen that one has bigger errors in the whole image, while # the other just in the boundaries tigre.plotimg(np.concatenate([abs(head - imgFDK1), abs(head - imgFDK2)], axis=1), dim="Z") .. rst-class:: sphx-glr-horizontal * .. image-sg:: /demos/02_algorithms/images/sphx_glr_d06_Algorithms01_001.gif :alt: d06 Algorithms01 :srcset: /demos/02_algorithms/images/sphx_glr_d06_Algorithms01_001.gif :class: sphx-glr-multi-img * .. image-sg:: /demos/02_algorithms/images/sphx_glr_d06_Algorithms01_002.gif :alt: d06 Algorithms01 :srcset: /demos/02_algorithms/images/sphx_glr_d06_Algorithms01_002.gif :class: sphx-glr-multi-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 8.566 seconds) .. _sphx_glr_download_demos_02_algorithms_d06_Algorithms01.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: d06_Algorithms01.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: d06_Algorithms01.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: d06_Algorithms01.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_