Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bwohlberg committed Nov 4, 2024
1 parent 7a75b58 commit ed393ef
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion scico/linop/xray/astra.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down
2 changes: 1 addition & 1 deletion scico/test/linop/xray/test_astra.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit ed393ef

Please sign in to comment.