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.385349 seconds.
% visualize result
oR = fundamentalRegion(cs)
plot(oR)
oR = orientationRegion crystal symmetry: 432 face normales: 1 x 14 vertices: 1 x 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 = 8.5929 6.8454 0.2523 0.2757 0.7611
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: 28 weight: 1 centerRec2 = orientation size: 1 x 5 crystal symmetry : m-3m specimen symmetry: 1 Bunge Euler angles in degree phi1 Phi phi2 Inv. 181.913 24.5649 185.596 0 220.919 50.3314 126.379 0 38.7622 27.6041 352.057 0 65.6916 19.8727 327.649 0 58.2287 13.4691 332.467 0 ans = 6.2357 4.9092 0.1495 13.1442 15.5757
MTEX 4.5.2 |