calcCluster

(method of orientation)

sort orientations into clusters

Syntax

[c,center] = calcCluster(ori,'halfwidth',2.5*degree)
[c,center] = calcCluster(ori,'numCluster',n,'method','hierarchical')
[c,center] = calcCluster(ori,'maxAngle',omega,'method','hierarchical')

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('432');
center = orientation.rand(5,cs);
odf = unimodalODF(center,'halfwidth',5*degree)
ori = odf.calcOrientations(1500);
 
odf = ODF  
  crystal symmetry : 432
  specimen symmetry: 1
 
  Radially symmetric portion:
    kernel: de la Vallee Poussin, halfwidth 5°
    center: Rotations: 5x1
    weight: 1
 
% find the clusters and its centers
[cId,centerRec] = calcCluster(ori);
progress: 100%
progress: 100%
progress: 100%
progress: 100%
.........................
% visualize result
for i = 1:length(centerRec)
plot(ori(cId==i),'axisAngle')
hold on
plot(centerRec(i),'MarkerFaceColor','k','MarkerSize',15)
end
hold off
%check the accuracy of the recomputed centers
min(angle_outer(center,centerRec)./degree)
ans =
  Columns 1 through 7
    2.2925    0.5569    2.1927    0.5021    1.1876   14.2167   14.5368
  Columns 8 through 12
   17.9820   14.9843   17.1985   16.5587   16.1773