summaryrefslogtreecommitdiffstats
path: root/samples
diff options
context:
space:
mode:
authorWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2018-01-09 14:46:14 +0100
committerWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2018-01-09 15:17:44 +0100
commitf7037ad8af95af569649cff0afba97babebe9425 (patch)
tree5867fde6d740904a5b3a9af33c0b4ba3a130efad /samples
parentf757ae3a98b49b34bbf08ab53e5724d17000e7c9 (diff)
downloadastra-f7037ad8af95af569649cff0afba97babebe9425.tar.gz
astra-f7037ad8af95af569649cff0afba97babebe9425.tar.bz2
astra-f7037ad8af95af569649cff0afba97babebe9425.tar.xz
astra-f7037ad8af95af569649cff0afba97babebe9425.zip
Add geom_size, geom_2vec to main astra module
Diffstat (limited to 'samples')
-rw-r--r--samples/python/s021_pygpu.py4
-rw-r--r--samples/python/s022_fbp_cor.py2
2 files changed, 3 insertions, 3 deletions
diff --git a/samples/python/s021_pygpu.py b/samples/python/s021_pygpu.py
index db6584b..95a3062 100644
--- a/samples/python/s021_pygpu.py
+++ b/samples/python/s021_pygpu.py
@@ -37,12 +37,12 @@ angles = np.linspace(0, 2 * np.pi, 180, False)
proj_geom = astra.create_proj_geom('cone', 1.0, 1.0, 128, 192, angles, 1000, 0)
# Create a simple hollow cube phantom, as a pygpu gpuarray
-vol_gpuarr = pygpu.gpuarray.zeros(astra.functions.geom_size(vol_geom), dtype='float32')
+vol_gpuarr = pygpu.gpuarray.zeros(astra.geom_size(vol_geom), dtype='float32')
vol_gpuarr[17:113, 17:113, 17:113] = 1
vol_gpuarr[33:97, 33:97, 33:97] = 0
# Create a pygpu gpuarray for the output projection data
-proj_gpuarr = pygpu.gpuarray.zeros(astra.functions.geom_size(proj_geom), dtype='float32')
+proj_gpuarr = pygpu.gpuarray.zeros(astra.geom_size(proj_geom), dtype='float32')
# Create the astra GPULink objects and create astra data3d objects from them
z, y, x = proj_gpuarr.shape
diff --git a/samples/python/s022_fbp_cor.py b/samples/python/s022_fbp_cor.py
index eb2f56b..2d811c0 100644
--- a/samples/python/s022_fbp_cor.py
+++ b/samples/python/s022_fbp_cor.py
@@ -34,7 +34,7 @@ proj_geom = astra.create_proj_geom('parallel', 1.0, 256, np.linspace(0,np.pi,180
# Projection geometry with shifted center of rotation
# We create this by shifting the detector center V[:,2:4] by a multiple of the detector
# orientation V[:,4:6].
-proj_geom_cor = astra.functions.geom_2vec(proj_geom)
+proj_geom_cor = astra.geom_2vec(proj_geom)
V = proj_geom_cor['Vectors']
V[:,2:4] = V[:,2:4] + cor_shift * V[:,4:6]