.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "demos\03_geometry\d15_3Dparallel.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_03_geometry_d15_3Dparallel.py: Parallel-beam geometry ====================== Reconstruct 3D parallel-beam data, as from a synchrotron. Source: `Python/demos/d15_3Dparallel.py `__ ยท `MATLAB/Demos/d15_3Dparallel.m `__ .. dropdown:: MATLAB version of this demo :icon: code .. literalinclude:: /../MATLAB/Demos/d15_3Dparallel.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-37 .. code-block:: Python # While you can defien you rown geometry, the easiest way is: # just give as nVoxel the same number as your projection size. geo = tigre.geometry( mode="parallel", nVoxel=np.array([512, 512, 512]) ) # Parallel beam geometry does not require anything other than the image size. .. GENERATED FROM PYTHON SOURCE LINES 38-40 Load data and generate projections ---------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 40-56 .. 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])) # recon imgFBP = algs.fbp(projections, geo, angles) imgOSSART = algs.ossart(projections, geo, angles, 40) # plot tigre.plotImg(np.concatenate([head, imgFBP, imgOSSART], axis=1), dim="z", step=3) .. image-sg:: /demos/03_geometry/images/sphx_glr_d15_3Dparallel_001.gif :alt: d15 3Dparallel :srcset: /demos/03_geometry/images/sphx_glr_d15_3Dparallel_001.gif :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none OSSART algorithm in progress. Estimated time until completion : 00:02:47 Algorithm will finish at : 16:55:52 .. rst-class:: sphx-glr-timing **Total running time of the script:** (2 minutes 57.472 seconds) .. _sphx_glr_download_demos_03_geometry_d15_3Dparallel.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: d15_3Dparallel.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: d15_3Dparallel.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: d15_3Dparallel.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_