doHClustering
(method of orientation)
sort orientations into clusters
Syntax
[c,center] = doHCluster(ori,'numCluster',n) [c,center] = doHCluster(ori,'maxAngle',omega)
Input
ori | |
n |
number of clusters |
omega |
maximum angle |
Output
c |
list of clusters |
center |
center of the clusters |
Example
% generate orientation clustered around 5 centers cs = crystalSymmetry('m-3m'); center = orientation.rand(5,cs); odf = unimodalODF(center,'halfwidth',5*degree) ori = odf.calcOrientations(3000);
odf = ODF crystal symmetry : m-3m specimen symmetry: 1 Radially symmetric portion: kernel: de la Vallee Poussin, halfwidth 5° center: Rotations: 5x1 weight: 1
% find the clusters and its centers tic; [c,centerRec] = calcCluster(ori,'method','hierarchical','numCluster',5); toc
progress: 100% Elapsed time is 7.576575 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,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 = 0.3082 0.2553 0.2117 0.2499 0.2394
odfRec = calcODF(ori) [~,centerRec2] = max(odfRec,5) min(angle_outer(center,centerRec2)./degree)
odfRec = ODF crystal symmetry : m-3m specimen symmetry: 1 Harmonic portion: degree: 29 weight: 1 centerRec2 = orientation size: 1 x 5 crystal symmetry : m-3m specimen symmetry: 1 Bunge Euler angles in degree phi1 Phi phi2 Inv. 18.0712 44.2584 351.518 0 147.765 49.4208 205.271 0 57.3816 38.0231 307.022 0 178.847 40.7247 153.699 0 76.622 37.0178 291.043 0 ans = 2.1474 0.3340 0.3677 0.2248 11.6199
MTEX 5.0.3 |