{"id":15284521,"url":"https://github.com/innolitics/natural-neighbor-interpolation","last_synced_at":"2025-08-20T08:32:55.745Z","repository":{"id":46815426,"uuid":"99719137","full_name":"innolitics/natural-neighbor-interpolation","owner":"innolitics","description":"Fast, discrete natural neighbor interpolation in 3D on the CPU.","archived":false,"fork":false,"pushed_at":"2023-11-02T18:37:10.000Z","size":401,"stargazers_count":89,"open_issues_count":6,"forks_count":20,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-07-06T08:16:52.775Z","etag":null,"topics":["image-processing","interpolation","numpy","python3"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/innolitics.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-08-08T17:30:12.000Z","updated_at":"2025-07-02T01:41:31.000Z","dependencies_parsed_at":"2022-08-27T19:10:31.713Z","dependency_job_id":"350dc203-1d28-431b-bb73-3fc8a938e0b0","html_url":"https://github.com/innolitics/natural-neighbor-interpolation","commit_stats":{"total_commits":153,"total_committers":6,"mean_commits":25.5,"dds":"0.20261437908496727","last_synced_commit":"f4da60087ba09e02e30731e3af3e0e6f65856fb5"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/innolitics/natural-neighbor-interpolation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/innolitics%2Fnatural-neighbor-interpolation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/innolitics%2Fnatural-neighbor-interpolation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/innolitics%2Fnatural-neighbor-interpolation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/innolitics%2Fnatural-neighbor-interpolation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/innolitics","download_url":"https://codeload.github.com/innolitics/natural-neighbor-interpolation/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/innolitics%2Fnatural-neighbor-interpolation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271287859,"owners_count":24733482,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-20T02:00:09.606Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["image-processing","interpolation","numpy","python3"],"created_at":"2024-09-30T14:58:02.711Z","updated_at":"2025-08-20T08:32:55.437Z","avatar_url":"https://github.com/innolitics.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":".. image:: https://github.com/innolitics/natural-neighbor-interpolation/actions/workflows/test.yml/badge.svg\n   :target: https://github.com/innolitics/natural-neighbor-interpolation/actions/workflows/test.yml\n\nDiscrete Sibson (Natural Neighbor) Interpolation\n================================================\n\nNatural neighbor interpolation is a method for interpolating scattered data\n(i.e. you know the values of a function at scattered locations).  It is often superior to linear barycentric interpolation, which is a commonly used method of interpolation provided by Scipy's `griddata` function.\n\nThere are several implementations of 2D natural neighbor interpolation in Python.  We needed a fast 3D implementation that could run without a GPU, so we wrote an implementation of Discrete Sibson Interpolation (a version of natural neighbor interpolation that is fast but introduces slight errors as compared to \"geometric\" natural neighbor interpolation).\n\nSee https://doi.org/10.1109/TVCG.2006.27 for details.\n\nInstallation\n------------\n\n.. code-block:: bash\n\n    pip install naturalneighbor\n\nDependencies\n------------\n\n- Python 3.5+\n- Numpy (has been tested with 1.13+)\n\nDemonstration\n-------------\n\nNatural neighbor interpolation can be more accurate than linear barycentric interpolation (Scipy's default) for smoothly varying functions.\n\nAlso, the final result looks better.\n\n.. image:: https://raw.githubusercontent.com/innolitics/natural-neighbor-interpolation/master/demo/linear_comparison.png\n   :target: https://raw.githubusercontent.com/innolitics/natural-neighbor-interpolation/master/demo/linear_comparison.png\n\n\n.. image:: https://raw.githubusercontent.com/innolitics/natural-neighbor-interpolation/master/demo/sin_sin_comparison.png\n   :target: https://raw.githubusercontent.com/innolitics/natural-neighbor-interpolation/master/demo/sin_sin_comparison.png\n\nNote that the natural neighbor values usually are extrapolated; they were cut off in the demo to fairly compare with Scipy's linear barycentric method, which does not extrapolate.\n\nUsage\n-----\n\nThis module exposes a single function, :code:`griddata`.\n\nThe API for :code:`naturalneighbor.griddata` is similar to\n:code:`scipy.interpolate.griddata`.  Unlike Scipy, the third argument is not a\ndense mgrid, but instead is just the ranges that would have been passed to :code:`mgrid`.  This is because the discrete Sibson approach requires the interpolated points to lie on an evenly spaced grid.\n\n.. code-block:: python\n\n    import scipy.interpolate\n    import numpy as np\n\n    import naturalneighbor\n\n    num_points = 10\n    num_dimensions = 3\n    points = np.random.rand(num_points, num_dimensions)\n    values = np.random.rand(num_points)\n\n    grids = tuple(np.mgrid[0:100:1, 0:50:100j, 0:100:2])\n    scipy_interpolated_values = scipy.interpolate.griddata(points, values, grids)\n\n    grid_ranges = [[0, 100, 1], [0, 50, 100j], [0, 100, 2]]\n    nn_interpolated_values = naturalneighbor.griddata(points, values, grid_ranges)\n\nFuture Work\n-----------\n\n- Provide options for extrapolation handling\n- Support floats and complex numbers (only support doubles at the moment)\n- Support 2D (only support 3D)\n- Add documentation with discussion on limitations of discrete sibson's method\n- Uncomment cpplint from tox.ini and cleanup C++ code\n- Generalize the threading model (currently it uses 8 threads---one for each quadrant)\n\nOther Resources\n---------------\n\n- `Fast Discrete Approximation of Natural Neighbor Interpolation in 3D \u003chttps://adared.ch/fast-discrete-approximation-of-natural-neighbor-interpolation-in-3d/\u003e`_\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finnolitics%2Fnatural-neighbor-interpolation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finnolitics%2Fnatural-neighbor-interpolation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finnolitics%2Fnatural-neighbor-interpolation/lists"}