Skip to content
Snippets Groups Projects
Commit 3e0a59dd authored by Wolfgang Ludwig's avatar Wolfgang Ludwig
Browse files

small fixes

parent f51aa936
No related branches found
No related tags found
No related merge requests found
function grain_det = gtLoadGrainRec(phase_id, grain_id, varargin)
conf = struct('fields', {{}}, 'parameters', {[]}, 'is_extended', {false});
conf = struct('fields', {{}}, 'parameters', {[]}, 'is_extended', {false}, 'full_details', {false});
conf = parse_pv_pairs(conf, varargin);
if (isempty(conf.parameters))
......@@ -11,6 +11,8 @@ function grain_det = gtLoadGrainRec(phase_id, grain_id, varargin)
for ii = numel(grain_id):-1:1
if (conf.is_extended)
grain_file = fullfile(phase_dir, sprintf('grain_extended_details_%04d.mat', grain_id(ii)));
elseif (conf.full_details)
grain_file = fullfile(phase_dir, sprintf('grain_full_details_%04d.mat', grain_id(ii)));
else
grain_file = fullfile(phase_dir, sprintf('grain_details_%04d.mat', grain_id(ii)));
end
......
......@@ -1306,7 +1306,7 @@ classdef GtAssembleVol3D < handle
if (~exist('sortOrder', 'var'))
sortOrder = 'descend';
end
sample=GtSample.loadFromFile;
grainsize = zeros(grainsNum, 1);
gauge = GtGauge(grainsNum, sprintf('Loading grains from phase %02d: ', phase_id));
for ii = 1:grainsNum
......@@ -1317,7 +1317,7 @@ classdef GtAssembleVol3D < handle
else
vol = obj.localPar.cache.get('grain_rec', {phase_id, grain_ids(ii)}, 'SEG');
end
grainsize(ii) = length(find(vol(:)));
grainsize(ii) = length(find(vol.seg(:)));
catch
% We ignore the error because it will come up again
% later
......
......@@ -55,7 +55,7 @@ proj = astra_mex_data3d('get', proj_id);
if (exist('psf','var') && ~isempty(psf))
psf_obj = GtPSF();
psf_obj.set_psf_direct(proj.psf, [hsize, vsize]);
psf_obj.set_psf_direct(psf, [hsize, vsize]);
proj = psf_obj.apply_psf_direct(proj);
end
......
......@@ -8,7 +8,8 @@ function varargout = gtReconstructGrainOrientation(grain_id, phase_id, parameter
conf = struct( ...
'ospace_resolution', [], ...
'ospace_lims', [] );
'ospace_lims', [], ...
'extra_output', false );
[conf, ~] = parse_pv_pairs(conf, varargin);
rec_opts = gtReconstruct6DGetParamenters(parameters);
......@@ -117,7 +118,7 @@ function varargout = gtReconstructGrainOrientation(grain_id, phase_id, parameter
varargout{1} = ODF6D;
end
if (algo.verbose)
if (conf.extra_output)
[proj_blobs, proj_spots] = algo.getProjectionOfCurrentSolution();
% Restoring initial volume size (depending on the rounding)
......
......@@ -175,9 +175,16 @@ if (~isempty(conf.grain_ids))
check = inputwdefault('Launch grain segmentation via OAR? [y/n]', 'y');
if (strcmpi(check, 'y'))
launch_on_OAR('gtChangeThreshold3D', first, last, ...
phaseID_str, parameters, 'core', 4, 'distribute', false);
phaseID_str, parameters, 'core', 4, 'distribute', true, 'list', conf.grain_ids);
else
gtChangeThreshold3D(first, last, [], phase_id);
if isempty(conf.grain_ids)
gtChangeThreshold3D(first, last, [], phase_id);
else
t=GtThreshold();
for i = 1 : numel(conf.grain_ids)
t.singleGrainAutoThreshold(phase_id, conf.grain_ids(i));
end
end
end
end
end
......
......@@ -41,9 +41,13 @@ par.sort = '';
par.latticepar = [];
par.convention = 'X';
par.constrain_to_sst = false;
par.grain = [];
[par, rej_pars] = parse_pv_pairs(par, varargin);
if isempty(symm)
p=gtLoadParameters;
symm = p.cryst.symm;
end
Symm = {symm.g3};
switch par.input
......@@ -59,6 +63,13 @@ switch par.input
Ngrain1 = size(ori1, 2);
Ngrain2 = size(ori2, 2);
oriConversion = @(x) gtMathsEuler2OriMat(x);
case 'gr_id'
Ngrain1 = size(ori1, 1);
Ngrain2 = size(ori2, 1);
if isempty(par.grain)
load 4_grains/phase_01/index
end
oriConversion = @(x) gtMathsRod2OriMat(par.grain{x}.R_vector');
otherwise
gtError('gtDisorientation:wrong_input_type', ...
'Allowed orientation types are ''rod'', ''orimat'', or ''euler''!');
......
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