Skip to content

Commit

Permalink
Merge pull request #129 from ralfHielscher/master
Browse files Browse the repository at this point in the history
MTEX 4.2.1
  • Loading branch information
ralfHielscher committed Nov 19, 2015
2 parents bd00be6 + 6195d16 commit 67659bc
Show file tree
Hide file tree
Showing 16 changed files with 82 additions and 82 deletions.
16 changes: 8 additions & 8 deletions EBSDAnalysis/@grain2d/grain2d.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
GOS % intragranular average misorientation angle
x % x coordinates of the vertices of the grains
y % y coordinates of the vertices of the grains
tripelPoints % tripel points
triplePoints % triple points
end

properties (Dependent = true, Access = protected)
Expand Down Expand Up @@ -122,9 +122,9 @@
function grains = set.V(grains,V)
grains.boundary.V = V;

% update V in tripel points
tP = grains.tripelPoints;
grains.tripelPoints.V = V(tP.id,:);
% update V in triple points
tP = grains.triplePoints;
grains.triplePoints.V = V(tP.id,:);
end

function idV = get.idV(grains)
Expand Down Expand Up @@ -157,12 +157,12 @@
unit = grains.boundary.scanUnit;
end

function tP = get.tripelPoints(grains)
tP = grains.boundary.tripelPoints;
function tP = get.triplePoints(grains)
tP = grains.boundary.triplePoints;
end

function grains = set.tripelPoints(grains,tP)
grains.boundary.tripelPoints = tP;
function grains = set.triplePoints(grains,tP)
grains.boundary.triplePoints = tP;
end

end
Expand Down
14 changes: 7 additions & 7 deletions EBSDAnalysis/@grainBoundary/grainBoundary.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
properties
V = [] % vertices x,y coordinates
scanUnit = 'um' % unit of the vertice coordinates
tripelPoints % tripel points
triplePoints % triple points
end

properties (Dependent = true)
Expand Down Expand Up @@ -83,26 +83,26 @@
inv(ebsd.rotations(gB.ebsdId(isNotBoundary,2))) ...
.* ebsd.rotations(gB.ebsdId(isNotBoundary,1));

