{"id":37084778,"url":"https://github.com/kbredies/gratopy","last_synced_at":"2026-01-14T10:24:23.647Z","repository":{"id":57435933,"uuid":"385916802","full_name":"kbredies/gratopy","owner":"kbredies","description":"Gratopy - Graz accelerated tomographic projections for Python","archived":false,"fork":false,"pushed_at":"2025-08-19T10:28:50.000Z","size":11779,"stargazers_count":7,"open_issues_count":3,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-28T03:26:34.058Z","etag":null,"topics":["computed-tomography","fanbeam-transform","image-reconstruction","opencl","pixel-driven-projection-methods","python","radon-transform"],"latest_commit_sha":null,"homepage":"https://gratopy.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kbredies.png","metadata":{"files":{"readme":"README.md","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,"zenodo":null}},"created_at":"2021-07-14T11:31:46.000Z","updated_at":"2025-08-19T10:28:54.000Z","dependencies_parsed_at":"2025-06-13T15:24:23.804Z","dependency_job_id":"ec217850-be84-4402-8c01-69a4e61e4a01","html_url":"https://github.com/kbredies/gratopy","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/kbredies/gratopy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kbredies%2Fgratopy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kbredies%2Fgratopy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kbredies%2Fgratopy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kbredies%2Fgratopy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kbredies","download_url":"https://codeload.github.com/kbredies/gratopy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kbredies%2Fgratopy/sbom","scorecard":{"id":552663,"data":{"date":"2025-08-11","repo":{"name":"github.com/kbredies/gratopy","commit":"ee82b5d295f1b45dc905e73ee76f9b40ca9ede71"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.6,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":2,"reason":"Found 3/14 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":10,"reason":"17 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ghcr-publish.yml:1","Info: topLevel 'contents' permission set to 'read': .github/workflows/lint.yml:10","Info: topLevel 'contents' permission set to 'read': .github/workflows/tests.yml:13","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: GNU General Public License v3.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ghcr-publish.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/kbredies/gratopy/ghcr-publish.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ghcr-publish.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/kbredies/gratopy/ghcr-publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/lint.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/kbredies/gratopy/lint.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/lint.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/kbredies/gratopy/lint.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/lint.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/kbredies/gratopy/lint.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/kbredies/gratopy/tests.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/kbredies/gratopy/tests.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/tests.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/kbredies/gratopy/tests.yml/master?enable=pin","Warn: containerImage not pinned by hash: docker/Dockerfile:1: pin your Docker image by updating ubuntu:22.04 to ubuntu:22.04@sha256:1aa979d85661c488ce030ac292876cf6ed04535d3a237e49f61542d8e5de5ae0","Warn: downloadThenRun not pinned by hash: docker/Dockerfile:42","Info:   0 out of   5 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   3 third-party GitHubAction dependencies pinned","Info:   0 out of   1 containerImage dependencies pinned","Info:   0 out of   1 downloadThenRun dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 21 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-20T11:19:50.625Z","repository_id":57435933,"created_at":"2025-08-20T11:19:50.625Z","updated_at":"2025-08-20T11:19:50.625Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28417038,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:18:03.274Z","status":"ssl_error","status_checked_at":"2026-01-14T10:16:11.865Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["computed-tomography","fanbeam-transform","image-reconstruction","opencl","pixel-driven-projection-methods","python","radon-transform"],"created_at":"2026-01-14T10:24:23.008Z","updated_at":"2026-01-14T10:24:23.639Z","avatar_url":"https://github.com/kbredies.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gratopy\n[![DOI](https://zenodo.org/badge/doi/10.5281/zenodo.5221442.svg)](https://doi.org/10.5281/zenodo.5221442)\n[![Documentation Status](https://readthedocs.org/projects/gratopy/badge/?version=latest)](https://gratopy.readthedocs.io/?badge=latest)\n[![Gratopy test suite](https://github.com/kbredies/gratopy/actions/workflows/tests.yml/badge.svg)](https://github.com/kbredies/gratopy/actions/workflows/tests.yml)\n\nThe gratopy (**Gr**az **a**ccelerated **to**mographic projections for **Py**thon) toolbox is a Python3 software package for the efficient and high-quality computation of Radon transforms, fanbeam transforms as well as the associated backprojections. The included operators are based on pixel-driven projection methods which were shown to possess [favorable approximation properties](https://epubs.siam.org/doi/abs/10.1137/20M1326635). The toolbox offers a powerful parallel OpenCL/GPU implementation which admits high execution speed and allows for seamless integration into [PyOpenCL](https://documen.tician.de/pyopencl/). Gratopy can efficiently be combined with other PyOpenCL code and is well-suited for the development of iterative tomographic reconstruction approaches, in particular, for those involving optimization algorithms.\n\n## Highlights\n* Easy-to-use tomographic projection toolbox.\n* High-quality 2D projection operators.\n* Fast projection due to custom OpenCL/GPU implementation.\n* Seamless integration into PyOpenCL.\n* Basic iterative reconstruction schemes included (Landweber, CG, total variation).\n* Comprehensive documentation, tests and example code.\n\n*The fanbeam projection of a walnut and gratopy’s Landweber and total variation reconstructions (from left to right).*\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003cimg src=\"doc/source/graphics/walnut_sinogram.png\" width=91 height=250\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003cimg src=\"doc/source/graphics/conjugate_gradients.png\" width=250 height=250\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003cimg src=\"doc/source/graphics/total_variation.png\" width=250 height=250\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n \u003c/table\u003e\n\n## Installation\n\nThe toolbox can easily be installed using pip:\n\n```bash\npip install gratopy\n```\n\nAlternatively, a release or snapshot archive file can directly be downloaded and unpacked.\nCalling \n\n```bash\npip install .\n```\n\ninside the main folder then installs the toolbox.\nGratopy uses [`uv`](https://docs.astral.sh/uv/) as its project and dependency\nmanagement tool, which allows setting up a dedicated development environment\nby running\n\n```bash\nuv sync\n```\n\nFor more details we refer to the [documentation](https://gratopy.readthedocs.io/).\n\n## Requirements\nMost notably, `gratopy` is built using [PyOpenCL](https://pypi.org/project/pyopencl/), which\nmight require additional care in order to correctly install and configure it: depending on the\nused platform and GPU, suitable drivers must be installed. We refer to\n[PyOpenCL's documentation](https://documen.tician.de/pyopencl/) for detailed instructions.\n\nThe full list of requirements can be found in [`pyproject.toml`](/pyproject.toml).\n\n## Getting started\nWe refer to the extensive [documentation](https://gratopy.readthedocs.io/), in particular to the [getting started](https://gratopy.readthedocs.io/en/latest/getting_started.html) guide, as well as to the test files for the [Radon transform](https://gratopy.readthedocs.io/en/latest/_modules/test_radon.html) and [fanbeam transform](https://gratopy.readthedocs.io/en/latest/_modules/test_fanbeam.html). The following [rudimentary example](https://gratopy.readthedocs.io/en/latest/getting_started.html#first-example-radon-transform) is also included in the documentation.\n\n```python\n\n# initial import\nimport numpy as np\nimport pyopencl as cl\nimport matplotlib.pyplot as plt\n\nimport gratopy\n\n# discretization parameters\nnumber_angles = 60\nnumber_detectors = 300\nNx = 300\n# Alternatively to number_angles one could give as angle input\n# angles = np.linspace(0, np.pi, number_angles+1)[:-1]\n\n# create pyopencl context\nctx = cl.create_some_context()\nqueue = cl.CommandQueue(ctx)\n\n# create phantom as test image (a pyopencl.array.Array of dimensions (Nx, Nx))\nphantom = gratopy.phantom(queue,Nx)\n\n# create suitable projectionsettings\nPS = gratopy.ProjectionSettings(queue, gratopy.RADON, phantom.shape,\n                                number_angles, number_detectors)\n\n# compute forward projection and backprojection of created sinogram\n# results are pyopencl arrays\nsino = gratopy.forwardprojection(phantom, PS)\nbackproj = gratopy.backprojection(sino, PS)\n\n# plot results\nplt.figure()\nplt.title(\"Generated Phantom\")\nplt.imshow(phantom.get(), cmap=\"gray\")\n\nplt.figure()\nplt.title(\"Sinogram\")\nplt.imshow(sino.get(), cmap=\"gray\")\n\nplt.figure()\nplt.title(\"Backprojection\")\nplt.imshow(backproj.get(), cmap=\"gray\")\nplt.show()\n```\n\n## Authors\n\n* **Kristian Bredies**, University of Graz, kristian.bredies@uni-graz.at\n* **Richard Huber**, University of Graz, richard.huber@uni-graz.at\n\nAll authors are affiliated with the [Institute of Mathematics and Scientific Computing](https://mathematik.uni-graz.at/en) at the [University of Graz](https://www.uni-graz.at/en).\n\n## Publications\nIf you find this tool useful, please cite the following associated publication.\n\n* Kristian Bredies and Richard Huber. (2021). *Convergence analysis of pixel-driven Radon and fanbeam transforms.* SIAM Journal on Numerical Analysis 59(3), 1399–1432. https://doi.org/10.1137/20M1326635.\n* Kristian Bredies and Richard Huber. (2021). *Gratopy 0.1* [Software]. Zenodo. https://doi.org/10.5281/zenodo.5221442\n\n## Acknowledgements\n\nThe development of this software was supported by the following projects:\n\n* *Regularization Graphs for Variational Imaging*, funded by the Austrian Science Fund (FWF), grant P-29192,\n\n* *International Research Training Group IGDK 1754 Optimization and Numerical Analysis for Partial Differential Equations with Nonsmooth\nStructures*, funded by the German Research Council (DFG) and the Austrian Science Fund (FWF), grant W-1244.\n\nThe walnut data set included in this toolbox is licensed under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) and available on [Zenodo](https://doi.org/10.5281/zenodo.1254206):\n\n* Keijo Hämäläinen, Lauri Harhanen, Aki Kallonen, Antti Kujanpää, Esa Niemi and Samuli Siltanen. (2015). *Tomographic X-ray data of a walnut* (Version 1.0.0) [Data set]. Zenodo. https://doi.org/10.5281/zenodo.1254206\n\nThe phantom creation code is based on [Phantominator](https://github.com/mckib2/phantominator), copyright by its contributors and licensed under [GPLv3](https://github.com/mckib2/phantominator/blob/master/LICENSE). See https://github.com/mckib2/phantominator.\n\n## License\n\nThis project is licensed under the GPLv3 license - see [LICENSE](LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkbredies%2Fgratopy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkbredies%2Fgratopy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkbredies%2Fgratopy/lists"}