Skip to content
Snippets Groups Projects
Commit 6be8368e authored by Nicola Vigano's avatar Nicola Vigano
Browse files

Absorption volume: probably fixed a misalignment error in the geometry...

Absorption volume: probably fixed a misalignment error in the geometry determination, and added a trick for having natural rotation of the volume around the rotation axis

Signed-off-by: default avatarNicola Vigano <nicola.vigano@esrf.fr>
parent c37ae895
No related branches found
No related tags found
No related merge requests found
function proj = gtAstraPrepareAbsorptionStack(parameters)
function proj = gtAstraPrepareAbsorptionStack(parameters, rot_angle)
% GTASTRAPREPAREABSORPTIONSTACK Assembles the 3D projection stack of absorption
% images and saves them to file absorption_stack.mat
%
......@@ -20,6 +20,10 @@ function proj = gtAstraPrepareAbsorptionStack(parameters)
% Version 002 26-09-2012 by LNervo
% Formatting, cleaning, commenting
if (~exist('rot_angle', 'var') || isempty(rot_angle))
rot_angle = 0;
end
acq = parameters.acq;
labgeo = parameters.labgeo;
......@@ -60,10 +64,14 @@ end
fprintf('Building geometry..')
imgs_nums = 0 : rec_abs.interval : totproj-1;
Omega_rad = angle_rad(imgs_nums + 1);
Omega_deg = Omega_rad * 180 / pi;
Omega_deg = Omega_rad * 180 / pi + rot_angle;
bbpos = repmat(acq.bb, [numel(Omega_deg), 1]);
geom = gtGeoProjForReconstruction([], Omega_deg', [], bbpos, [], ...
% bbpos = [gtGeoGrainCenterSam2Det(samgeo.orig, 0, parameters) - (acq.bb(3:4) - 1) / 2, acq.bb(3:4)];
% bbpos = repmat(bbpos, [numel(Omega_deg), 1]);
vol_center = repmat(samgeo.orig, [numel(Omega_deg), 1]);
geom = gtGeoProjForReconstruction([], Omega_deg', vol_center, bbpos, [], ...
detgeo, labgeo, samgeo, recgeo, 'ASTRA_absorption');
geom(:, 10:12) = round(geom(:, 10:12));
......
function proj_geom = gtGeoProjForReconstruction(projvec_sam, omega, graincenter,...
function proj_geom = gtGeoProjForReconstruction(projvec_sam, omega, vol_center,...
bbpos, bboff, detgeo, labgeo, samgeo, recgeo, rectype)
% GTGEOPROJFORRECONSTRUCTION Projection coordinates required for
% reconstructions.
......@@ -88,14 +88,14 @@ function proj_geom = gtGeoProjForReconstruction(projvec_sam, omega, graincenter,
end
projvec_rec = gtMathsNormalizeVectorsList(projvec_rec);
if (strcmpi(rectype, 'ASTRA_grain'))
% Grain center in REC reference
graincenter_rec = gtGeoSam2Sam(graincenter, samgeo, recgeo, false, false);
graincenter_rec = graincenter_rec(ones_omega, :);
if (strcmpi(rectype, 'ASTRA_grain') || strcmpi(rectype, 'ASTRA_absorption'))
% Volume center in REC reference
vol_center_rec = gtGeoSam2Sam(vol_center, samgeo, recgeo, false, false);
vol_center_rec = vol_center_rec(ones_omega, :);
bbcent_rec = bbcent_rec - graincenter_rec;
bbcent_rec = bbcent_rec - vol_center_rec;
else
% case {'ASTRA_full', 'ASTRA_absorption'}
% case {'ASTRA_full'}
end
proj_geom = [projvec_rec, bbcent_rec, detdiru_rec, detdirv_rec];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment