Skip to content
Snippets Groups Projects
Commit eb25ddf4 authored by Laura Nervo's avatar Laura Nervo
Browse files

Updated the use of the new version of gtModifyStructure to a general list of...

Updated the use of the new version of gtModifyStructure to a general list of options to be checked with user...
Only FED code is missing from this update...

Signed-off-by: default avatarLaura Nervo <laura.nervo@esrf.fr>
parent 87c422bd
No related branches found
No related tags found
No related merge requests found
...@@ -9,22 +9,14 @@ par.list = []; % if list is [], load all grains. ...@@ -9,22 +9,14 @@ par.list = []; % if list is [], load all grains.
par.display_error_messages = true; % show error messages par.display_error_messages = true; % show error messages
% check with user % check with user
list{1,1} = 'savefilename'; list = cell(0,4);
list{1,2} = 'filename to save volume (goes into 5_reconstruction/)'; list(end+1,:) = [{'savefilename'},{'filename to save volume (goes into 5_reconstruction/)'},{'char'},{1}];
list(end+1,:) = [{'overlaps'},{'how to treat overlapping grain labels ("zeros" or "summed")'},{'char'},{1}];
list{2,1} = 'overlaps'; list(end+1,:) = [{'add_to_filename'},{'to add grains to an existing reconstruction (filename, path/filename)'},{'char'},{1}];
list{2,2} = 'how to treat overlapping grain labels ("zeros" or "summed")'; list(end+1,:) = [{'list'},{'list of grains to add to volume, or empty if "all" grains'},{'double'},{1}];
list(end+1,:) = [{'display_error_messages'},{'display error messages?'},{'logical'},{1}];
list{3,1} = 'add_to_filename';
list{3,2} = 'to add grains to an existing reconstruction (filename, path/filename)'; par = gtModifyStructure(par, list, [], 'Check with user:');
list{4,1} = 'list';
list{4,2} = 'list of grains to add to volume, or "all"';
list{5,1} = 'display_error_messages';
list{5,2} = 'display error messages?';
par = gtModifyStructure(par, list);
if ~exist('update_cb', 'var') if ~exist('update_cb', 'var')
[output, redo_list] = GtAssembleVol3D('savefilename', par.savefilename, ... [output, redo_list] = GtAssembleVol3D('savefilename', par.savefilename, ...
......
...@@ -43,44 +43,32 @@ else ...@@ -43,44 +43,32 @@ else
% Work through the various INDEXTER parameters % Work through the various INDEXTER parameters
% Get parameters template oplist = cell(0,4);
list = build_list_v2; oplist(end+1,:) = [{'phase_ID'},{'Which phase should be indexed?'},{'double'},{1}];
oplist(end+1,:) = [{'input_file'},{'Use input file?'},{'logical'},{2}];
oplist(end+1,:) = [{'flag_update'},{'Update ''parameters.mat'', ''index.mat'', database with the results ?'},{'logical'},{3}];
oplist(end+1,:) = [{'flag_log'},{'Write log and output file with current date ?'},{'logical'},{3}];
oplist(end+1,:) = [{'forcemerge'},{'Run INDEXTER only merging grains as written in parameters.index.forcemerge'},{'logical'},{3}];
% Select phase to be indexed % Select phase to be indexed
options = [];
options.phase_ID = phase_id; options.phase_ID = phase_id;
header = 'INDEXTER OPTIONS'; options = gtModifyStructure(options, oplist, 1, 'INDEXTER options:');
% Input file name
fname = fullfile('4_grains',sprintf('phase_%02d',options.phase_ID),'index_input.mat');
oplist{1,1} = 'phase_ID';
oplist{1,2} = 'Which phase should be indexed?';
options = gtModifyStructure(options, oplist, header);
% Update and log % Update and log: check existence of file 'fname'
% TO DO: better handle the existence of input file?
options.input_file = exist(fname,'file') == 2;
options.flag_update = true; options.flag_update = true;
options.flag_log = true; options.flag_log = true;
options.forcemerge = false;
% Input file name if (options.input_file)
fname = sprintf('4_grains/phase_%02d/index_input.mat',options.phase_ID); options = gtModifyStructure(options, oplist, [2 3], 'An input file already exists:');
if exist(fname,'file')
header = 'An input file already exists.';
options.input_file = true;
oplist{1,1} = 'input_file';
oplist{1,2} = 'Use input file?';
oplist{2,1} = 'flag_update';
oplist{2,2} = 'Update ''parameters.mat'', ''index.mat'', database with the results ?';
oplist{3,1} = 'flag_log';
oplist{3,2} = 'Write log and output file with current date ?';
options = gtModifyStructure(options, oplist, header);
else else
oplist{1,1} = 'flag_update'; options = gtModifyStructure(options, oplist, 2, 'The input file does not exist:');
oplist{2,2} = 'Update ''parameters.mat'', ''index.mat'', database with the results ?';
oplist{2,1} = 'flag_log';
oplist{2,2} = 'Write log and output file with current date ?';
options = gtModifyStructure(options, oplist);
options.input_file = false;
end end
% Get parameters template % Get parameters template
...@@ -134,7 +122,7 @@ else ...@@ -134,7 +122,7 @@ else
check = inputwdefault('Start gtINDEXTER now? [y/n]', 'y'); check = inputwdefault('Start gtINDEXTER now? [y/n]', 'y');
if strcmpi(check, 'y') if strcmpi(check, 'y')
gtINDEXTER(options.phase_ID, options.flag_update, ... gtINDEXTER(options.phase_ID, options.flag_update, ...
options.input_file, options.flag_log, 0, parameters); options.input_file, options.flag_log, options.forcemerge, parameters);
end end
end % end of function end % end of function
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