Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve #564 #567

Merged
merged 1 commit into from
Oct 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions scico/linop/xray/astra.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,9 +462,9 @@ class XRayTransform3D(LinearOperator): # pragma: no cover
`ASTRA toolbox <https://github.com/astra-toolbox/astra-toolbox>`_.
The `3D geometries <https://astra-toolbox.com/docs/geom3d.html#projection-geometries>`__
"parallel3d" and "parallel3d_vec" are supported by this interface.
**NB:** A GPU is required for the primary functionality of this
class; if no GPU is available, projections and back projections will
fail with an "Unknown algorithm type" error.
Note that a CUDA GPU is required for the primary functionality of
this class; if no GPU is available, initialization will fail with a
:exc:`RuntimeError`.

The volume is fixed with respect to the coordinate system, centered
at the origin, as illustrated below:
Expand Down Expand Up @@ -570,7 +570,14 @@ def __init__(
for more information.
angles: Array of projection angles in radians.
vectors: Array of geometry specification vectors.

Raises:
RuntimeError: If a CUDA GPU is not available to the ASTRA
toolbox.
"""
if not astra.use_cuda():
raise RuntimeError("CUDA GPU required but not available or not enabled.")

if not (
(det_spacing is not None and angles is not None and vectors is None)
or (vectors is not None and det_spacing is None and angles is None)
Expand Down
Loading