Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apparent regression in linop.Parallel2dProjector #534

Closed
bwohlberg opened this issue Jun 13, 2024 · 1 comment · Fixed by #537
Closed

Apparent regression in linop.Parallel2dProjector #534

bwohlberg opened this issue Jun 13, 2024 · 1 comment · Fixed by #537
Assignees
Labels
bug Something isn't working

Comments

@bwohlberg
Copy link
Collaborator

The projection accuracy of linop.Parallel2dProjector seems to have significantly degraded since the notebook ct_multi_cs_tv_admm.ipynb currently in scico-data was built. Compare the performance of the scico projector reported in that notebook with a recent build, noting the roughly 0.75 dB SNR reduction in reconstruction quality.

@bwohlberg bwohlberg added the bug Something isn't working label Jun 13, 2024
@bwohlberg
Copy link
Collaborator Author

For the most part the output of the scico projector matches those of the other two projectors very closely, but there seems to be a significant difference at a boundary, as illustrated by this script:

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

N = 512
np.random.seed(1234)
x_gt = snp.array(discrete_phantom(Foam(size_range=[0.075, 0.0025], gap=1e-3, porosity=1), size=N))

n_projection = 45
angles = np.linspace(0, np.pi, n_projection)
projectors = {
    "astra": astra.XRayTransform(x_gt.shape, 1, N, angles - np.pi / 2.0),  # astra
    "svmbir": svmbir.XRayTransform(x_gt.shape, 2 * np.pi - angles, N),  # svmbir
    "scico": XRayTransform(Parallel2dProjector((N, N), angles, det_count=N)),  # scico
}

y = {}
algs = ("astra", "svmbir", "scico")
for p in algs:
    A = projectors[p]
    y[p] = A @ x_gt

y_gt = x_gt.sum(axis=1)
fig, ax = plot.plot(np.vstack([y_gt] + [y[p][0] for p in algs]).T,
                    lgnd=("row sum",) + algs)
ax.set_xlim((-0.5, 2))
ax.set_ylim((-5, 60))

input()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants