summaryrefslogtreecommitdiffstats
path: root/samples
diff options
context:
space:
mode:
authorWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2018-01-09 15:57:30 +0100
committerWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2018-01-09 15:57:30 +0100
commit8db3ad4cfd4273e9623f5e2824bd3c7e3a71c641 (patch)
tree0a5fd26004481ff68bb3a84d2564e56bec4dff5f /samples
parentb3393ec49bbe2ffc3eb3b6c7512bb12b8b8d2e52 (diff)
downloadastra-8db3ad4cfd4273e9623f5e2824bd3c7e3a71c641.tar.gz
astra-8db3ad4cfd4273e9623f5e2824bd3c7e3a71c641.tar.bz2
astra-8db3ad4cfd4273e9623f5e2824bd3c7e3a71c641.tar.xz
astra-8db3ad4cfd4273e9623f5e2824bd3c7e3a71c641.zip
Improve postalignment function
Diffstat (limited to 'samples')
-rw-r--r--samples/matlab/s022_fbp_cor.m5
-rw-r--r--samples/python/s022_fbp_cor.py6
2 files changed, 2 insertions, 9 deletions
diff --git a/samples/matlab/s022_fbp_cor.m b/samples/matlab/s022_fbp_cor.m
index b33d5ce..8521d7e 100644
--- a/samples/matlab/s022_fbp_cor.m
+++ b/samples/matlab/s022_fbp_cor.m
@@ -14,10 +14,7 @@ vol_geom = astra_create_vol_geom(256, 256);
proj_geom = astra_create_proj_geom('parallel', 1.0, 256, linspace2(0,pi,180));
% Projection geometry with shifted center of rotation
-% We create this by shifting the detector center V(:,3:4) by a multiple of the detector
-% orientation V(:,5:6).
-proj_geom_cor = astra_geom_2vec(proj_geom);
-proj_geom_cor.Vectors(:,3:4) = proj_geom_cor.Vectors(:,3:4) + cor_shift * proj_geom_cor.Vectors(:,5:6);
+proj_geom_cor = astra_geom_postalignment(proj_geom, cor_shift);
% As before, create a sinogram from a phantom, using the shifted center of rotation
P = phantom(256);
diff --git a/samples/python/s022_fbp_cor.py b/samples/python/s022_fbp_cor.py
index 2d811c0..bb110e5 100644
--- a/samples/python/s022_fbp_cor.py
+++ b/samples/python/s022_fbp_cor.py
@@ -32,11 +32,7 @@ vol_geom = astra.create_vol_geom(256, 256)
proj_geom = astra.create_proj_geom('parallel', 1.0, 256, np.linspace(0,np.pi,180,False))
# 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.geom_2vec(proj_geom)
-V = proj_geom_cor['Vectors']
-V[:,2:4] = V[:,2:4] + cor_shift * V[:,4:6]
+proj_geom_cor = astra.geom_postalignment(proj_geom, cor_shift)
# As before, create a sinogram from a phantom, using the shifted center of rotation
import scipy.io