From f7037ad8af95af569649cff0afba97babebe9425 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Tue, 9 Jan 2018 14:46:14 +0100 Subject: Add geom_size, geom_2vec to main astra module --- samples/python/s021_pygpu.py | 4 ++-- samples/python/s022_fbp_cor.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'samples') 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] -- cgit v1.2.3