From 8db3ad4cfd4273e9623f5e2824bd3c7e3a71c641 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Tue, 9 Jan 2018 15:57:30 +0100 Subject: Improve postalignment function --- matlab/tools/astra_geom_postalignment.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'matlab/tools') 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); -- cgit v1.2.3