Skip to content

Commit

Permalink
Rename XRayProject to XRayTransform
Browse files Browse the repository at this point in the history
  • Loading branch information
bwohlberg committed Sep 1, 2023
1 parent 1708d09 commit a9c5c8e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions examples/scripts/ct_projector_comparison.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from xdesign import Foam, discrete_phantom

from scico import plot
from scico.linop import ParallelFixedAxis2dProjector, XRayProject
from scico.linop import ParallelFixedAxis2dProjector, XRayTransform
from scico.linop.radon_astra import TomographicProjector
from scico.util import Timer

Expand Down Expand Up @@ -49,7 +49,7 @@

projectors = {}
timer.start("scico_init")
projectors["scico"] = XRayProject(ParallelFixedAxis2dProjector((N, N), angles))
projectors["scico"] = XRayTransform(ParallelFixedAxis2dProjector((N, N), angles))
timer.stop("scico_init")

timer.start("astra_init")
Expand Down Expand Up @@ -93,7 +93,7 @@
10% slower when both are run the CPU.
On our server, using the GPU:
```
```
Label Accum. Current
-------------------------------------------
astra_avg_proj 4.62e-02 s Stopped
Expand Down
6 changes: 3 additions & 3 deletions scico/linop/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2021-2022 by SCICO Developers
# Copyright (C) 2021-2023 by SCICO Developers
# All rights reserved. BSD 3-clause License.
# This file is part of the SCICO package. Details of the copyright and
# user license can be found in the 'LICENSE' file distributed with the
Expand All @@ -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, XRayProject
from ._xray import ParallelFixedAxis2dProjector, XRayTransform

__all__ = [
"CircularConvolve",
Expand All @@ -39,7 +39,7 @@
"Sum",
"Transpose",
"LinearOperator",
"XRayProject",
"XRayTransform",
"ParallelFixedAxis2dProjector",
"ComposedLinearOperator",
"linop_from_function",
Expand Down
2 changes: 1 addition & 1 deletion scico/linop/_xray.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from ._linop import LinearOperator


class XRayProject(LinearOperator):
class XRayTransform(LinearOperator):
"""X-ray projection operator.
Wraps an X-ray projector object in a SCICO
Expand Down
8 changes: 4 additions & 4 deletions scico/test/linop/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, XRayProject
from scico.linop import ParallelFixedAxis2dProjector, 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 = XRayProject(ParallelFixedAxis2dProjector(x.shape, angles))
H = XRayTransform(ParallelFixedAxis2dProjector(x.shape, angles))
y = H @ x
assert y.shape[0] == (num_angles)

# fixed det_length
det_length = 14
H = XRayProject(ParallelFixedAxis2dProjector(x.shape, angles, det_length=det_length))
H = XRayTransform(ParallelFixedAxis2dProjector(x.shape, angles, det_length=det_length))
y = H @ x
assert y.shape[1] == det_length

# dither off
H = XRayProject(ParallelFixedAxis2dProjector(x.shape, angles, do_dithering=False))
H = XRayTransform(ParallelFixedAxis2dProjector(x.shape, angles, do_dithering=False))
y = H @ x

0 comments on commit a9c5c8e

Please sign in to comment.