doHClustering

(method of orientation)

sort orientations into clusters

Syntax

[c,center] = doHCluster(ori,'numCluster',n)
[c,center] = doHCluster(ori,'maxAngle',omega)

Input

ori

orientation

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
Elapsed time is 8.238126 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 =
    0.5085    0.3337    0.1550    0.2295    0.5120
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.
  266.642 7.89342 96.8518       0
  285.083 26.6036 40.6344       0
  167.746  29.411 162.114       0
  257.985 21.1798  123.46       0
  241.044 51.5182 145.292       0
 
 
ans =
    0.9014    0.1792    0.2107    0.6782    0.4447