diff --git a/data b/data index 23b76fd4f..f99c8b524 160000 --- a/data +++ b/data @@ -1 +1 @@ -Subproject commit 23b76fd4fa092c186689af1dba9d058d6dc433bc +Subproject commit f99c8b524230289334d20fdc33fde07aa666b2e0 diff --git a/docs/source/examples.rst b/docs/source/examples.rst index 291eeb5a6..87bb48263 100644 --- a/docs/source/examples.rst +++ b/docs/source/examples.rst @@ -27,6 +27,7 @@ Computed Tomography examples/ct_astra_noreg_pcg examples/ct_astra_3d_tv_admm examples/ct_astra_tv_admm + examples/ct_tv_admm examples/ct_astra_weighted_tv_admm examples/ct_svmbir_tv_multi examples/ct_svmbir_ppp_bm3d_admm_cg @@ -129,6 +130,7 @@ Total Variation examples/ct_abel_tv_admm examples/ct_abel_tv_admm_tune examples/ct_astra_tv_admm + examples/ct_tv_admm examples/ct_astra_3d_tv_admm examples/ct_astra_weighted_tv_admm examples/ct_svmbir_tv_multi @@ -197,6 +199,7 @@ ADMM examples/ct_abel_tv_admm examples/ct_abel_tv_admm_tune examples/ct_astra_tv_admm + examples/ct_tv_admm examples/ct_astra_3d_tv_admm examples/ct_astra_weighted_tv_admm examples/ct_svmbir_tv_multi diff --git a/examples/scripts/README.rst b/examples/scripts/README.rst index 1cdb0e8e1..50775448d 100644 --- a/examples/scripts/README.rst +++ b/examples/scripts/README.rst @@ -18,7 +18,9 @@ Computed Tomography `ct_astra_3d_tv_admm.py `_ 3D TV-Regularized Sparse-View CT Reconstruction `ct_astra_tv_admm.py `_ - TV-Regularized Sparse-View CT Reconstruction + TV-Regularized Sparse-View CT Reconstruction (ASTRA Projector) + `ct_tv_admm.py `_ + TV-Regularized Sparse-View CT Reconstruction (Integrated Projector) `ct_astra_weighted_tv_admm.py `_ TV-Regularized Low-Dose CT Reconstruction `ct_svmbir_tv_multi.py `_ @@ -159,7 +161,9 @@ Total Variation `ct_abel_tv_admm_tune.py `_ Parameter Tuning for TV-Regularized Abel Inversion `ct_astra_tv_admm.py `_ - TV-Regularized Sparse-View CT Reconstruction + TV-Regularized Sparse-View CT Reconstruction (ASTRA Projector) + `ct_tv_admm.py `_ + TV-Regularized Sparse-View CT Reconstruction (Integrated Projector) `ct_astra_3d_tv_admm.py `_ 3D TV-Regularized Sparse-View CT Reconstruction `ct_astra_weighted_tv_admm.py `_ @@ -252,7 +256,9 @@ ADMM `ct_abel_tv_admm_tune.py `_ Parameter Tuning for TV-Regularized Abel Inversion `ct_astra_tv_admm.py `_ - TV-Regularized Sparse-View CT Reconstruction + TV-Regularized Sparse-View CT Reconstruction (ASTRA Projector) + `ct_tv_admm.py `_ + TV-Regularized Sparse-View CT Reconstruction (Integrated Projector) `ct_astra_3d_tv_admm.py `_ 3D TV-Regularized Sparse-View CT Reconstruction `ct_astra_weighted_tv_admm.py `_ diff --git a/examples/scripts/ct_astra_tv_admm.py b/examples/scripts/ct_astra_tv_admm.py index 69520f872..8cac716e1 100644 --- a/examples/scripts/ct_astra_tv_admm.py +++ b/examples/scripts/ct_astra_tv_admm.py @@ -5,8 +5,8 @@ # with the package. r""" -TV-Regularized Sparse-View CT Reconstruction -============================================ +TV-Regularized Sparse-View CT Reconstruction (ASTRA Projector) +============================================================== This example demonstrates solution of a sparse-view CT reconstruction problem with isotropic total variation (TV) regularization @@ -16,7 +16,10 @@ where $A$ is the X-ray transform (the CT forward projection operator), $\mathbf{y}$ is the sinogram, $C$ is a 2D finite difference operator, and -$\mathbf{x}$ is the desired image. +$\mathbf{x}$ is the desired image. This example uses the CT projector +provided by the astra package, while the companion +[example script](ct_tv_admm.rst) uses the projector integrated into +scico. """ import numpy as np diff --git a/examples/scripts/ct_multi_cs_tv_admm.py b/examples/scripts/ct_multi_cs_tv_admm.py index f7fcfcc10..35e8f6abc 100644 --- a/examples/scripts/ct_multi_cs_tv_admm.py +++ b/examples/scripts/ct_multi_cs_tv_admm.py @@ -23,8 +23,6 @@ import numpy as np -import jax - from xdesign import Foam, discrete_phantom import scico.numpy as snp @@ -38,8 +36,7 @@ """ N = 512 # phantom size np.random.seed(1234) -x_gt = discrete_phantom(Foam(size_range=[0.075, 0.0025], gap=1e-3, porosity=1), size=N) -x_gt = jax.device_put(x_gt) +x_gt = snp.array(discrete_phantom(Foam(size_range=[0.075, 0.0025], gap=1e-3, porosity=1), size=N)) """ diff --git a/examples/scripts/ct_multi_tv_admm.py b/examples/scripts/ct_multi_tv_admm.py index 8ed284c8d..6ab77cffe 100644 --- a/examples/scripts/ct_multi_tv_admm.py +++ b/examples/scripts/ct_multi_tv_admm.py @@ -22,8 +22,6 @@ import numpy as np -import jax - from xdesign import Foam, discrete_phantom import scico.numpy as snp @@ -37,8 +35,7 @@ """ N = 512 # phantom size np.random.seed(1234) -x_gt = discrete_phantom(Foam(size_range=[0.075, 0.0025], gap=1e-3, porosity=1), size=N) -x_gt = jax.device_put(x_gt) +x_gt = snp.array(discrete_phantom(Foam(size_range=[0.075, 0.0025], gap=1e-3, porosity=1), size=N)) """ diff --git a/examples/scripts/ct_tv_admm.py b/examples/scripts/ct_tv_admm.py index 6aa3474a7..4b77eeb07 100644 --- a/examples/scripts/ct_tv_admm.py +++ b/examples/scripts/ct_tv_admm.py @@ -24,8 +24,6 @@ import numpy as np -import jax - from mpl_toolkits.axes_grid1 import make_axes_locatable from xdesign import Foam, discrete_phantom @@ -40,8 +38,7 @@ """ N = 512 # phantom size np.random.seed(1234) -x_gt = discrete_phantom(Foam(size_range=[0.075, 0.0025], gap=1e-3, porosity=1), size=N) -x_gt = jax.device_put(x_gt) # convert to jax type, push to GPU +x_gt = snp.array(discrete_phantom(Foam(size_range=[0.075, 0.0025], gap=1e-3, porosity=1), size=N)) """ diff --git a/examples/scripts/index.rst b/examples/scripts/index.rst index 584711de2..136e610c6 100644 --- a/examples/scripts/index.rst +++ b/examples/scripts/index.rst @@ -14,6 +14,7 @@ Computed Tomography - ct_astra_noreg_pcg.py - ct_astra_3d_tv_admm.py - ct_astra_tv_admm.py + - ct_tv_admm.py - ct_astra_weighted_tv_admm.py - ct_svmbir_tv_multi.py - ct_svmbir_ppp_bm3d_admm_cg.py @@ -98,6 +99,7 @@ Total Variation - ct_abel_tv_admm.py - ct_abel_tv_admm_tune.py - ct_astra_tv_admm.py + - ct_tv_admm.py - ct_astra_3d_tv_admm.py - ct_astra_weighted_tv_admm.py - ct_svmbir_tv_multi.py @@ -154,6 +156,7 @@ ADMM - ct_abel_tv_admm.py - ct_abel_tv_admm_tune.py - ct_astra_tv_admm.py + - ct_tv_admm.py - ct_astra_3d_tv_admm.py - ct_astra_weighted_tv_admm.py - ct_svmbir_tv_multi.py diff --git a/requirements.txt b/requirements.txt index 68ab1ebac..223db9e76 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,8 +3,8 @@ scipy>=1.6.0 tifffile imageio>=2.17 matplotlib -jaxlib>=0.4.3,<=0.4.19 -jax>=0.4.3,<=0.4.19 +jaxlib>=0.4.3,<=0.4.20 +jax>=0.4.3,<=0.4.20 flax>=0.6.1,<=0.6.9 svmbir>=0.3.3 pyabel>=0.9.0