{ "info": { "author": "Christopher Syben", "author_email": "christopher.syben@fau.de", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "FRAMEWORK\n==========\n\n.. image:: https://badge.fury.io/py/pyronn.svg\n :target: https://badge.fury.io/py/pyronn\n :alt: PyPI version\n\n\n\nThe python framework for the PYRO-NN layers implemented in (https://github.com/csyben/PYRO-NN-Layers)\n\nPYRO-NN\n=========\n\nPYRO-NN brings state-of-the-art reconstruction algorithm to neural networks integrated into Tensorflow.\n\nTo use pyronn you need to build the operators from sources or install the provided binaries from\nhttps://github.com/csyben/PYRO-NN-Layers\n\nThe publication can be found under (pre-print coming soon)\n\nInstallation\n============\n\nInstall via pip :\n\n.. code-block:: bash\n\n pip install pyronn\n\nor if you downloaded this repository (https://github.com/csyben/PYRO-NN) using:\n\n.. code-block:: bash\n\n pip install -e .\n\nIf you encounter a problem during the installation have a look at our wiki: https://github.com/csyben/PYRO-NN/wiki\n\n\nChangelog\n=========\n\nCan be found `CHANGELOG.md `_.\n\nUsage\n======\nPYRO-NN comes with all relevant helper classes to easily run the projection and back-projection operators within the Tensorflow context.\n\nTo use the Layers a geometry object is needed:\n\n.. code-block:: python\n\n from pyronn.ct_reconstruction.geometry.geometry_parallel_2d import GeometryParallel2D\n\n\n volume_size = 256\n volume_shape = [volume_size, volume_size]\n volume_spacing = [1, 1]\n\n # Detector Parameters:\n detector_shape = 512\n detector_spacing = 1\n\n # Trajectory Parameters:\n number_of_par_projections = 360\n angular_range = 2 * np.pi\n\n # create Geometry class\n par_geometry = GeometryParallel(volume_shape, volume_spacing, detector_shape, detector_spacing, number_of_fan_projections, angular_range)\n\nAfter defining the basic geometry parameters, a trajectory need to be set. The circular_trajectory class computes an idealiyed\ncircular trajectory for a given geometry. For 2D parallel- and fan-beam geometry a trajectory is described using the central ray vectors.\nFor 3D cone-beam geometry the trajectory is described with projection matrices.\n\nThe trajectory can be calculated and set as follows:\n\n.. code-block:: python\n\n from pyronn.ct_reconstruction.helpers.trajectories import circular_trajectory\n\n par_geometry.set_central_ray_vectors(circular_trajectory.circular_trajectory_2d(par_geometry))\n\nAt this point the geometry is fully setup and can be used to create projections and reconstructions.\nThe Layers just takes the respective input tensor and the geometry object to conduct the projection, reconstruction respectively.\nPYRO-NN also provides convinient general way to create sinograms and reconstructions. The generate methods are generalized\nand take the input data, the layer to be used and the geometry. The only restriction is that the generation methods are within\nthe Tensorflow session scope:\n\n.. code-block:: python\n\n from pyronn.ct_reconstruction.layers.projection_2d import parallel_projection2d\n from pyronn.ct_reconstruction.layers.backprojection_2d import parallel_backprojection2d\n from pyronn.ct_reconstruction.helpers.misc import generate_sinogram as sino_helper\n from pyronn.ct_reconstruction.helpers.misc import generate_reco as reco_helper\n from pyronn.ct_reconstruction.helpers.phantoms import shepp_logan\n\n phantom = shepp_logan.shepp_logan_enhanced(par_geometry.volume_shape)\n\n with tf.Session as sess:\n sinogram = sino_helper.generate_sinogram(phantom, parallel_projection2d, par_geometry)\n reconstruction = reco_helper.generate_reco(sinogram, parallel_backprojection2d, par_geometry)\n\nIn the following the example using the Layers directly is shown (Note that the Layers are within the Tensorflow graph context\nand therefore need to be evaluated before the result can be accessed):\n\n.. code-block:: python\n\n from pyronn.ct_reconstruction.layers.projection_2d import parallel_projection2d\n from pyronn.ct_reconstruction.helpers.phantoms import shepp_logan\n\n phantom = shepp_logan.shepp_logan_enhanced(par_geometry.volume_shape)\n\n with tf.Session as sess:\n result = parallel_projection2d(phantom, par_geometry)\n sinogram = result.eval()\n\nUsing the PYRO-NN Layers directly registers the respective gradient, thus they can be used as normal Tensorflow Layers within the graph.\nFor more details checkout the examples which are covering the different geometry and application cases.\n\nPotential Challenges\n====================\n\nMemory consumption on the graphics card can be a problem with CT datasets. For the reconstruction operators the input data is passed via a Tensorflow tensor,\nwhich is already allocated on the graphicscard by Tensorflow itself. In fact without any manual configuration Tensorflow will allocate most of\nthe graphics card memory and handle the memory management internally. This leads to the problem that CUDA malloc calls in the operators itself will allocate\nmemory outside of the Tensorflow context, which can easily lead to out of memory errors, although the memory is not full.\n\nThere exist two ways of dealing with this problem:\n\n1. A convenient way is to reduce the initially allocated memory by Tensorflow itself and allow a memory growth. We suggest to always use this mechanism\nto minimize the occurrence of out of memory errors:\n\n.. code-block:: python\n\n config = tf.ConfigProto()\n config.gpu_options.per_process_gpu_memory_fraction = 0.5\n config.gpu_options.allow_growth = True\n # ------------------ Call Layers ------------------\n with tf.Session(config=config) as sess:\n ...\n\n2. The memory consuming operators like 3D cone-beam projection and back-projection have a so called hardware_interp flag. This means that the\ninterpolation for both operators are either done by the CUDA texture or based on software interpolation. To use the CUDA texture,\nand thus have a fast hardware_interpolation, the input data need to be copied into a new CUDA array, thus consuming the double amount of memory.\nIn the case of large data or deeper networks it could be favorable to switch to the software interpolation mode. In this case the actual Tensorflow pointer\ncan directly be used in the kernel without any duplication of the data. The downside is that the interpolation takes nearly 10 times longer.\n\nNote that the hardware interpolation is the default setup for all operators.\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/csyben/PYRO-NN", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "pyronn", "package_url": "https://pypi.org/project/pyronn/", "platform": "", "project_url": "https://pypi.org/project/pyronn/", "project_urls": { "Homepage": "https://github.com/csyben/PYRO-NN" }, "release_url": "https://pypi.org/project/pyronn/0.0.6/", "requires_dist": null, "requires_python": "", "summary": "PYRO-NN is the high level Python API to the PYRO-NN-Layers known operators.", "version": "0.0.6" }, "last_serial": 5203961, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "3d3624e981d2e170cc2fc1dd41d04cfa", "sha256": "0c3fcd4b83efd0527cb8ca6a2ec548b2d723846726383f643ce3725e5f10231a" }, "downloads": -1, "filename": "pyronn-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "3d3624e981d2e170cc2fc1dd41d04cfa", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 41649, "upload_time": "2019-03-15T16:30:55", "url": "https://files.pythonhosted.org/packages/d0/9e/f1ed9f8a36046c9270e5a7dd2812a2494a0f141b44057b436a1534d32388/pyronn-0.0.1-py3-none-any.whl" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "0ede9950bf09d837ca4801909108c737", "sha256": "814695bc0d31c73a9bf4c304cf298d195f9b9cfe4caf16116fdff72e4d154b5d" }, "downloads": -1, "filename": "pyronn-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "0ede9950bf09d837ca4801909108c737", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 41670, "upload_time": "2019-03-15T17:41:09", "url": "https://files.pythonhosted.org/packages/f4/d6/5cff2e1bef91cb0d030d7bc2491c5a5ed36d2baa4e79ba04c69ad11f38b8/pyronn-0.0.2-py3-none-any.whl" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "5dcf6fa4ed585d3e1132a24cecd6bbd3", "sha256": "0377118b7087bd368c03c735176df4122e8449610eb1d372d1f28bf4c9d02d38" }, "downloads": -1, "filename": "pyronn-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "5dcf6fa4ed585d3e1132a24cecd6bbd3", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 42719, "upload_time": "2019-04-05T13:07:05", "url": "https://files.pythonhosted.org/packages/6d/e2/2697c5e954fd22b86dc45e08d3b27ccd2e572925459213359be62b60ed9e/pyronn-0.0.3-py3-none-any.whl" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "45cf4b1a49cda50ed317f5869035cc6b", "sha256": "007e6a72d0253b1663ad6cdb5be9f005dcb843f003ec8d795d67cc1cfdba5092" }, "downloads": -1, "filename": "pyronn-0.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "45cf4b1a49cda50ed317f5869035cc6b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 42740, "upload_time": "2019-04-05T13:17:04", "url": "https://files.pythonhosted.org/packages/0a/7c/e32349e76030b5a4d09c1291307526f38cdb44441349a6cd79f827e5e89a/pyronn-0.0.4-py3-none-any.whl" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "d7859cf7c7bcccefee3135f31767c9e8", "sha256": "06b2caab4a1304498f6734078d132e22b675a1cdcecbed7c5c9187a9d9be4936" }, "downloads": -1, "filename": "pyronn-0.0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "d7859cf7c7bcccefee3135f31767c9e8", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 42736, "upload_time": "2019-04-08T13:40:48", "url": "https://files.pythonhosted.org/packages/e6/9e/9417f2bf71bd5d946f7a3941398142caa78b01a363bb9ebfa4d272cb6e09/pyronn-0.0.5-py3-none-any.whl" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "412d39e64c9e4ad5ec8b3d4b573d58fd", "sha256": "1e6efc959b8747d6c1a6ee57d1c0fe29cec54573631be5c9953f5d2267fde82f" }, "downloads": -1, "filename": "pyronn-0.0.6-py3-none-any.whl", "has_sig": false, "md5_digest": "412d39e64c9e4ad5ec8b3d4b573d58fd", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 33478, "upload_time": "2019-04-29T16:26:25", "url": "https://files.pythonhosted.org/packages/76/de/288245e4cc8ce616ed861c5ddfb658f9c6301182ca129b26bf3216ae44ca/pyronn-0.0.6-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "412d39e64c9e4ad5ec8b3d4b573d58fd", "sha256": "1e6efc959b8747d6c1a6ee57d1c0fe29cec54573631be5c9953f5d2267fde82f" }, "downloads": -1, "filename": "pyronn-0.0.6-py3-none-any.whl", "has_sig": false, "md5_digest": "412d39e64c9e4ad5ec8b3d4b573d58fd", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 33478, "upload_time": "2019-04-29T16:26:25", "url": "https://files.pythonhosted.org/packages/76/de/288245e4cc8ce616ed861c5ddfb658f9c6301182ca129b26bf3216ae44ca/pyronn-0.0.6-py3-none-any.whl" } ] }