diff options
author | Daniel M. Pelt <D.M.Pelt@cwi.nl> | 2015-05-26 10:30:47 +0200 |
---|---|---|
committer | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2015-05-26 11:24:25 +0200 |
commit | f5c3a7c07d834eabc4abb78834c952bbfcf0c906 (patch) | |
tree | 37d3a9856b51d1aa1c292f6f9687870274b4cbe9 /samples/python/s016_plots.py | |
parent | 2ff0de757c6e5ba87247f566aa68bc928672ae37 (diff) | |
download | astra-f5c3a7c07d834eabc4abb78834c952bbfcf0c906.tar.gz astra-f5c3a7c07d834eabc4abb78834c952bbfcf0c906.tar.bz2 astra-f5c3a7c07d834eabc4abb78834c952bbfcf0c906.tar.xz astra-f5c3a7c07d834eabc4abb78834c952bbfcf0c906.zip |
Fix Python samples for updated interface and old six versions
Diffstat (limited to 'samples/python/s016_plots.py')
-rw-r--r-- | samples/python/s016_plots.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/samples/python/s016_plots.py b/samples/python/s016_plots.py index cd4d98c..8a8ba64 100644 --- a/samples/python/s016_plots.py +++ b/samples/python/s016_plots.py @@ -24,7 +24,11 @@ # #----------------------------------------------------------------------- -from six.moves import range +try: + from six.moves import range +except ImportError: + # six 1.3.0 + from six.moves import xrange as range import astra import numpy as np @@ -35,8 +39,8 @@ proj_geom = astra.create_proj_geom('parallel', 1.0, 384, np.linspace(0,np.pi,180 # As before, create a sinogram from a phantom import scipy.io P = scipy.io.loadmat('phantom.mat')['phantom256'] -proj_id = astra.create_projector('line',proj_geom,vol_geom) -sinogram_id, sinogram = astra.create_sino(P, proj_id,useCUDA=True) +proj_id = astra.create_projector('cuda',proj_geom,vol_geom) +sinogram_id, sinogram = astra.create_sino(P, proj_id) import pylab pylab.gray() |