Skip to content

Commit

Permalink
Resolve #564 (#567)
Browse files Browse the repository at this point in the history
  • Loading branch information
bwohlberg authored Oct 31, 2024
1 parent 472b8b3 commit 52c8cb7
Showing 1 changed file with 10 additions and 3 deletions.
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

0 comments on commit 52c8cb7

Please sign in to comment.