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

Topotomo import: added simple background removal and projection geometry...

Topotomo import: added simple background removal and projection geometry construction for 3D reconstruction/projection

Signed-off-by: default avatarNicola Vigano <nicola.vigano@esrf.fr>
parent 39953620
No related branches found
No related tags found
No related merge requests found
......@@ -35,6 +35,11 @@ function gr = gtGrainImportTopotomoScan(gr, p, det_ind, data_type)
filen_name = fullfile(base_dir, [base_name, sprintf('%04d.edf', (ii_b - 1) * nph + ii_p)]);
b_vol(:, :, ii_p) = edf_read(filen_name, [], 'nodisp', info);
end
bck_grnd = median(b_vol(:,:,[1:5, end-5:end]), 3);
b_vol = bsxfun(@minus, b_vol, bck_grnd);
b_vol(b_vol < 0) = 0;
bl(ii_b).intm = b_vol;
bl(ii_b).mask = true(b_size);
bl(ii_b).bbuim = roi_u;
......@@ -87,12 +92,15 @@ function gr = gtGrainImportTopotomoScan(gr, p, det_ind, data_type)
proj.included = (1:nbl)';
proj.selected = true(size(proj.ondet));
% sel = proj.ondet(proj.included(proj.selected));
% dvecsam = gr.allblobs(det_ind).dvecsam(sel, :);
% rot_s2l = gr.allblobs(det_ind).rot_s2l(:, :, sel);
% proj.geom = gtGeoProjForReconstruction(dvecsam, ...
% rot_s2l, gr.center, bbpos_det_grain, [], ...
% p.detgeo(det_ind), labgeo, samgeo, p.recgeo(det_ind), 'ASTRA_grain');
sel = proj.ondet(proj.included(proj.selected));
dvecsam = gr.allblobs(det_ind).dvecsam(sel, :);
rot_l2s = gr.allblobs(det_ind).rot_l2s(:, :, sel);
bb_blobs_pos = [1, 1, p.detgeo(det_ind).detsizeu, p.detgeo(det_ind).detsizev];
bb_blobs_pos = bb_blobs_pos(ones(1, nbl), :);
proj.geom = gtGeoProjForReconstruction(dvecsam, ...
rot_l2s, gr.center, bb_blobs_pos, [], ...
p.detgeo(det_ind), p.labgeo, p.samgeo, p.recgeo(1), 'ASTRA_grain');
fprintf('\b\b: Done in %g seconds.\n', toc(c))
......
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