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 5.857564 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.2286 0.5504 0.2208 0.3167 0.4189
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 3 crystal symmetry : m-3m specimen symmetry: 1 Bunge Euler angles in degree phi1 Phi phi2 Inv. 52.538 42.1017 310.251 0 244.57 44.6516 114.389 0 102.551 42.484 263.348 0 ans = 3.9178 3.5089 2.3121
MTEX 5.0.0 |