summaryrefslogtreecommitdiffstats
path: root/matlab/tools
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 /matlab/tools
parentb3393ec49bbe2ffc3eb3b6c7512bb12b8b8d2e52 (diff)
downloadastra-8db3ad4cfd4273e9623f5e2824bd3c7e3a71c641.tar.gz
astra-8db3ad4cfd4273e9623f5e2824bd3c7e3a71c641.tar.bz2
astra-8db3ad4cfd4273e9623f5e2824bd3c7e3a71c641.tar.xz
astra-8db3ad4cfd4273e9623f5e2824bd3c7e3a71c641.zip
Improve postalignment function
Diffstat (limited to 'matlab/tools')
-rw-r--r--matlab/tools/astra_geom_postalignment.m5
1 files changed, 4 insertions, 1 deletions
diff --git a/matlab/tools/astra_geom_postalignment.m b/matlab/tools/astra_geom_postalignment.m
index c85a7a0..0385e74 100644
--- a/matlab/tools/astra_geom_postalignment.m
+++ b/matlab/tools/astra_geom_postalignment.m
@@ -9,7 +9,8 @@ function proj_geom = astra_geom_postalignment(proj_geom, factor)
% distance to shift the detector (measured in detector pixels).
%
% For 3D geometries, factor is a pair of floats specifying the horizontal
-% resp. vertical distances to shift the detector.
+% resp. vertical distances to shift the detector. If only a single float is
+% specified, this is treated as an horizontal shift.
%
% proj_geom: input projection geometry (vector-based only, use astra_geom_2vec to convert conventional projection geometries)
% factor: number of pixels to shift the detector
@@ -25,6 +26,8 @@ function proj_geom = astra_geom_postalignment(proj_geom, factor)
%--------------------------------------------------------------------------
% $Id$
+ proj_geom = astra_geom_2vec(proj_geom);
+
if strcmp(proj_geom.type,'fanflat_vec') || strcmp(proj_geom.type,'parallel_vec')
proj_geom.Vectors(:,3:4) = proj_geom.Vectors(:,3:4) + factor(1) * proj_geom.Vectors(:,5:6);