diff options
author | Edoardo Pasca <edo.paskino@gmail.com> | 2017-11-02 18:03:41 +0000 |
---|---|---|
committer | Edoardo Pasca <edo.paskino@gmail.com> | 2017-11-02 18:03:41 +0000 |
commit | e5303410dc3e82a633c2a3ddbc535fdaa95cb671 (patch) | |
tree | 65fe2fb3b269a355078c266911d43b4063997fe5 | |
parent | 5ca31d867de64501badf346e206c716900a38d9e (diff) | |
download | regularization-e5303410dc3e82a633c2a3ddbc535fdaa95cb671.tar.gz regularization-e5303410dc3e82a633c2a3ddbc535fdaa95cb671.tar.bz2 regularization-e5303410dc3e82a633c2a3ddbc535fdaa95cb671.tar.xz regularization-e5303410dc3e82a633c2a3ddbc535fdaa95cb671.zip |
added demos
-rw-r--r-- | src/Python/demo/demo_dendrites.py | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/src/Python/demo/demo_dendrites.py b/src/Python/demo/demo_dendrites.py index 528702c..f5dc845 100644 --- a/src/Python/demo/demo_dendrites.py +++ b/src/Python/demo/demo_dendrites.py @@ -1,3 +1,4 @@ + # -*- coding: utf-8 -*- """ Created on Wed Aug 23 16:34:49 2017 @@ -86,14 +87,14 @@ fistaRecon = FISTAReconstructor(proj_geom, subsets = 8) print("Reconstruction using FISTA-OS-PWLS without regularization...") -fistaRecon.setParameter(number_of_iterations = 18) +fistaRecon.setParameter(number_of_iterations = 5) ### adjust the regularization parameter ##lc = fistaRecon.getParameter('Lipschitz_constant') ##fistaRecon.getParameter('regularizer')\ ## .setParameter(regularization_parameter=5e6/lc) fistaRecon.use_device = True -if False: +if True: fistaRecon.prepareForIteration() X = fistaRecon.iterate(numpy.load("../test/X.npy")) numpy.save("FISTA-OS-PWLS.npy",X) @@ -123,7 +124,7 @@ if False: X = fistaRecon.iterate(numpy.load("../test/X.npy")) numpy.save("FISTA-OS-GH-TV.npy",X) -if True: +if False: # adjust the regularization parameter lc = fistaRecon.getParameter('Lipschitz_constant') regul.setParameter( @@ -136,3 +137,32 @@ if True: X = fistaRecon.iterate(numpy.load("../test/X.npy")) numpy.save("FISTA-OS-GH-TGV.npy",X) +if False: + # adjust the regularization parameter + lc = fistaRecon.getParameter('Lipschitz_constant') + regul.setParameter( + algorithm=Regularizer.Algorithm.PatchBased_Regul, + regularization_parameter=3/lc, + searching_window_ratio=3, + similarity_window_ratio=1, + PB_filtering_parameter=0.04 + + ) + fistaRecon.setParameter(regularizer=regul) + fistaRecon.setParameter(ring_lambda_R_L1=0.002, ring_alpha=21) + fistaRecon.prepareForIteration() + X = fistaRecon.iterate(numpy.load("../test/X.npy")) + numpy.save("FISTA-OS-CPU_PB.npy",X) + +if False: + fistaRecon = FISTAReconstructor(proj_geom, + vol_geom, + Sino3D , + weights=Weights3D, + device=astradevice, + Lipschitz_constant = 7.6792e8, + number_of_iterations=50) + + fistaRecon.prepareForIteration() + X = fistaRecon.iterate(numpy.load("../test/X.npy")) + numpy.save("FISTA.npy",X) |