Skip to content
Snippets Groups Projects
Commit d2ba9104 authored by Laura Nervo's avatar Laura Nervo Committed by Nicola Vigano
Browse files

Conflicts : fix automatic solving for conflicts, add some more checks during conflicts detection


Signed-off-by: default avatarLaura Nervo <laura.nervo@esrf.fr>

git-svn-id: https://svn.code.sf.net/p/dct/code/trunk@818 4c865b51-4357-4376-afb4-474e03ccb993
parent 6c9e967f
No related branches found
No related tags found
No related merge requests found
function grains_merge = gtAnalyseGrainsConflicts(analyse_flag, update_flag, solve_flag, minnum, maxnum, log_flag, save_flag) function grains_merge = gtAnalyseGrainsConflicts(analyse_flag, update_flag, solve_flag, log_flag, save_flag, minnum, maxnum)
% GTANALYSEGRAINSCONFLICTS Try to find a criteria to merge grains with % GTANALYSEGRAINSCONFLICTS Try to find a criteria to merge grains with
% difspots in conflict (claimed by more than one grain) % difspots in conflict (claimed by more than one grain)
% grains_merge = gtAnalyseGrainsConflicts(analyse_flag, update_flag, solve_flag, minnum, maxnum, log_flag, save_flag) % grains_merge = gtAnalyseGrainsConflicts(analyse_flag, update_flag, solve_flag, log_flag, save_flag, minnum, maxnum)
% ------------------------------------------------------------------------------------------------------------------- % -------------------------------------------------------------------------------------------------------------------
% %
% Reads ./parameters.mat % Reads ./parameters.mat
...@@ -28,14 +28,14 @@ function grains_merge = gtAnalyseGrainsConflicts(analyse_flag, update_flag, solv ...@@ -28,14 +28,14 @@ function grains_merge = gtAnalyseGrainsConflicts(analyse_flag, update_flag, solv
% update_flag = flag to update sample.mat using gtUpdateGrainsConflicts <logical> {true} % update_flag = flag to update sample.mat using gtUpdateGrainsConflicts <logical> {true}
% solve_flag = flag to solve automatically conflicts as in % solve_flag = flag to solve automatically conflicts as in
% gtSolveGrainsConflicts <logical> {true} % gtSolveGrainsConflicts <logical> {true}
% log_flag = flag to save output on logfile <logical> {true}
% save_flag = flag to save 'grains_merge.mat' and 'sample.mat' if update_flag = true
% <logical> {true}
% minnum = minimum number of allowed difspots in conflict for a % minnum = minimum number of allowed difspots in conflict for a
% grain to be discarded (those difspots are deselected from that % grain to be discarded (those difspots are deselected from that
% grain) <double> {4} % grain) <double> {4}
% maxnum = maximum number of allowed difspots in conflict for a % maxnum = maximum number of allowed difspots in conflict for a
% grain to be consedered as candidate-twin <double> {10} % grain to be consedered as candidate-twin <double> {10}
% log_flag = flag to save output on logfile <logical> {true}
% save_flag = flag to save 'grains_merge.mat' and 'sample.mat' if update_flag = true
% <logical> {true}
% %
% OUTPUT: % OUTPUT:
% grains_merge = output for each phase containing info on grains in % grains_merge = output for each phase containing info on grains in
...@@ -63,8 +63,11 @@ function grains_merge = gtAnalyseGrainsConflicts(analyse_flag, update_flag, solv ...@@ -63,8 +63,11 @@ function grains_merge = gtAnalyseGrainsConflicts(analyse_flag, update_flag, solv
% .hasConflicts(grainid) = boolean to say if grainid has conflicts <logical numgrainx1> % .hasConflicts(grainid) = boolean to say if grainid has conflicts <logical numgrainx1>
% .nofConflicts(grainid) = number of conflicts <int numgrainx1> % .nofConflicts(grainid) = number of conflicts <int numgrainx1>
% %
% Log file is saved as: % Log file is saved as:
% 4_grains/conflicts_DD-MMM-YYYY_N.log (if log_flag=1) % 4_grains/archive/grains_merge_DD-MMM-YYYY_N.log (if log_flag = true)
%
%
% Version 004 25-09-2012 by LNervo
if ~exist('analyse_flag','var') || isempty(analyse_flag) if ~exist('analyse_flag','var') || isempty(analyse_flag)
...@@ -76,18 +79,18 @@ end ...@@ -76,18 +79,18 @@ end
if ~exist('solve_flag','var') || isempty(solve_flag) if ~exist('solve_flag','var') || isempty(solve_flag)
solve_flag = true; solve_flag = true;
end end
if ~exist('minnum','var') || isempty(minnum)
minnum = 4;
end
if ~exist('maxnum','var') || isempty(maxnum)
maxnum = 10;
end
if ~exist('log_flag','var') || isempty(log_flag) if ~exist('log_flag','var') || isempty(log_flag)
log_flag = true; log_flag = true;
end end
if ~exist('save_flag','var') || isempty(save_flag) if ~exist('save_flag','var') || isempty(save_flag)
save_flag = true; save_flag = true;
end end
if ~exist('minnum','var') || isempty(minnum)
minnum = 4;
end
if ~exist('maxnum','var') || isempty(maxnum)
maxnum = 10;
end
% Start time % Start time
tStart = tic; tStart = tic;
...@@ -255,9 +258,6 @@ end ...@@ -255,9 +258,6 @@ end
if solve_flag if solve_flag
sample = gtSolveGrainsConflicts(minnum, save_flag); sample = gtSolveGrainsConflicts(minnum, save_flag);
% run again the current function plus gtUpdateGrainsConflicts to
% update sample.mat
grains_merge = gtAnalyseGrainsConflicts(true, true, false, minnum, maxnum, log_flag, save_flag);
end end
......
This diff is collapsed.
function [allvalues, ids] = gtGetSinglesValues(cellArray, selected)
allvalues = [];
ids = [];
count = 0;
if ~isempty(selected)
cellArray = arrayfun(@(num) cellArray{num}, selected, 'UniformOutput', false);
else
selected = 1:length(cellArray);
end
for i = 1 : length(cellArray)
array = cellArray{i};
if ~isempty(array)
for j = 1 : length(array)
current = array(j);
if isempty(current)
count = count + 1;
else
ids = [ids; selected(i)];
allvalues = [allvalues; current];
end
end
end
end
end
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