diff --git a/4_grains/gtGrainImportTopotomoScan.m b/4_grains/gtGrainImportTopotomoScan.m index 5a48814c9a5adf023fbebdf0610c0f36ccdeb5c3..97ff14a748de8dffddef350c2332bd4da5903b52 100644 --- a/4_grains/gtGrainImportTopotomoScan.m +++ b/4_grains/gtGrainImportTopotomoScan.m @@ -64,7 +64,7 @@ function gr = gtGrainImportTopotomoScan(gr, p, det_ind, data_type) lims_bt = p.acq(det_ind).range_basetilt; within_lims = gr.allblobs(det_ind).phi > lims_bt(1) & gr.allblobs(det_ind).phi < lims_bt(2); phinds = gr.allblobs(det_ind).phind(within_lims); - phinds_counts = histcounts(phinds, (1:5)-0.5); + phinds_counts = histc(phinds, (1:5)-0.5); [~, phind] = max(phinds_counts); selectedph = gr.allblobs(det_ind).phind == phind; diff --git a/4_grains/gtLoadClusterRec.m b/4_grains/gtLoadClusterRec.m index ffd9c01569bfba19fe8aeb098bf96d4b8c2f26c8..5998795ffe18ddd210896ff209fdfd54309139c0 100644 --- a/4_grains/gtLoadClusterRec.m +++ b/4_grains/gtLoadClusterRec.m @@ -11,7 +11,9 @@ function cluster_rec = gtLoadClusterRec(phase_id, grain_ids, varargin) % fields = <string> only load specific fields from % cluster structure ('ODF6D', 'SEG') % parameters = <struct> for security (make sure to load from right directory) -% +% display = <logical> if true, it automatically opens GtVolView +% and displays the reconstructed intensity +% for each of the grain_ids as well as the summed intensity conf = struct('fields', {{}}, 'parameters', {[]}, 'display', false); conf = parse_pv_pairs(conf, varargin); diff --git a/zUtil_DataStructures/GtPhase.m b/zUtil_DataStructures/GtPhase.m index 6bc3924e2b50245cea803478d3931db12e07c201..ff6c221da5c68cbedec9ae8f81a8cba888299fc5 100644 --- a/zUtil_DataStructures/GtPhase.m +++ b/zUtil_DataStructures/GtPhase.m @@ -116,6 +116,22 @@ classdef GtPhase < handle copy.clusters = obj.clusters; end + function fillGrain(obj, grain) + gr_id = grain.id; + obj.selectedGrains(gr_id) = true; + obj.completeness(gr_id) = 0; + obj.center(gr_id, :) = grain.center; + obj.R_vector(gr_id, :) = grain.R_vector; + if ~isfield(grain, 'boundingBox') + grain.boundingBox = zeros(1, 6); + grain.bboxExtremes = zeros(1, 6); + end + obj.boundingBox(gr_id, :) = grain.boundingBox; + obj.bboxExtremes(gr_id, :) = grain.bboxExtremes; + obj.use_extended(gr_id) = false; + obj.extended_params(gr_id) = GtPhase.makeExtendedField([], []); + end + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Setter Functions