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

Enabling of multi-detector / multi-mode for single-grain real-data reconstructions

parent 79f69d8e
No related branches found
No related tags found
No related merge requests found
......@@ -23,6 +23,10 @@ function rec_opts = gtReconstruct6DGetParamenters(parameters)
rec_opts.num_iter = num_iter;
rec_opts.algorithm = rec.grains.algorithm;
% We impose "det_ind = 1" here for the moment!!!
% It might be added later to the default options
rec_opts.det_ind = 1;
if (~isfield(rec_opts, 'volume_downscaling') ...
|| isempty(rec_opts.volume_downscaling))
rec_opts.volume_downscaling = def_opts.volume_downscaling;
......
......@@ -7,6 +7,7 @@ function varargout = gtReconstructGrainOrientation(grain_id, phase_id, parameter
end
conf = struct( ...
'det_ind', [], ...
'ospace_resolution', [], ...
'ospace_lims', [], ...
'extra_output', false, ...
......@@ -18,6 +19,9 @@ function varargout = gtReconstructGrainOrientation(grain_id, phase_id, parameter
if (~isempty(conf.ospace_resolution))
rec_opts.ospace_resolution = conf.ospace_resolution;
end
if (~isempty(conf.det_ind))
rec_opts.det_ind = conf.det_ind;
end
sample = GtSample.loadFromFile();
is_extended = sample.phases{phase_id}.getUseExtended(grain_id);
......@@ -26,6 +30,7 @@ function varargout = gtReconstructGrainOrientation(grain_id, phase_id, parameter
c = tic();
gr = gtLoadGrain(phase_id, grain_id, 'is_extended', is_extended);
% Dealing with legacy grain strctures.. should we keep this??
if (~isfield(gr.proj, 'bl'))
gr_extra = gtLoadGrain(phase_id, gr.id, 'fields', {'bl'});
gr.proj.bl = gr_extra.bl;
......@@ -47,20 +52,28 @@ function varargout = gtReconstructGrainOrientation(grain_id, phase_id, parameter
ospace_bb = [gr.R_vector + diff_r_vecs(1:3); gr.R_vector + diff_r_vecs(4:6)];
end
sampler = GtOrientationSampling(parameters, gr);
if (exist('ospace_bb', 'var') && ~isempty(ospace_bb))
sampler.make_grid_resolution(rec_opts.ospace_resolution, ...
rec_opts.max_grid_edge_points, ospace_bb');
else
sampler.make_grid_resolution(rec_opts.ospace_resolution, ...
rec_opts.max_grid_edge_points, [], ...
'oversize', rec_opts.ospace_oversize);
end
if (rec_opts.ospace_super_sampling > 1)
sampler.make_supersampling_simple_grid([1 2 3], rec_opts.ospace_super_sampling);
% Sampling the orientation space for the first detector index, and then
% creating the basic projection geometry for every other detector index
sampler = GtOrientationSampling(parameters, gr, 'detector_index', rec_opts.det_ind(1));
for ii_d = 1:numel(det_index)
if (exist('ospace_bb', 'var') && ~isempty(ospace_bb))
sampler.make_grid_resolution(rec_opts.ospace_resolution, ...
rec_opts.max_grid_edge_points, ospace_bb', ...
'det_ind', rec_opts.det_ind(ii_d) );
else
sampler.make_grid_resolution(rec_opts.ospace_resolution, ...
rec_opts.max_grid_edge_points, [], ...
'oversize', rec_opts.ospace_oversize, ...
'det_ind', rec_opts.det_ind(ii_d) );
end
if (rec_opts.ospace_super_sampling > 1)
sampler.make_supersampling_simple_grid([1 2 3], ...
rec_opts.ospace_super_sampling, 'det_ind', rec_opts.det_ind(ii_d));
end
end
algo = gtReconstruct6DLaunchAlgorithm(sampler, rec_opts, parameters);
algo = gtReconstruct6DLaunchAlgorithm(sampler, rec_opts, ...
parameters, 'det_index', rec_opts.det_ind);
vols = algo.getCurrentSolution();
......@@ -85,7 +98,7 @@ function varargout = gtReconstructGrainOrientation(grain_id, phase_id, parameter
end
vol_size = size(avg_R_vecs_int);
shift = gtFwdSimComputeVolumeShifts(gr.proj, parameters, vol_size);
shift = gtFwdSimComputeVolumeShifts(gr.proj, parameters, vol_size, rec_opts.det_ind(1));
ODF6D = gtReconstructDataStructureDefinition('VOL6D');
ODF6D.options = rec_opts;
......
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