From 6e40222adecd0e4b7ff4e9ac30af35cfc24e850c Mon Sep 17 00:00:00 2001 From: Michael-T-McCann Date: Tue, 1 Oct 2024 16:35:51 -0600 Subject: [PATCH] Fix projection dtype and docs --- scico/linop/xray/_xray.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/scico/linop/xray/_xray.py b/scico/linop/xray/_xray.py index 770bf627..863de412 100644 --- a/scico/linop/xray/_xray.py +++ b/scico/linop/xray/_xray.py @@ -42,6 +42,9 @@ class XRayTransform2D(LinearOperator): accumulation of pixel values into bins (equivalently, makes the linear operator sparse). + Warning: The default pixel spacing is :math:`\sqrt{2}/2` (rather + than 1) in order to satisfy the aforementioned spacing requirement. + `x0`, `dx`, and `y0` should be expressed in units such that the detector spacing `dy` is 1.0. """ @@ -64,9 +67,9 @@ def __init__( corresponds to summing columns, and an angle of pi/4 corresponds to summing along antidiagonals. x0: (x, y) position of the corner of the pixel `im[0,0]`. By - default, `(-input_shape / 2, -input_shape / 2)`. - dx: Image pixel side length in x- and y-direction. Should be - <= 1.0 in each dimension. By default, [1.0, 1.0]. + default, `(-input_shape * dx[0] / 2, -input_shape * dx[1] / 2)`. + dx: Image pixel side length in x- and y-direction. By + default, [:math:`\sqrt{2}/2`, :math:`\sqrt{2}/2`]. y0: Location of the edge of the first detector bin. By default, `-det_count / 2` det_count: Number of elements in detector. If ``None``, @@ -147,7 +150,7 @@ def _project( inds = jnp.where(inds >= 0, inds, ny) y = ( - jnp.zeros((len(angles), ny)) + jnp.zeros((len(angles), ny), dtype=im.dtype) .at[jnp.arange(len(angles)).reshape(-1, 1, 1), inds] .add(im * weights) )