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

6D-reconstruction/Twins: allowing raw images to be loaded only for certain...

6D-reconstruction/Twins: allowing raw images to be loaded only for certain orientation-space regions

Signed-off-by: default avatarNicola Vigano <nicola.vigano@esrf.fr>
parent 913ba921
No related branches found
No related tags found
No related merge requests found
...@@ -216,12 +216,18 @@ function [samp_ors, estim_space_bbox_pix, estim_orient_bbox] = gt6DCreateProjDat ...@@ -216,12 +216,18 @@ function [samp_ors, estim_space_bbox_pix, estim_orient_bbox] = gt6DCreateProjDat
fprintf('Determining UVW bounding boxes..') fprintf('Determining UVW bounding boxes..')
c = tic(); c = tic();
if (conf.use_raw_images) if (numel(conf.use_raw_images) == 1)
conf.use_raw_images = conf.use_raw_images(ones(num_grains, 1));
end
if (any(conf.use_raw_images))
uvw_tab = cell(num_grains, 1); uvw_tab = cell(num_grains, 1);
img_bboxes = cell(num_grains, 1); img_bboxes = cell(num_grains, 1);
img_sizes = cell(num_grains, 1); img_sizes = cell(num_grains, 1);
end
for ii_g = 1:num_grains for ii_g = 1:num_grains
if (conf.use_raw_images(ii_g))
local_ondet = extended_projs(ii_g).ondet; local_ondet = extended_projs(ii_g).ondet;
local_included = extended_projs(ii_g).included; local_included = extended_projs(ii_g).included;
local_inc_refl = local_ondet(local_included); local_inc_refl = local_ondet(local_included);
...@@ -251,9 +257,7 @@ function [samp_ors, estim_space_bbox_pix, estim_orient_bbox] = gt6DCreateProjDat ...@@ -251,9 +257,7 @@ function [samp_ors, estim_space_bbox_pix, estim_orient_bbox] = gt6DCreateProjDat
fprintf('%02d)du %8d, dv %8d, dw %8d, eta: %7.3f <- used: %d, u: [%4d %4d], v: [%4d %4d], w: [%4d %4d]\n', ... fprintf('%02d)du %8d, dv %8d, dw %8d, eta: %7.3f <- used: %d, u: [%4d %4d], v: [%4d %4d], w: [%4d %4d]\n', ...
[(1:numel(refor_ns))', img_sizes{ii_g}, refor_ns, ~inconvenient_etas{ii_g}, img_bboxes{ii_g}(:, [1 4 2 5 3 6]) ]'); [(1:numel(refor_ns))', img_sizes{ii_g}, refor_ns, ~inconvenient_etas{ii_g}, img_bboxes{ii_g}(:, [1 4 2 5 3 6]) ]');
end end
end else
else
for ii_g = 1:num_grains
max_img_sizes(ii_g, :) = [ ... max_img_sizes(ii_g, :) = [ ...
size(grs(ii_g).proj(conf.det_index).stack, 1), ... size(grs(ii_g).proj(conf.det_index).stack, 1), ...
size(grs(ii_g).proj(conf.det_index).stack, 3), ]; size(grs(ii_g).proj(conf.det_index).stack, 3), ];
...@@ -270,7 +274,7 @@ function [samp_ors, estim_space_bbox_pix, estim_orient_bbox] = gt6DCreateProjDat ...@@ -270,7 +274,7 @@ function [samp_ors, estim_space_bbox_pix, estim_orient_bbox] = gt6DCreateProjDat
num_blobs = numel(extended_projs(ii_g).included); num_blobs = numel(extended_projs(ii_g).included);
c = tic(); c = tic();
if (conf.use_raw_images) if (conf.use_raw_images(ii_g))
fprintf(' - Loading raw images: ') fprintf(' - Loading raw images: ')
blobs = gtFwdSimBlobDefinition('blob', num_blobs); blobs = gtFwdSimBlobDefinition('blob', num_blobs);
...@@ -401,7 +405,14 @@ end ...@@ -401,7 +405,14 @@ end
function [u_size, v_size] = get_stack_UV_size(img_sizes, p, conf) function [u_size, v_size] = get_stack_UV_size(img_sizes, p, conf)
max_img_sizes = [max(img_sizes(:, 1)), max(img_sizes(:, 2))]; max_img_sizes = [max(img_sizes(:, 1)), max(img_sizes(:, 2))];
stack_imgs_oversize = min(p.fsim.oversize, conf.stack_oversize); if (any(conf.use_raw_images))
% Because in this case we saturate the volume field of view from
% the spots already, and we only make up for what will probably be
% used as oversize later on for the volume
stack_imgs_oversize = p.rec.grains.options.rspace_oversize;
else
stack_imgs_oversize = min(p.fsim.oversize, conf.stack_oversize);
end
u_size = round(max_img_sizes(1) * stack_imgs_oversize); u_size = round(max_img_sizes(1) * stack_imgs_oversize);
v_size = round(max_img_sizes(2) * stack_imgs_oversize); v_size = round(max_img_sizes(2) * stack_imgs_oversize);
...@@ -539,14 +550,14 @@ function produce_beam_intensity_renorm_figure(refgr, p, ref_ondet, ref_included, ...@@ -539,14 +550,14 @@ function produce_beam_intensity_renorm_figure(refgr, p, ref_ondet, ref_included,
hold(ax, 'off') hold(ax, 'off')
end end
function s = get6DExtendedProjDefinition(num_structs) function eproj = get6DExtendedProjDefinition(num_structs)
if (~exist('num_structs', 'var') || isempty(num_structs)) if (~exist('num_structs', 'var') || isempty(num_structs))
num_structs = 1; num_structs = 1;
end end
repl_cell = cell(num_structs, 1); repl_cell = cell(num_structs, 1);
s = struct(... eproj = struct(...
'ondet', repl_cell, ... 'ondet', repl_cell, ...
'included', repl_cell, ... 'included', repl_cell, ...
'selected', repl_cell, ... 'selected', repl_cell, ...
...@@ -558,7 +569,7 @@ function s = get6DExtendedProjDefinition(num_structs) ...@@ -558,7 +569,7 @@ function s = get6DExtendedProjDefinition(num_structs)
'shared_refl_included_pos', repl_cell ); 'shared_refl_included_pos', repl_cell );
end end
function s = find_matches_with_refor(refor, twingr, refl_matches, conf) function eproj = find_matches_with_refor(refor, twingr, refl_matches, conf)
size_refl_list = size(refor.allblobs.omega); size_refl_list = size(refor.allblobs.omega);
refor_proj = refor.proj(conf.det_index); refor_proj = refor.proj(conf.det_index);
...@@ -617,24 +628,24 @@ function s = find_matches_with_refor(refor, twingr, refl_matches, conf) ...@@ -617,24 +628,24 @@ function s = find_matches_with_refor(refor, twingr, refl_matches, conf)
% If the parent enables it, we enable it as well % If the parent enables it, we enable it as well
bool_twin_sel = bool_twin_sel | (shared_refl & bool_ref_sel); bool_twin_sel = bool_twin_sel | (shared_refl & bool_ref_sel);
s = get6DExtendedProjDefinition(); eproj = get6DExtendedProjDefinition();
% We now find the blobs in the old twin bl structure that are % We now find the blobs in the old twin bl structure that are
% shared with the parent % shared with the parent
s.shared_refl_included_pos = bool_twin_inc_redundant(twin_ondet(twin_inc)); eproj.shared_refl_included_pos = bool_twin_inc_redundant(twin_ondet(twin_inc));
twin_inc = find(bool_twin_inc(twin_ondet)); twin_inc = find(bool_twin_inc(twin_ondet));
twin_sel = bool_twin_sel(twin_ondet(twin_inc)); twin_sel = bool_twin_sel(twin_ondet(twin_inc));
shared_refl_pos_in_parent = bool_ref_inc & shared_refl; shared_refl_pos_in_parent = bool_ref_inc & shared_refl;
s.shared_refl_pos_in_parent = shared_refl_pos_in_parent(ref_ondet(ref_included)); eproj.shared_refl_pos_in_parent = shared_refl_pos_in_parent(ref_ondet(ref_included));
% We cut it down to the size of the included % We cut it down to the size of the included
s.shared_refl = shared_refl(twin_ondet(twin_inc)); eproj.shared_refl = shared_refl(twin_ondet(twin_inc));
s.ondet = twin_ondet; eproj.ondet = twin_ondet;
s.included = twin_inc; eproj.included = twin_inc;
s.selected = twin_sel; eproj.selected = twin_sel;
end end
function blob = load_blob(img_bboxes, img_sizes, stackUSize, stackVSize, p, conf) function blob = load_blob(img_bboxes, img_sizes, stackUSize, stackVSize, p, conf)
......
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