Skip to content

Commit

Permalink
Work on comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael-T-McCann committed Aug 26, 2024
1 parent 4add502 commit 54084d1
Show file tree
Hide file tree
Showing 12 changed files with 280 additions and 177 deletions.
2 changes: 1 addition & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Version 0.0.5 (2023-12-18)
• New operators ``operator.DiagonalStack`` and ``operator.VerticalStack``.
• Rename modules ``radon_astra`` and ``radon_svmbir`` to ``xray.astra`` and
``xray.svmbir`` respectively, and rename ``TomographicProjector`` classes
to ``XRayTransform``.
to ``sform``.
• Rename ``AbelProjector`` to ``AbelTransform``.
• Rename ``solver.ATADSolver`` to ``solver.MatrixATADSolver``.
• Rename some ``__init__`` parameters of ``linop.DiagonalStack`` and
Expand Down
4 changes: 2 additions & 2 deletions examples/scripts/ct_large_projection.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import jax

from scico.examples import create_block_phantom
from scico.linop import Parallel3dProjector, XRayTransform
from scico.linop import Parallel3dProjector

N = 1000
num_views = 10
Expand All @@ -36,7 +36,7 @@
)


H = XRayTransform(Parallel3dProjector(in_shape, matrices, det_shape))
H = Parallel3dProjector(in_shape, matrices, det_shape)

proj = H @ x
jax.block_until_ready(proj)
6 changes: 2 additions & 4 deletions examples/scripts/ct_multi_tv_admm.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

import scico.numpy as snp
from scico import functional, linop, loss, metric, plot
from scico.linop.xray import Parallel2dProjector, XRayTransform, astra, svmbir
from scico.linop.xray import Parallel2dProjector, astra, svmbir
from scico.optimize.admm import ADMM, LinearSubproblemSolver
from scico.util import device_info

Expand All @@ -54,9 +54,7 @@
"svmbir": svmbir.XRayTransform(
x_gt.shape, 2 * np.pi - angles, det_count, delta_pixel=1.0, delta_channel=det_spacing
), # svmbir
"scico": XRayTransform(
Parallel2dProjector((N, N), angles, det_count=det_count, dx=1 / det_spacing)
), # scico
"scico": Parallel2dProjector((N, N), angles, det_count=det_count, dx=1 / det_spacing), # scico
}


Expand Down
4 changes: 2 additions & 2 deletions examples/scripts/ct_projector_comparison_2d.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 Parallel2dProjector, XRayTransform
from scico.linop import Parallel2dProjector
from scico.util import Timer

"""
Expand All @@ -46,7 +46,7 @@

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

timer.start("astra_init")
Expand Down
8 changes: 1 addition & 7 deletions examples/scripts/ct_projector_comparison_3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,6 @@
y_scico = H_scico @ x
jax.block_until_ready(y_scico)

with ContextTimer(timer_scico, "first_fwd"):
y_scico = H_scico @ x

with ContextTimer(timer_scico, "avg_fwd"):
for _ in range(num_repeats):
y_scico = H_scico @ x
Expand Down Expand Up @@ -99,10 +96,7 @@

with ContextTimer(timer_astra, "first_fwd"):
y_astra_from_scico = H_astra_from_scico @ x
jax.block_until_ready(y_scico)

with ContextTimer(timer_astra, "first_fwd"):
y_astra_from_scico = H_astra_from_scico @ x
jax.block_until_ready(y_astra_from_scico)

with ContextTimer(timer_astra, "avg_fwd"):
for _ in range(num_repeats):
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 @@ -29,7 +29,7 @@

import scico.numpy as snp
from scico import functional, linop, loss, metric, plot
from scico.linop.xray import Parallel2dProjector, XRayTransform
from scico.linop.xray import Parallel2dProjector
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(Parallel2dProjector((N, N), angles)) # CT projection operator
A = Parallel2dProjector((N, N), angles) # CT projection operator
y = A @ x_gt # sinogram


Expand Down
3 changes: 1 addition & 2 deletions scico/linop/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from ._matrix import MatrixOperator
from ._stack import DiagonalReplicated, DiagonalStack, VerticalStack, linop_over_axes
from ._util import jacobian, operator_norm, power_iteration, valid_adjoint
from .xray import Parallel2dProjector, Parallel3dProjector, XRayTransform
from .xray import Parallel2dProjector, Parallel3dProjector

__all__ = [
"CircularConvolve",
Expand All @@ -51,7 +51,6 @@
"Sum",
"Transpose",
"LinearOperator",
"XRayTransform",
"Parallel2dProjector",
"Parallel3dProjector",
"ComposedLinearOperator",
Expand Down
4 changes: 1 addition & 3 deletions scico/linop/xray/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,10 @@
"""

import sys

from ._xray import Parallel2dProjector, Parallel3dProjector, XRayTransform
from ._xray import Parallel2dProjector, Parallel3dProjector

__all__ = [
"Parallel2dProjector",
"Parallel3dProjector",
"XRayTransform",
]
Loading

0 comments on commit 54084d1

Please sign in to comment.