% compute tripel points
% compute triple points
I_VF = gB.I_VF;
I_VG = (I_VF * gB.I_FG)==2;
% tripel points are those with exactly 3 neigbouring grains and 3
% triple points are those with exactly 3 neigbouring grains and 3
% boundary segments
itP = full(sum(I_VG,2)==3 & sum(I_VF,2)==3);
[tpGrainId,~] = find(I_VG(itP,:).');
tpGrainId = reshape(tpGrainId,3,[]).';
tpPhaseId = full(grainsPhaseId(tpGrainId));

% compute ebsdId
% first step: compute faces at the tripel point
% first step: compute faces at the triple point
% clean up incidence matrix
%I_FD(~any(I_FD,2),:) = [];
% incidence matrix between tripel points and voronoi cells
% incidence matrix between triple points and voronoi cells
%I_TD = I_VF(itP,:) * I_FD;
[tPBoundaryId,~] = find(I_VF(itP,:).');
tPBoundaryId = reshape(tPBoundaryId,3,[]).';

gB.tripelPoints = tripelPointList(find(itP),gB.V(itP,:),...
gB.triplePoints = triplePointList(find(itP),gB.V(itP,:),...
tpGrainId,tPBoundaryId,tpPhaseId,gB.phaseMap,gB.CSList);

end
Expand Down Expand Up @@ -173,7 +173,7 @@
A_F = I_VF.' * I_VF; %#ok<PROP>
end

%function tp = get.tripelPoints(gB)
%function tp = get.triplePoints(gB)

%end

Expand Down
6 changes: 3 additions & 3 deletions EBSDAnalysis/@grainBoundary/subSet.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
gB.phaseId = gB.phaseId(ind,:);
gB.misrotation = gB.misrotation(ind);

% restrict tripel points
tP = gB.tripelPoints;
gB.tripelPoints = subSet(tP,any(gB.I_VF(tP.id,:),2));
% restrict triple points
tP = gB.triplePoints;
gB.triplePoints = subSet(tP,any(gB.I_VF(tP.id,:),2));
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function display(tP,varargin)
% ---------------------------------

disp(' ');
h = doclink('tripelPointList_index','tripelPointList');
h = doclink('triplePointList_index','triplePointList');

if check_option(varargin,'vname')
h = [get_option(varargin,'vname'), ' = ' h];
Expand All @@ -19,39 +19,39 @@ function display(tP,varargin)

% empty grain boundary set
if isempty(tP)
disp(' no tripel points in the list!')
disp(' no triple points in the list!')
return
end

disp(' ')

tripel = allTripel(1:numel(tP.phaseMap));
triple = allTriple(1:numel(tP.phaseMap));

% ebsd.phaseMap
matrix = cell(size(tripel,1),4);
matrix = cell(size(triple,1),4);


for ip = 1:size(tripel,1)
for ip = 1:size(triple,1)

num(ip) = nnz(tP.hasPhaseId(tripel(ip,1),tripel(ip,2),tripel(ip,3))); %#ok<AGROW>
num(ip) = nnz(tP.hasPhaseId(triple(ip,1),triple(ip,2),triple(ip,3))); %#ok<AGROW>
matrix{ip,1} = int2str(num(ip));

% phases
if ischar(tP.CSList{tripel(ip,1)})
matrix{ip,2} = tP.CSList{tripel(ip,1)};
if ischar(tP.CSList{triple(ip,1)})
matrix{ip,2} = tP.CSList{triple(ip,1)};
else
matrix{ip,2} = tP.CSList{tripel(ip,1)}.mineral;
matrix{ip,2} = tP.CSList{triple(ip,1)}.mineral;
end
if ischar(tP.CSList{tripel(ip,2)})
matrix{ip,3} = tP.CSList{tripel(ip,2)};
if ischar(tP.CSList{triple(ip,2)})
matrix{ip,3} = tP.CSList{triple(ip,2)};
else
matrix{ip,3} = tP.CSList{tripel(ip,2)}.mineral;
matrix{ip,3} = tP.CSList{triple(ip,2)}.mineral;
end

if ischar(tP.CSList{tripel(ip,3)})
matrix{ip,4} = tP.CSList{tripel(ip,3)};
if ischar(tP.CSList{triple(ip,3)})
matrix{ip,4} = tP.CSList{triple(ip,3)};
else
matrix{ip,4} = tP.CSList{tripel(ip,3)}.mineral;
matrix{ip,4} = tP.CSList{triple(ip,3)}.mineral;
end

end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
% the function <GrainSet.specialBoundary.html specialBoundary>
%
% Syntax
% plot(grains.tripelPoints)
% plot(grains.tripelPoints,'color','r')
% plot(grains('Forsterite').tripelPoints,gB('Forsterite','Forsterite').misorientation.angle)
% plot(grains.triplePoints)
% plot(grains.triplePoints,'color','r')
% plot(grains('Forsterite').triplePoints,gB('Forsterite','Forsterite').misorientation.angle)
%
% Input
% tP - @tripelPointList
% tP - @triplePointList
%
% Options
% linewidth
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function tP = subsasgn(tP,s,b)
% overloads subsasgn

if ~isa(tP,'tripelPointList'), tP = b([]); end
if ~isa(tP,'triplePointList'), tP = b([]); end

switch s(1).type

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
classdef tripelPointList < phaseList & dynProp
classdef triplePointList < phaseList & dynProp
% grainBoundary list of grain boundaries in 2-D
%
% grainBoundary is used to extract, analyze and visualize grain
Expand All @@ -25,7 +25,7 @@
end

methods
function tP = tripelPointList(id,V,grainId,boundaryId,phaseId,phaseMap,CSList)
function tP = triplePointList(id,V,grainId,boundaryId,phaseId,phaseMap,CSList)

if nargin == 0, return; end

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ clean:


# rule for making release
RNAME = mtex-4.2.0
RNAME = mtex-4.2.1
RDIR = ../releases
release:
rm -rf $(RDIR)/$(RNAME)*
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
MTEX 4.2.0
MTEX 4.2.1
2 changes: 1 addition & 1 deletion doc/BoundaryAnalysis/BoundaryAnalysis.toc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
BoundaryPlots
TwinningAnalysis
CSLBoundaries
TripelPoints
TriplePoints
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
%% Tripel points
% how to detect tripel points
%% Triple points
% how to detect triple points
%
%% Open in Editor
%
%% Contents
% This is some starting implementation for tripel points in orientation
% This is some starting implementation for triple points in orientation
% images.

%% Calculation of tripel points
%% Calculation of triple points
%
% MTEX automatically computes tripel points during grain reconstruction.
% MTEX automatically computes triple points during grain reconstruction.
% They are acessable similarly to <BoundaryAnalysis.html grain boundaries>
% as an property of the grain list.

Expand All @@ -19,59 +19,59 @@
% compute grains
grains = calcGrains(ebsd('indexed'));

% extract all tripel points
tP = grains.tripelPoints
% extract all triple points
tP = grains.triplePoints

%% Index tripel points by phase
%% Index triple points by phase
%
% You may index tripel points by the adjacent phases. The following command
% gives you all tripel points with at least one phase being Forsterite
% You may index triple points by the adjacent phases. The following command
% gives you all triple points with at least one phase being Forsterite

tP('Forsterite')

%%
% The following command gives you all tripel points with at least two
% The following command gives you all triple points with at least two
% phases being Forsterite

tP('Forsterite','Forsterite')

%%
% Finaly, we may mark all inner Diopside tripel points
% Finaly, we may mark all inner Diopside triple points

% smooth the grains a bit
grains = smooth(grains,2);

% and plot them
plot(grains);

% on top plot the tripel points
% on top plot the triple points
hold on
plot(tP('Diopside','Diopside','Diopside'),'displayName','Di-Di-Di','color','b')
hold off

%% Index tripel points by grains
%% Index triple points by grains
%
% Since, tripel points are asociated to grains we may single out tripel
% Since, triple points are asociated to grains we may single out triple
% points that belong to a specific grain or some subset of grains.

% find the index of the largest grain
[~,id] = max(grains.area);

% the tripel points that belong to the largest grain
tP = grains(id).tripelPoints;
% the triple points that belong to the largest grain
tP = grains(id).triplePoints;

% plot these tripel points
% plot these triple points
plot(grains(id),'FaceColor',[0.2 0.8 0.8],'displayName','largest grains');
hold on
plot(grains.boundary)
plot(tP,'color','r')
hold off


%% Index tripel points by grain boundary
%% Index triple points by grain boundary
%
% Tripel points are not only a property of grains but also of grain
% boundaries. Thus we may ask for all tripel points that belong to
% Triple points are not only a property of grains but also of grain
% boundaries. Thus we may ask for all triple points that belong to
% Fosterite - Forsterite boundaries with misorientation angle larger then
% 60 degree

Expand All @@ -81,43 +81,43 @@
% Fo - Fo segments with misorientation angle larger 60 degree
gB_large = gB_Fo(gB_Fo.misorientation.angle>60*degree)

% plot the tripel points
% plot the triple points
plot(grains)
hold on
plot(gB_large,'linewidth',2,'linecolor','w')
plot(gB_large.tripelPoints,'color','m')
plot(gB_large.triplePoints,'color','m')
hold off


%% Boundary segments from tripel points
%% Boundary segments from triple points
%
% On the other hand we may also ask for the boundary segments that build up
% a tripel point. These are stored as the property boundaryId for each
% tripel points.
% a triple point. These are stored as the property boundaryId for each
% triple points.
%

% lets take Forsterite tripel points
tP = grains.tripelPoints('Fo','Fo','Fo');
% lets take Forsterite triple points
tP = grains.triplePoints('Fo','Fo','Fo');

% the boundary segments which form the tripel points
% the boundary segments which form the triple points
gB = grains.boundary(tP.boundaryId);

% plot the tripel point boundary segments
% plot the triple point boundary segments
plot(grains)
hold on
plot(gB,'lineColor','w','linewidth',2)
hold off

%%
% Once we have extracted the boundary segments adjecent to a tripel point
% Once we have extracted the boundary segments adjecent to a triple point
% we may also extract the corresponding misorientations. The following
% command gives a n x 3 list of misorientations where n is the number of
% tripel points
% triple points

mori = gB.misorientation

%%
% Hence, we can compute for each tripel point the sum of misorientation
% Hence, we can compute for each triple point the sum of misorientation
% angles by

sumMisAngle = sum(mori.angle,2);
Expand Down
8 changes: 4 additions & 4 deletions doc/ReleaseNotes/changelog.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
%
%% MTEX 4.2 - 11/2015
%
% MTEX 4.2 introduces basic functionality for tripel junction analysis in
% MTEX 4.2 introduces basic functionality for triple junction analysis in
% grain maps.
%
% *Tripel points*
%
% Tripel points are automatically computed during grain reconstruction and
% can be accessed by
%
% grains.tripelPoints
% grains.boundary.tripelPoints
% grains.triplePoints
% grains.boundary.triplePoints
%
% More details on how to work with tripel points can be found
% More details on how to work with triple points can be found
% <TripelPoints.html here>.
%
% *large EBSD data sets*
Expand Down
Loading

0 comments on commit 67659bc

Please sign in to comment.