From ed393efb29e31d6d4982600d5a67c50374bfb267 Mon Sep 17 00:00:00 2001 From: Brendt Wohlberg Date: Mon, 4 Nov 2024 10:08:18 -0700 Subject: [PATCH] Bug fix --- scico/linop/xray/astra.py | 2 +- scico/test/linop/xray/test_astra.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scico/linop/xray/astra.py b/scico/linop/xray/astra.py index b5cf542c..ab16dc7e 100644 --- a/scico/linop/xray/astra.py +++ b/scico/linop/xray/astra.py @@ -141,7 +141,7 @@ def volume_coords_to_world_coords(idx: np.ndarray, vol_geom: VolumeGeometry) -> def _volume_index_to_astra_world_2d(idx: np.ndarray, vol_geom: VolumeGeometry) -> np.ndarray: """Convert a 2D volume coordinate into a 2D world coordinate.""" - coord = idx[..., [2, 1]] # x:col, y:row, + coord = idx[..., [1, 0]] # x:col, y:row, nx = np.array( # (x, y) order ( vol_geom["GridColCount"], diff --git a/scico/test/linop/xray/test_astra.py b/scico/test/linop/xray/test_astra.py index e82dce5a..5f933a51 100644 --- a/scico/test/linop/xray/test_astra.py +++ b/scico/test/linop/xray/test_astra.py @@ -317,7 +317,7 @@ def test_convert_from_scico_geometry(test_geometry): def test_vol_coord_to_world_coord(): vol_geom = scico.linop.xray.astra.astra.create_vol_geom(16, 16) - vc = np.array([[0.0, 0.0, 0.0], [1.0, 1.0, 0.0]]) + vc = np.array([[0.0, 0.0], [1.0, 1.0]]) wc = scico.linop.xray.astra.volume_coords_to_world_coords(vc, vol_geom) assert wc.shape == (2, 2)