summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWillem Jan Palenstijn <wjp@usecode.org>2015-05-26 11:20:18 +0200
committerWillem Jan Palenstijn <wjp@usecode.org>2015-05-26 11:20:18 +0200
commit0f314f9fb219157ed3988ee08e0a8132301105ff (patch)
tree37d3a9856b51d1aa1c292f6f9687870274b4cbe9
parent658ee0d30d9f3f2d7b70ba698aa14af2a41aacc1 (diff)
parente9a75aa5dd890e4e062089729064d5d58659a074 (diff)
downloadastra-0f314f9fb219157ed3988ee08e0a8132301105ff.tar.gz
astra-0f314f9fb219157ed3988ee08e0a8132301105ff.tar.bz2
astra-0f314f9fb219157ed3988ee08e0a8132301105ff.tar.xz
astra-0f314f9fb219157ed3988ee08e0a8132301105ff.zip
Merge pull request #7 from dmpelt/master
Fix Python samples for updated interface and old six versions
-rw-r--r--samples/python/s005_3d_geometry.py6
-rw-r--r--samples/python/s016_plots.py10
2 files changed, 12 insertions, 4 deletions
diff --git a/samples/python/s005_3d_geometry.py b/samples/python/s005_3d_geometry.py
index f43fc7e..a7f7a3d 100644
--- a/samples/python/s005_3d_geometry.py
+++ b/samples/python/s005_3d_geometry.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
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()