summaryrefslogtreecommitdiffstats
path: root/matlab
diff options
context:
space:
mode:
Diffstat (limited to 'matlab')
-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);