Skip to content

Commit

Permalink
Shorten class name
Browse files Browse the repository at this point in the history
  • Loading branch information
bwohlberg committed Oct 3, 2023
1 parent 9ae8e7e commit c1d67ca
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions examples/scripts/ct_projector_comparison.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

"""
Expand All @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions examples/scripts/ct_tv_admm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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


Expand Down
4 changes: 2 additions & 2 deletions scico/linop/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -40,7 +40,7 @@
"Transpose",
"LinearOperator",
"XRayTransform",
"ParallelFixedAxis2dProjector",
"Parallel2dProjector",
"ComposedLinearOperator",
"linop_from_function",
"operator_norm",
Expand Down
4 changes: 2 additions & 2 deletions scico/linop/xray/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@

import sys

from ._xray import ParallelFixedAxis2dProjector, XRayTransform
from ._xray import Parallel2dProjector, XRayTransform

__all__ = [
"XRayTransform",
"ParallelFixedAxis2dProjector",
"Parallel2dProjector",
]
4 changes: 2 additions & 2 deletions scico/linop/xray/_xray.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -43,7 +43,7 @@ def __init__(self, projector):
)


class ParallelFixedAxis2dProjector:
class Parallel2dProjector:
"""Parallel ray, single axis, 2D X-ray projector."""

def __init__(
Expand Down
8 changes: 4 additions & 4 deletions scico/test/linop/xray/test_xray.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import jax.numpy as jnp

from scico.linop import ParallelFixedAxis2dProjector, XRayTransform
from scico.linop import Parallel2dProjector, XRayTransform


def test_apply():
Expand All @@ -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

0 comments on commit c1d67ca

Please sign in to comment.