sort orientations into clusters
[c,center] = doHCluster(ori,'numCluster',n) [c,center] = doHCluster(ori,'maxAngle',omega)
% generate orientation clustered around 5 centers cs = crystalSymmetry('m-3m'); center = orientation.rand(5,cs); odf = unimodalODF(center,'halfwidth',5*degree) ori = odf.discreteSample(3000);
odf = SO3FunRBF (m-3m → xyz) <strong>multimodal components</strong> kernel: de la Vallee Poussin, halfwidth 5° center: 5 orientations Bunge Euler angles in degree phi1 Phi phi2 weight 298.279 49.2231 261.782 0.2 238.443 83.297 322.852 0.2 101.962 52.0194 266.082 0.2 4.17865 32.4672 56.0855 0.2 137.51 165.176 6.79 0.2
% find the clusters and its centers tic; [c,centerRec] = calcCluster(ori,'method','hierarchical','numCluster',5); toc
Elapsed time is 4.201374 seconds.
% visualize result oR = fundamentalRegion(cs) plot(oR)
oR = orientationRegion crystal symmetry: 432 max angle: 62.7994° face normales: 14 vertices: 24
hold on plot(ori,ind2color(c)) caxis([1,5]) plot(center,'MarkerSize',10,'MarkerFaceColor','k','MarkerEdgeColor','k') plot(centerRec,'MarkerSize',10,'MarkerFaceColor','r','MarkerEdgeColor','k') hold off
plot 2000 random orientations out of 3000 given orientations
%check the accuracy of the recomputed centers min(angle_outer(center,centerRec)./degree)
ans = 9.8791 0.5406 8.0474 0.2602 0.4113