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

FwdSim-Twins: auto-selecting shared blobs, that were also selected by the parent

parent 2c12a89f
No related branches found
No related tags found
No related merge requests found
...@@ -413,8 +413,9 @@ for n = first : last ...@@ -413,8 +413,9 @@ for n = first : last
for ii_d = 1:num_dets for ii_d = 1:num_dets
fprintf(' + Detector: %d\n', conf.det_index(ii_d)) fprintf(' + Detector: %d\n', conf.det_index(ii_d))
for ii_t = 1:numel(fp_twins) for ii_t = 1:numel(fp_twins)
fprintf(' %d) %d\n', ii_t, ... fprintf(' %d) included: %d, auto-selected: %d\n', ii_t, ...
numel(fp_twins(ii_t).proj(ii_d).included)); numel(fp_twins(ii_t).proj(ii_d).included), ...
numel(find(fp_twins(ii_t).proj(ii_d).selected)) );
end end
end end
fprintf(' - Assembling final data-structure..') fprintf(' - Assembling final data-structure..')
...@@ -706,6 +707,10 @@ function twin_vars = forward_simulate_twin(gr, gr_fwd_sim, gr_proj, conf, spotsC ...@@ -706,6 +707,10 @@ function twin_vars = forward_simulate_twin(gr, gr_fwd_sim, gr_proj, conf, spotsC
'R_vector', twin_vars(ii_t).R_vector, 'center', gr.center); 'R_vector', twin_vars(ii_t).R_vector, 'center', gr.center);
twin = gtCalculateGrain(twin, parameters, 'ref_omind', gr.allblobs.omind); twin = gtCalculateGrain(twin, parameters, 'ref_omind', gr.allblobs.omind);
% Determining reflections that are shared with the twin and
% selected by the parent
refl_match = gt6DGetMatchingReflections(gr, twin, conf.twin_angular_toll_deg * 2);
twin.stat = gr.stat; twin.stat = gr.stat;
twin.stat.bbxsstd = twin.stat.bbxsstd * 0.1; twin.stat.bbxsstd = twin.stat.bbxsstd * 0.1;
twin.stat.bbysstd = twin.stat.bbysstd * 0.1; twin.stat.bbysstd = twin.stat.bbysstd * 0.1;
...@@ -737,9 +742,19 @@ function twin_vars = forward_simulate_twin(gr, gr_fwd_sim, gr_proj, conf, spotsC ...@@ -737,9 +742,19 @@ function twin_vars = forward_simulate_twin(gr, gr_fwd_sim, gr_proj, conf, spotsC
twin_proj(ii_d).stack = permute(cat(3, spots{:}), [1 3 2]); twin_proj(ii_d).stack = permute(cat(3, spots{:}), [1 3 2]);
end end
% We will auto-select the shared reflections with the parent
% that got also selcted there (if the same blob was used!)
parent_sel = false(size(gr.allblobs.omega));
parent_sel(gr_proj.ondet(gr_proj.included(gr_proj.selected))) = true;
parent_spots = zeros(size(gr.allblobs.omega));
parent_spots(gr_proj(ii_d).ondet(gr_proj(ii_d).included)) = gr_fwd_sim(ii_d).difspotID;
twin_proj(ii_d).ondet = twin_ondet; twin_proj(ii_d).ondet = twin_ondet;
twin_proj(ii_d).included = twin_incl; twin_proj(ii_d).included = twin_incl;
twin_proj(ii_d).selected = false(numel(twin_incl), 1); twin_proj(ii_d).selected = refl_match(twin_ondet(twin_incl))...
& parent_sel(twin_ondet(twin_incl)) ...
& (parent_spots(twin_ondet(twin_incl)) == twin_fwd_sim(ii_d).difspotID);
end end
twin_vars(ii_t).allblobs = twin.allblobs; twin_vars(ii_t).allblobs = twin.allblobs;
......
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