From c1d67cab25bf737b4dca47715f476802dd6277fc Mon Sep 17 00:00:00 2001 From: Brendt Wohlberg Date: Mon, 2 Oct 2023 18:37:09 -0600 Subject: [PATCH] Shorten class name --- examples/scripts/ct_projector_comparison.py | 4 ++-- examples/scripts/ct_tv_admm.py | 4 ++-- scico/linop/__init__.py | 4 ++-- scico/linop/xray/__init__.py | 4 ++-- scico/linop/xray/_xray.py | 4 ++-- scico/test/linop/xray/test_xray.py | 8 ++++---- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/examples/scripts/ct_projector_comparison.py b/examples/scripts/ct_projector_comparison.py index d1222a121..1027e6c8a 100644 --- a/examples/scripts/ct_projector_comparison.py +++ b/examples/scripts/ct_projector_comparison.py @@ -22,7 +22,7 @@ import scico.linop.xray.astra as astra from scico import plot -from scico.linop import ParallelFixedAxis2dProjector, XRayTransform +from scico.linop import Parallel2dProjector, XRayTransform from scico.util import Timer """ @@ -49,7 +49,7 @@ projectors = {} timer.start("scico_init") -projectors["scico"] = XRayTransform(ParallelFixedAxis2dProjector((N, N), angles)) +projectors["scico"] = XRayTransform(Parallel2dProjector((N, N), angles)) timer.stop("scico_init") timer.start("astra_init") diff --git a/examples/scripts/ct_tv_admm.py b/examples/scripts/ct_tv_admm.py index 7c2cecd13..f032c0ed0 100644 --- a/examples/scripts/ct_tv_admm.py +++ b/examples/scripts/ct_tv_admm.py @@ -28,7 +28,7 @@ import scico.numpy as snp from scico import functional, linop, loss, metric, plot -from scico.linop.xray import ParallelFixedAxis2dProjector, XRayTransform +from scico.linop.xray import Parallel2dProjector, XRayTransform from scico.optimize.admm import ADMM, LinearSubproblemSolver from scico.util import device_info @@ -46,7 +46,7 @@ """ n_projection = 45 # number of projections angles = np.linspace(0, np.pi, n_projection) + np.pi / 2.0 # evenly spaced projection angles -A = XRayTransform(ParallelFixedAxis2dProjector((N, N), angles)) # CT projection operator +A = XRayTransform(Parallel2dProjector((N, N), angles)) # CT projection operator y = A @ x_gt # sinogram diff --git a/scico/linop/__init__.py b/scico/linop/__init__.py index 4a085d6b9..598a26aa2 100644 --- a/scico/linop/__init__.py +++ b/scico/linop/__init__.py @@ -19,7 +19,7 @@ from ._matrix import MatrixOperator from ._stack import DiagonalStack, VerticalStack from ._util import jacobian, operator_norm, power_iteration, valid_adjoint -from .xray import ParallelFixedAxis2dProjector, XRayTransform +from .xray import Parallel2dProjector, XRayTransform __all__ = [ "CircularConvolve", @@ -40,7 +40,7 @@ "Transpose", "LinearOperator", "XRayTransform", - "ParallelFixedAxis2dProjector", + "Parallel2dProjector", "ComposedLinearOperator", "linop_from_function", "operator_norm", diff --git a/scico/linop/xray/__init__.py b/scico/linop/xray/__init__.py index 2ea256fde..49d5752c5 100644 --- a/scico/linop/xray/__init__.py +++ b/scico/linop/xray/__init__.py @@ -18,9 +18,9 @@ import sys -from ._xray import ParallelFixedAxis2dProjector, XRayTransform +from ._xray import Parallel2dProjector, XRayTransform __all__ = [ "XRayTransform", - "ParallelFixedAxis2dProjector", + "Parallel2dProjector", ] diff --git a/scico/linop/xray/_xray.py b/scico/linop/xray/_xray.py index ba458ada1..b94eda8d0 100644 --- a/scico/linop/xray/_xray.py +++ b/scico/linop/xray/_xray.py @@ -33,7 +33,7 @@ def __init__(self, projector): Args: projector: instance of an X-ray projector object to wrap, currently the only option is - :class:`ParallelFixedAxis2dProjector` + :class:`Parallel2dProjector` """ self._eval = projector.project @@ -43,7 +43,7 @@ def __init__(self, projector): ) -class ParallelFixedAxis2dProjector: +class Parallel2dProjector: """Parallel ray, single axis, 2D X-ray projector.""" def __init__( diff --git a/scico/test/linop/xray/test_xray.py b/scico/test/linop/xray/test_xray.py index 4f2724012..7b1ee9e7c 100644 --- a/scico/test/linop/xray/test_xray.py +++ b/scico/test/linop/xray/test_xray.py @@ -1,6 +1,6 @@ import jax.numpy as jnp -from scico.linop import ParallelFixedAxis2dProjector, XRayTransform +from scico.linop import Parallel2dProjector, XRayTransform def test_apply(): @@ -11,16 +11,16 @@ def test_apply(): angles = jnp.linspace(0, jnp.pi, num=num_angles, endpoint=False) # general projection - H = XRayTransform(ParallelFixedAxis2dProjector(x.shape, angles)) + H = XRayTransform(Parallel2dProjector(x.shape, angles)) y = H @ x assert y.shape[0] == (num_angles) # fixed det_length det_length = 14 - H = XRayTransform(ParallelFixedAxis2dProjector(x.shape, angles, det_length=det_length)) + H = XRayTransform(Parallel2dProjector(x.shape, angles, det_length=det_length)) y = H @ x assert y.shape[1] == det_length # dither off - H = XRayTransform(ParallelFixedAxis2dProjector(x.shape, angles, dither=False)) + H = XRayTransform(Parallel2dProjector(x.shape, angles, dither=False)) y = H @ x