From e9a75aa5dd890e4e062089729064d5d58659a074 Mon Sep 17 00:00:00 2001 From: "Daniel M. Pelt" Date: Tue, 26 May 2015 10:30:47 +0200 Subject: Fix Python samples for updated interface and old six versions --- samples/python/s016_plots.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'samples/python/s016_plots.py') 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() -- cgit v1.2.3