diff options
author | epapoutsellis <epapoutsellis@gmail.com> | 2019-06-10 13:52:43 +0100 |
---|---|---|
committer | epapoutsellis <epapoutsellis@gmail.com> | 2019-06-10 13:52:43 +0100 |
commit | 34d7a6a2d96c35b4f4978b11a4fe8673dc47769e (patch) | |
tree | 9720146882a5fea0eef078a71135e900a48de3f7 /Wrappers | |
parent | d5cb6fd1f42d98b24a0bd2ae2646d6f8914ba863 (diff) | |
download | framework-34d7a6a2d96c35b4f4978b11a4fe8673dc47769e.tar.gz framework-34d7a6a2d96c35b4f4978b11a4fe8673dc47769e.tar.bz2 framework-34d7a6a2d96c35b4f4978b11a4fe8673dc47769e.tar.xz framework-34d7a6a2d96c35b4f4978b11a4fe8673dc47769e.zip |
fix tomophantom demo
Diffstat (limited to 'Wrappers')
-rw-r--r-- | Wrappers/Python/demos/PDHG_examples/GatherAll/PDHG_TV_Denoising_Gaussian_3D.py | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/Wrappers/Python/demos/PDHG_examples/GatherAll/PDHG_TV_Denoising_Gaussian_3D.py b/Wrappers/Python/demos/PDHG_examples/GatherAll/PDHG_TV_Denoising_Gaussian_3D.py index 3d91bf9..15709cd 100644 --- a/Wrappers/Python/demos/PDHG_examples/GatherAll/PDHG_TV_Denoising_Gaussian_3D.py +++ b/Wrappers/Python/demos/PDHG_examples/GatherAll/PDHG_TV_Denoising_Gaussian_3D.py @@ -20,7 +20,7 @@ #========================================================================= """ -Total Variation (3D) Denoising using PDHG algorithm: +Total Variation (3D) Denoising using PDHG algorithm and Tomophantom: Problem: min_{x} \alpha * ||\nabla x||_{2,1} + \frac{1}{2} * || x - g ||_{2}^{2} @@ -39,19 +39,14 @@ Problem: min_{x} \alpha * ||\nabla x||_{2,1} + \frac{1}{2} * || x - g ||_{2} """ -from ccpi.framework import ImageData, ImageGeometry - +from ccpi.framework import ImageData, ImageGeometry import matplotlib.pyplot as plt - from ccpi.optimisation.algorithms import PDHG - -from ccpi.optimisation.operators import BlockOperator, Identity, Gradient -from ccpi.optimisation.functions import ZeroFunction, L2NormSquared, \ - MixedL21Norm, BlockFunction +from ccpi.optimisation.operators import Gradient +from ccpi.optimisation.functions import L2NormSquared, MixedL21Norm from skimage.util import random_noise -# Create phantom for TV Gaussian denoising import timeit import os from tomophantom import TomoP3D @@ -105,9 +100,9 @@ sigma = 1 tau = 1/(sigma*normK**2) pdhg = PDHG(f=f,g=g,operator=operator, tau=tau, sigma=sigma, memopt=True) -pdhg.max_iteration = 2000 +pdhg.max_iteration = 1000 pdhg.update_objective_interval = 200 -pdhg.run(2000, verbose = True) +pdhg.run(1000, verbose = True) # Show results fig, axes = plt.subplots(nrows=2, ncols=3, figsize=(10, 8)) |