summaryrefslogtreecommitdiffstats
path: root/samples/python/s018_plugin.py
diff options
context:
space:
mode:
authorWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2017-09-15 16:38:08 +0200
committerWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2017-09-15 16:38:08 +0200
commitaa31a06235496c0d808e57c8ce914cb4b640bc6e (patch)
tree33385e828ddca0b2857bac9e3dac4dd3723a3eee /samples/python/s018_plugin.py
parentf6aa2db83dfea89f9d2cfc6fcbd3da141ee77e02 (diff)
parent00a1c6118b2d64b867c8e640c295462bcccfc7c9 (diff)
downloadastra-aa31a06235496c0d808e57c8ce914cb4b640bc6e.tar.gz
astra-aa31a06235496c0d808e57c8ce914cb4b640bc6e.tar.bz2
astra-aa31a06235496c0d808e57c8ce914cb4b640bc6e.tar.xz
astra-aa31a06235496c0d808e57c8ce914cb4b640bc6e.zip
Merge branch 'master' into parallel_vec
Diffstat (limited to 'samples/python/s018_plugin.py')
-rw-r--r--samples/python/s018_plugin.py47
1 files changed, 29 insertions, 18 deletions
diff --git a/samples/python/s018_plugin.py b/samples/python/s018_plugin.py
index 85b5486..dbd9274 100644
--- a/samples/python/s018_plugin.py
+++ b/samples/python/s018_plugin.py
@@ -1,28 +1,27 @@
-#-----------------------------------------------------------------------
-#Copyright 2015 Centrum Wiskunde & Informatica, Amsterdam
+# -----------------------------------------------------------------------
+# Copyright: 2010-2016, iMinds-Vision Lab, University of Antwerp
+# 2013-2016, CWI, Amsterdam
#
-#Author: Daniel M. Pelt
-#Contact: D.M.Pelt@cwi.nl
-#Website: http://dmpelt.github.io/pyastratoolbox/
+# Contact: astra@uantwerpen.be
+# Website: http://www.astra-toolbox.com/
#
+# This file is part of the ASTRA Toolbox.
#
-#This file is part of the Python interface to the
-#All Scale Tomographic Reconstruction Antwerp Toolbox ("ASTRA Toolbox").
#
-#The Python interface to the ASTRA Toolbox is free software: you can redistribute it and/or modify
-#it under the terms of the GNU General Public License as published by
-#the Free Software Foundation, either version 3 of the License, or
-#(at your option) any later version.
+# The ASTRA Toolbox is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
#
-#The Python interface to the ASTRA Toolbox is distributed in the hope that it will be useful,
-#but WITHOUT ANY WARRANTY; without even the implied warranty of
-#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-#GNU General Public License for more details.
+# The ASTRA Toolbox is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
#
-#You should have received a copy of the GNU General Public License
-#along with the Python interface to the ASTRA Toolbox. If not, see <http://www.gnu.org/licenses/>.
+# You should have received a copy of the GNU General Public License
+# along with the ASTRA Toolbox. If not, see <http://www.gnu.org/licenses/>.
#
-#-----------------------------------------------------------------------
+# -----------------------------------------------------------------------
import astra
import numpy as np
@@ -124,6 +123,14 @@ if __name__=='__main__':
# We can also use OpTomo to call the plugin
rec_op = W.reconstruct('LANDWEBER-PLUGIN', sinogram, 100, extraOptions={'Relaxation':1.5})
+
+ # ASTRA also comes with built-in plugins:
+ astra.plugin.register(astra.plugins.SIRTPlugin)
+ astra.plugin.register(astra.plugins.CGLSPlugin)
+ rec_sirt = W.reconstruct('SIRT-PLUGIN', sinogram, 100, extraOptions={'Relaxation':1.5})
+ rec_cgls = W.reconstruct('CGLS-PLUGIN', sinogram, 100)
+
+
import pylab as pl
pl.gray()
pl.figure(1)
@@ -132,6 +139,10 @@ if __name__=='__main__':
pl.imshow(rec_rel,vmin=0,vmax=1)
pl.figure(3)
pl.imshow(rec_op,vmin=0,vmax=1)
+ pl.figure(4)
+ pl.imshow(rec_sirt,vmin=0,vmax=1)
+ pl.figure(5)
+ pl.imshow(rec_cgls,vmin=0,vmax=1)
pl.show()
# Clean up.