{ "info": { "author": "Sebastian Achim Mueller", "author_email": "sebastian-achim.mueller@mpi-hd.mpg.de", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: C", "Programming Language :: Python :: 3", "Topic :: Scientific/Engineering :: Astronomy", "Topic :: Scientific/Engineering :: Image Recognition", "Topic :: Scientific/Engineering :: Medical Science Apps.", "Topic :: Scientific/Engineering :: Physics" ], "description": "# Overlap of a ray and a volume cell (voxel) [![Build Status](https://travis-ci.org/cherenkov-plenoscope/ray_voxel_overlap.svg?branch=master)](https://travis-ci.org/cherenkov-plenoscope/ray_voxel_overlap)\n\nEstimate the euclidean overlap passed by a ray within a rectangular volume cell (voxel).\n\n![img](readme/ray_and_voxel.svg)\n\nFor a given, rectangular space partitioning in 3D, and a given ray the overlap of all voxels with the ray is estimated.\nThe figure shows a ray and its overlap with voxels.\nA brown overlap with voxel ```3```, a red overlap with voxel ```0```, a purple overlap with voxel ```4```, and a green overlap with voxel ```5```. The ray is defined by its support and direction vectors. The space-partitioning is defined by its bin-edges.\n# Interface\nThere is one core function:\n\n```python\nimport ray_voxel_overlap\nray_voxel_overlap.estimate_overlap_of_ray_with_voxels?\n\"\"\"\nReturns the voxel indices and overlap distances for one single ray\n(defined by support and direction) with voxels defined by the bin_edges\nin x,y and z.\n\nsupport 3D support vector of ray.\n\ndirection 3D direction vector of ray.\n\nx_bin_edges voxel bin edge positions in x.\n\ny_bin_edges voxel bin edge positions in y.\n\nz_bin_edges voxel bin edge positions in z.\n\"\"\"\n```\n\nThere are two more functions:\n\n- 2nd ```ray_voxel_overlap.estimate_system_matrix()```\n\nCreate a system-matrix using scipy.sparse matrix which can be used for iterative tomographic reconstructions.\n\n- 3rd ```ray_voxel_overlap.estimate_overlap_of_ray_bundle_with_voxels()```\n\nAverage the overlap of multiple rays representing a single read-out-channel. This is useful when a single ray is not representative enough for the geometry sensed by a read-out-channel in your tomographic setup, e.g. when there is a narrow depth-of-field.\n\n## Tomographic system-matrix\n\n```python\nimport numpy as np\nimport ray_voxel_overlap as rvo\n\nnp.random.seed(0)\n\nN_RAYS = 100\nsupports = np.array([\n np.random.uniform(-2.5, 2.5, N_RAYS),\n np.random.uniform(-2.5, 2.5, N_RAYS),\n np.zeros(N_RAYS)\n]).T\n\ndirections = np.array([\n np.random.uniform(-0.3, 0.3, N_RAYS),\n np.random.uniform(-0.3, 0.3, N_RAYS),\n np.ones(N_RAYS)\n]).T\n\nnorm_directions = np.linalg.norm(directions, axis=1)\ndirections[:, 0] /= norm_directions\ndirections[:, 1] /= norm_directions\ndirections[:, 2] /= norm_directions\n\nN_X_BINS = 8\nN_Y_BINS = 13\nN_Z_BINS = 7\nsystem_matrix = rvo.estimate_system_matrix(\n supports=supports,\n directions=directions,\n x_bin_edges=np.linspace(-100., 100., N_X_BINS+1),\n y_bin_edges=np.linspace(-100., 100., N_Y_BINS+1),\n z_bin_edges=np.linspace(0., 200., N_Z_BINS+1),\n)\n```\n## How it is done\nTo be fast, the production-code is written in ```C``` and wrapped in ```cython```. But for development, there is a ```python``` implementation.\n\n## Authors\nSebastian A. Mueller,\n\nETH-Zurich, Switzerland (2014-2019),\n\nMPI-Heidelberg, Germany (2019-)", "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/cherenkov-plenoscope/ray_voxel_overlap", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "ray-voxel-overlap", "package_url": "https://pypi.org/project/ray-voxel-overlap/", "platform": "", "project_url": "https://pypi.org/project/ray-voxel-overlap/", "project_urls": { "Homepage": "https://github.com/cherenkov-plenoscope/ray_voxel_overlap" }, "release_url": "https://pypi.org/project/ray-voxel-overlap/0.0.4/", "requires_dist": null, "requires_python": ">=3", "summary": "Estimate the tomographic system-matrix for rays in voxels.", "version": "0.0.4" }, "last_serial": 5949099, "releases": { "0.0.2": [ { "comment_text": "", "digests": { "md5": "272565667edc067b5ab82d0a1160eb1b", "sha256": "a1da736a4770754ee86cade96ef0fdcb07fbcc32bf9125b7eece2f347e15d583" }, "downloads": -1, "filename": "ray_voxel_overlap-0.0.2.tar.gz", "has_sig": false, "md5_digest": "272565667edc067b5ab82d0a1160eb1b", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 8644, "upload_time": "2019-10-08T10:54:58", "url": "https://files.pythonhosted.org/packages/2d/4f/c4bf5ea6d8b87fcd1187e276379f68eb346c8369003d86af2d1e6623dc99/ray_voxel_overlap-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "b0c117351615564451abace2fe834d0a", "sha256": "54853ecf6d8c8f0ccdb2acceedb2ad5b088fff6ad57587dacad5ac8d76c6b356" }, "downloads": -1, "filename": "ray_voxel_overlap-0.0.3.tar.gz", "has_sig": false, "md5_digest": "b0c117351615564451abace2fe834d0a", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 8505, "upload_time": "2019-10-09T10:23:33", "url": "https://files.pythonhosted.org/packages/ff/97/037a1f02ab1b0c5e184bd15bf16a63c1a5b2dedd00e04ec0f56144c8b25d/ray_voxel_overlap-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "b05c04de0c456153c358f17856070d0c", "sha256": "eafffa8be432b988b3131b3a3f7260ed4e35e9eee4de9476c311ece732589534" }, "downloads": -1, "filename": "ray_voxel_overlap-0.0.4.tar.gz", "has_sig": false, "md5_digest": "b05c04de0c456153c358f17856070d0c", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 8509, "upload_time": "2019-10-09T10:51:57", "url": "https://files.pythonhosted.org/packages/2b/ec/b444f66c7b52fb041f0b1b4210483ec3c08c3be8195398aca77723749618/ray_voxel_overlap-0.0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b05c04de0c456153c358f17856070d0c", "sha256": "eafffa8be432b988b3131b3a3f7260ed4e35e9eee4de9476c311ece732589534" }, "downloads": -1, "filename": "ray_voxel_overlap-0.0.4.tar.gz", "has_sig": false, "md5_digest": "b05c04de0c456153c358f17856070d0c", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 8509, "upload_time": "2019-10-09T10:51:57", "url": "https://files.pythonhosted.org/packages/2b/ec/b444f66c7b52fb041f0b1b4210483ec3c08c3be8195398aca77723749618/ray_voxel_overlap-0.0.4.tar.gz" } ] }