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

gtForwardSimulate_v2 : add 'save_grain' flag to save or not the grain_###.mat

                       default is 'true'

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

git-svn-id: https://svn.code.sf.net/p/dct/code/trunk@835 4c865b51-4357-4376-afb4-474e03ccb993
parent 9dd06300
No related branches found
No related tags found
No related merge requests found
...@@ -12,6 +12,7 @@ function out = gtForwardSimulate_v2(first, last, workingdirectory, phaseID, vara ...@@ -12,6 +12,7 @@ function out = gtForwardSimulate_v2(first, last, workingdirectory, phaseID, vara
% OPTIONAL INPUT (varargin): % OPTIONAL INPUT (varargin):
% bb_size = <int> size of search area ([] will use default projection size) % bb_size = <int> size of search area ([] will use default projection size)
% assemble_figure = <logical> collects all difspots and assembles them into a fullimage % assemble_figure = <logical> collects all difspots and assembles them into a fullimage
% save_grain = <logical> flag to save grain_###.mat {true}
% %
% OUTPUT: % OUTPUT:
% out = updated grain structure <struct> % out = updated grain structure <struct>
...@@ -60,6 +61,10 @@ else ...@@ -60,6 +61,10 @@ else
fsim = gtFsimDefaultParameters(); fsim = gtFsimDefaultParameters();
end end
if ~isfield(fsim, 'save_grain')
fsim.save_grain = true;
end
if ~exist('phaseID','var') || isempty(phaseID) if ~exist('phaseID','var') || isempty(phaseID)
phaseID = 1; phaseID = 1;
end end
...@@ -492,9 +497,11 @@ for n = first : last ...@@ -492,9 +497,11 @@ for n = first : last
end end
filename = fullfile(acq.dir, '4_grains', sprintf('phase_%02d',phaseID), ... if fsim.save_grain
sprintf('grain_%04d.mat', gr.id)); filename = fullfile(acq.dir, '4_grains', phaseID_str, ...
save(filename, '-struct', 'out'); sprintf('grain_%04d.mat', gr.id));
save(filename, '-struct', 'out');
end
spot2grain(spotid(included)) = {n}; spot2grain(spotid(included)) = {n};
spot2phase(spotid(included)) = {phaseID}; spot2phase(spotid(included)) = {phaseID};
......
...@@ -14,5 +14,6 @@ fsim.use_th = true; % use theoretically predicted diffraction angl ...@@ -14,5 +14,6 @@ fsim.use_th = true; % use theoretically predicted diffraction angl
fsim.verbose = false; % tell which search criteria has failed fsim.verbose = false; % tell which search criteria has failed
fsim.selected = 4; % Spots preselected for reconstruction have flag >= 5 fsim.selected = 4; % Spots preselected for reconstruction have flag >= 5
fsim.included = 4; % Spots included into projection stack (can be selected manually) fsim.included = 4; % Spots included into projection stack (can be selected manually)
fsim.save_grain = true; % flag to save grain_####.mat files
end end
...@@ -8,6 +8,9 @@ function list = build_list_v2() ...@@ -8,6 +8,9 @@ function list = build_list_v2()
% OUTPUT: % OUTPUT:
% list = structure with each field <cell> (N,3) % list = structure with each field <cell> (N,3)
% %
% Version 005 04-10-2012 by LNervo
% Add 'fsim.save_grain'
%
% Version 004 12-06-2012 by LNervo % Version 004 12-06-2012 by LNervo
% Add forth column for user flag: 0:not display, 1:basic, 2:expert % Add forth column for user flag: 0:not display, 1:basic, 2:expert
% %
...@@ -711,6 +714,9 @@ list.fsim{13,1} = 'included'; list.fsim{13,2} = 'Difspo ...@@ -711,6 +714,9 @@ list.fsim{13,1} = 'included'; list.fsim{13,2} = 'Difspo
list.fsim{14,1} = 'selected'; list.fsim{14,2} = 'Difspots with flag >= selected be used for reconstruction'; list.fsim{14,1} = 'selected'; list.fsim{14,2} = 'Difspots with flag >= selected be used for reconstruction';
list.fsim{14,3} = 'double'; % scalar list.fsim{14,3} = 'double'; % scalar
list.fsim{14,4} = 2; list.fsim{14,4} = 2;
list.fsim{15,1} = 'save_grain'; list.fsim{15,2} = 'Flag to save grain_####.mat files';
list.fsim{15,3} = 'logical';
list.fsim{15,4} = 2;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
......
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