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

Fixed incoming beam intensity computation

parent 5649f61e
No related branches found
No related tags found
No related merge requests found
function [gr, refs] = gtComputeIncomingBeamIntensity(gr, parameters, refs) function [gr, refs] = gtComputeIncomingBeamIntensity(gr, parameters, refs)
% FUNCTION [gr, refs] = gtComputeIncomingBeamIntensity(gr, parameters, refs) % FUNCTION [gr, refs] = gtComputeIncomingBeamIntensity(gr, parameters, refs)
if (parameters.acq.interlaced_turns > 0)
error('gtComputeIncomingBeamIntensity:wrong_conf', ...
'Interlaced turns not supported, yet!')
end
omega_step = 180 / parameters.acq.nproj;
if (isfield(gr.proj, 'ondet')) if (isfield(gr.proj, 'ondet'))
gr_included = gr.proj.ondet(gr.proj.included); gr_included = gr.proj.ondet(gr.proj.included);
else else
gr_included = gr.ondet(gr.included); gr_included = gr.ondet(gr.included);
end end
omega_step = gtGetOmegaStepDeg(parameters);
omegas = gr.allblobs.omega(gr_included); omegas = gr.allblobs.omega(gr_included);
gc_det_pos = gtGeoGrainCenterSam2Det(gr.center, omegas, parameters); gc_det_pos = gtGeoGrainCenterSam2Det(gr.center, omegas, parameters);
rounded_gc_det = round(gc_det_pos); rounded_gc_det = round(gc_det_pos);
img_nums = omegas / omega_step; img_nums = omegas / omega_step;
min_ws = floor(img_nums / parameters.acq.refon)+1; if (parameters.acq.interlaced_turns > 0)
max_ws = min_ws + 1; error('gtComputeIncomingBeamIntensity:wrong_conf', ...
'Interlaced turns not supported, yet!')
% TO BE FINISHED
min_ws = floor(img_nums);
max_ws = min_ws + 1;
min_cs = max_ws - img_nums;
max_cs = 1 - min_cs;
min_cs = (max_ws - (img_nums / parameters.acq.refon) -1); min_min_ref_ws = floor(min_ws / parameters.acq.refon) + 1;
max_cs = 1 - min_cs; min_max_ref_ws = floor(max_ws / parameters.acq.refon) + 1;
max_min_ref_ws = min_min_ref_ws + 1;
max_max_ref_ws = min_max_ref_ws + 1;
else
min_ref_ws = floor(img_nums / parameters.acq.refon) + 1;
max_ref_ws = min_ref_ws + 1;
min_cs = (max_ref_ws - (img_nums / parameters.acq.refon) - 1);
max_cs = 1 - min_cs;
end
if (~exist('refs', 'var')) if (~exist('refs', 'var'))
refs = load_reference_imgs(parameters); refs = load_reference_imgs(parameters);
end end
max_selection = max_cs > 1e-4; max_selection = max_cs > 1e-4;
min_indx = sub2ind(size(refs), rounded_gc_det(:, 2), rounded_gc_det(:, 1), min_ws); min_indx = sub2ind(size(refs), rounded_gc_det(:, 2), rounded_gc_det(:, 1), min_ref_ws);
max_indx = sub2ind(size(refs), rounded_gc_det(max_selection, 2), rounded_gc_det(max_selection, 1), max_ws(max_selection)); max_indx = sub2ind(size(refs), rounded_gc_det(max_selection, 2), rounded_gc_det(max_selection, 1), max_ref_ws(max_selection));
min_vals = refs(min_indx) .* min_cs; min_vals = refs(min_indx) .* min_cs;
max_vals = refs(max_indx) .* max_cs(max_selection); max_vals = refs(max_indx) .* max_cs(max_selection);
......
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