diff --git a/5_reconstruction/gtReconstructGrainExtended.m b/5_reconstruction/gtReconstructGrainExtended.m index 19ab80c4ebe840d44c2b1ed00f15035dc093013c..a7a9f9c74c8513d23052ed34858b369e4b6fb509 100644 --- a/5_reconstruction/gtReconstructGrainExtended.m +++ b/5_reconstruction/gtReconstructGrainExtended.m @@ -16,6 +16,8 @@ function gtReconstructGrainExtended(grain_id, phase_id, parameters, varargin) rec_opts.use_predicted_scatter_ints = true; end + fprintf('Loading the grain file..') + c = tic(); phase_dir = fullfile(parameters.acq.dir, '4_grains', ... sprintf('phase_%02d', phase_id)); grain_extended_file = fullfile(phase_dir, ... @@ -34,6 +36,7 @@ function gtReconstructGrainExtended(grain_id, phase_id, parameters, varargin) bb_ors = gr.bb_ors; end bb_gvdm = cat(1, bb_ors(:).R_vector)'; + fprintf('\b\b: Done in %g seconds.\n', toc(c)) sampler = GtOrientationSampling(parameters, gr); sampler.make_simple_grid('cubic', rec_opts.grid_edge, bb_gvdm, 1); @@ -45,6 +48,8 @@ function gtReconstructGrainExtended(grain_id, phase_id, parameters, varargin) vols = algo.getCurrentSolution(); + fprintf('Producing output data-structure..') + c = tic(); [avg_R_vecs, avg_R_vecs_int, stddev_R_vecs] = sampler.getAverageOrientations(vols); avg_R_vec = sampler.getAverageOrientation(vols); s_g_odf = reshape(sampler.getODF(vols), rec_opts.grid_edge([1 1 1])); @@ -74,10 +79,13 @@ function gtReconstructGrainExtended(grain_id, phase_id, parameters, varargin) 'single_grain_avg_R_vector', {avg_R_vec}, ... 'kernel_average_misorientation', {kam}, ... 'intra_granular_misorientation', {igm} ); + fprintf('\b\b: Done in %g seconds.\n', toc(c)) grain_details_file = fullfile(phase_dir, ... sprintf('grain_extended_details_%04d.mat', grain_id)); + fprintf('Saving the reconstruction file..') + c = tic(); % Saving and cleaning at the same time if (exist(grain_details_file, 'file')) gr_det = load(grain_details_file); @@ -86,6 +94,7 @@ function gtReconstructGrainExtended(grain_id, phase_id, parameters, varargin) gr_det = struct('ODF6D', ODF6D); %#ok<NASGU> end save(grain_details_file, '-struct', 'gr_det', '-v7.3'); + fprintf('\b\b: Done in %g seconds.\n', toc(c)) if (algo.verbose) [proj_blobs, proj_spots] = algo.getProjectionOfCurrentSolution(); diff --git a/5_reconstruction/gtReconstructGrainOrientation.m b/5_reconstruction/gtReconstructGrainOrientation.m index c9ee5d625d94caa5999b356a29165dd53ff332ea..42c43bc35e9ff0087e4f8cf9e49ce295fe300a87 100644 --- a/5_reconstruction/gtReconstructGrainOrientation.m +++ b/5_reconstruction/gtReconstructGrainOrientation.m @@ -6,6 +6,8 @@ function gtReconstructGrainOrientation(grainID, phaseID, parameters, rel_ospace_ parameters = gtLoadParameters(); end + fprintf('Loading the grain file..') + c = tic(); fields_to_load = {'R_vector', 'id', 'phaseid', 'allblobs', 'proj', 'center' }; gr = gtLoadGrain(phaseID, grainID, 'fields', fields_to_load); @@ -20,6 +22,7 @@ function gtReconstructGrainOrientation(grainID, phaseID, parameters, rel_ospace_ gr.proj.included = gr_extra.included; gr.proj.selected = gr_extra.selected; end + fprintf('\b\b: Done in %g seconds.\n', toc(c)) rec_opts = gtReconstruct6DGetParamenters(parameters); @@ -41,6 +44,8 @@ function gtReconstructGrainOrientation(grainID, phaseID, parameters, rel_ospace_ or_sizes = sampler.get_orientation_sampling_size(); + fprintf('Producing output data-structure..') + c = tic(); [avg_R_vecs, avg_R_vecs_int, stddev_R_vecs] = sampler.getAverageOrientations(vols); avg_R_vec = sampler.getAverageOrientation(vols); s_g_odf = reshape(sampler.getODF(vols), or_sizes{1}); @@ -70,10 +75,13 @@ function gtReconstructGrainOrientation(grainID, phaseID, parameters, rel_ospace_ 'single_grain_avg_R_vector', {avg_R_vec}, ... 'kernel_average_misorientation', {kam}, ... 'intra_granular_misorientation', {igm} ); + fprintf('\b\b: Done in %g seconds.\n', toc(c)) grain_dir = fullfile(parameters.acq.dir, '4_grains', sprintf('phase_%02d', phaseID)); grain_details_file = fullfile(grain_dir, sprintf('grain_details_%04d.mat', grainID)); + fprintf('Saving the reconstruction file..') + c = tic(); % Saving and cleaning at the same time if (exist(grain_details_file, 'file')) gr_det = load(grain_details_file); @@ -82,6 +90,7 @@ function gtReconstructGrainOrientation(grainID, phaseID, parameters, rel_ospace_ gr_det = struct('ODF6D', ODF6D); %#ok<NASGU> end save(grain_details_file, '-struct', 'gr_det', '-v7.3'); + fprintf('\b\b: Done in %g seconds.\n', toc(c)) if (algo.verbose) [proj_blobs, proj_spots] = algo.getProjectionOfCurrentSolution(); diff --git a/5_reconstruction/gtReconstructGrainTwinCluster.m b/5_reconstruction/gtReconstructGrainTwinCluster.m index 72747aee40758c537c9445e19369e4e6b3afe81a..f09f6672f3809f2df1f0d873c98b0beef84fcb23 100644 --- a/5_reconstruction/gtReconstructGrainTwinCluster.m +++ b/5_reconstruction/gtReconstructGrainTwinCluster.m @@ -33,9 +33,10 @@ function gtReconstructGrainTwinCluster(grain_ids, phase_id, parameters, varargin sprintf('grain_cluster%s.mat', grains_str_ids)); fprintf('Loading the cluster file..') + c = tic(); grs = load(grain_cluster_file); grs = grs.samp_ors; - fprintf('\b\b: Done.\n') + fprintf('\b\b: Done in %g seconds.\n', toc(c)) end num_grains = numel(grs); @@ -76,7 +77,11 @@ function gtReconstructGrainTwinCluster(grain_ids, phase_id, parameters, varargin ranges(1:end-1, 2) = ranges(2:end, 1) - 1; ranges(end, 2) = numel(vols); + fprintf('Producing output data-structures: ') + c = tic(); for ii_g = num_grains:-1:1 + num_chars = fprintf('%03d/%03d', num_grains-ii_g+1, num_grains); + or_sizes = sampler(ii_g).get_orientation_sampling_size(); gr_vols = vols(ranges(ii_g, 1):ranges(ii_g, 2)); @@ -109,8 +114,13 @@ function gtReconstructGrainTwinCluster(grain_ids, phase_id, parameters, varargin 'single_grain_avg_R_vector', {avg_R_vec}, ... 'kernel_average_misorientation', {kam}, ... 'intra_granular_misorientation', {igm} ); + + fprintf(repmat('\b', [1, num_chars])); end + fprintf('Done in %g seconds.\n', toc(c)) + fprintf('Saving the cluster reconstruction file..') + c = tic(); cluster_rec_file = fullfile(phase_dir, ... sprintf('grain_cluster_details%s.mat', grains_str_ids)); % Saving and cleaning at the same time @@ -121,6 +131,7 @@ function gtReconstructGrainTwinCluster(grain_ids, phase_id, parameters, varargin cl_rec = struct('ODF6D', ODF6D); %#ok<NASGU> end save(cluster_rec_file, '-struct', 'cl_rec', '-v7.3'); + fprintf('\b\b: Done in %g seconds.\n', toc(c)) if (algo.verbose) clear('ODF6D')