From f603045f5bb41de6bc1ffa93badd932b891f5f1d Mon Sep 17 00:00:00 2001
From: Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>
Date: Fri, 6 Mar 2015 10:58:50 +0100
Subject: Adjust docstring and samples to new python create_sino function

---
 python/astra/creators.py                  |  4 ----
 samples/python/s001_sinogram_par2d.py     |  4 ++--
 samples/python/s003_gpu_reconstruction.py |  4 ++--
 samples/python/s008_gpu_selection.py      |  4 ++--
 samples/python/s012_masks.py              |  4 ++--
 samples/python/s013_constraints.py        |  4 ++--
 samples/python/s014_FBP.py                |  4 ++--
 samples/python/s015_fp_bp.py              | 14 +++++++-------
 8 files changed, 19 insertions(+), 23 deletions(-)

diff --git a/python/astra/creators.py b/python/astra/creators.py
index 2e2dc71..68bc8a2 100644
--- a/python/astra/creators.py
+++ b/python/astra/creators.py
@@ -361,10 +361,6 @@ def create_sino(data, proj_id, returnData=True, gpuIndex=None):
     projection. Otherwise, returns a tuple containing the ID of the
     forward projection and the forward projection itself, in that
     order.
-
-    The geometry of setup is defined by ``proj_id`` or with
-    ``proj_geom`` and ``vol_geom``. If ``proj_id`` is given, then
-    ``proj_geom`` and ``vol_geom`` must be None and vice versa.
 """
     proj_geom = projector.projection_geometry(proj_id)
     vol_geom = projector.volume_geometry(proj_id)
diff --git a/samples/python/s001_sinogram_par2d.py b/samples/python/s001_sinogram_par2d.py
index 009d9b3..1d1b912 100644
--- a/samples/python/s001_sinogram_par2d.py
+++ b/samples/python/s001_sinogram_par2d.py
@@ -43,8 +43,8 @@ P = scipy.io.loadmat('phantom.mat')['phantom256']
 # Create a sinogram using the GPU.
 # Note that the first time the GPU is accessed, there may be a delay
 # of up to 10 seconds for initialization.
-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()
diff --git a/samples/python/s003_gpu_reconstruction.py b/samples/python/s003_gpu_reconstruction.py
index 4f6ec1f..07b38ef 100644
--- a/samples/python/s003_gpu_reconstruction.py
+++ b/samples/python/s003_gpu_reconstruction.py
@@ -33,8 +33,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()
diff --git a/samples/python/s008_gpu_selection.py b/samples/python/s008_gpu_selection.py
index c42e53b..a180802 100644
--- a/samples/python/s008_gpu_selection.py
+++ b/samples/python/s008_gpu_selection.py
@@ -32,10 +32,10 @@ proj_geom = astra.create_proj_geom('parallel', 1.0, 384, np.linspace(0,np.pi,180
 import scipy.io
 P = scipy.io.loadmat('phantom.mat')['phantom256']
 
-proj_id = astra.create_projector('line',proj_geom,vol_geom)
+proj_id = astra.create_projector('cuda',proj_geom,vol_geom)
 
 # Create a sinogram from a phantom, using GPU #1. (The default is #0)
-sinogram_id, sinogram = astra.create_sino(P, proj_id, useCUDA=True, gpuIndex=1)
+sinogram_id, sinogram = astra.create_sino(P, proj_id, gpuIndex=1)
 
 
 # Set up the parameters for a reconstruction algorithm using the GPU
diff --git a/samples/python/s012_masks.py b/samples/python/s012_masks.py
index 441d11b..0f667b0 100644
--- a/samples/python/s012_masks.py
+++ b/samples/python/s012_masks.py
@@ -48,8 +48,8 @@ proj_geom = astra.create_proj_geom('parallel', 1.0, 384, np.linspace(0,np.pi,50,
 # 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)
 
 pylab.figure(2)
 pylab.imshow(P)
diff --git a/samples/python/s013_constraints.py b/samples/python/s013_constraints.py
index 009360e..8b63d5e 100644
--- a/samples/python/s013_constraints.py
+++ b/samples/python/s013_constraints.py
@@ -36,8 +36,8 @@ proj_geom = astra.create_proj_geom('parallel', 1.0, 384, np.linspace(0,np.pi,50,
 # 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()
diff --git a/samples/python/s014_FBP.py b/samples/python/s014_FBP.py
index ef4afc2..2f8e388 100644
--- a/samples/python/s014_FBP.py
+++ b/samples/python/s014_FBP.py
@@ -33,8 +33,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()
diff --git a/samples/python/s015_fp_bp.py b/samples/python/s015_fp_bp.py
index 10c238d..fa0bf86 100644
--- a/samples/python/s015_fp_bp.py
+++ b/samples/python/s015_fp_bp.py
@@ -26,8 +26,8 @@
 
 
 # This example demonstrates using the FP and BP primitives with Matlab's lsqr
-# solver. Calls to FP (astra_create_sino_cuda) and
-# BP (astra_create_backprojection_cuda) are wrapped in a function astra_wrap,
+# solver. Calls to FP (astra.create_sino) and
+# BP (astra.create_backprojection) are wrapped in a function astra_wrap,
 # and a handle to this function is passed to lsqr.
 
 # Because in this case the inputs/outputs of FP and BP have to be vectors
@@ -39,17 +39,17 @@ import numpy as np
 # FP/BP wrapper class
 class astra_wrap(object):
     def __init__(self,proj_geom,vol_geom):
-        self.proj_id = astra.create_projector('line',proj_geom,vol_geom)
+        self.proj_id = astra.create_projector('cuda',proj_geom,vol_geom)
         self.shape = (proj_geom['DetectorCount']*len(proj_geom['ProjectionAngles']),vol_geom['GridColCount']*vol_geom['GridRowCount'])
         self.dtype = np.float
     
     def matvec(self,v):
-        sid, s = astra.create_sino(np.reshape(v,(vol_geom['GridRowCount'],vol_geom['GridColCount'])),self.proj_id,useCUDA=True)
+        sid, s = astra.create_sino(np.reshape(v,(vol_geom['GridRowCount'],vol_geom['GridColCount'])),self.proj_id)
         astra.data2d.delete(sid)
         return s.flatten()
     
     def rmatvec(self,v):
-        bid, b = astra.create_backprojection(np.reshape(v,(len(proj_geom['ProjectionAngles']),proj_geom['DetectorCount'],)),self.proj_id,useCUDA=True)
+        bid, b = astra.create_backprojection(np.reshape(v,(len(proj_geom['ProjectionAngles']),proj_geom['DetectorCount'],)),self.proj_id)
         astra.data2d.delete(bid)
         return b.flatten()
 
@@ -61,8 +61,8 @@ import scipy.io
 P = scipy.io.loadmat('phantom.mat')['phantom256']
 
 # Create a sinogram using the GPU.
-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)
 
 # Reshape the sinogram into a vector
 b = sinogram.flatten()
-- 
cgit v1.2.3