-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathviewPhases.m
69 lines (57 loc) · 1.92 KB
/
viewPhases.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
function out = viewPhases( sid, rid, region, ebsd, tasks, varargin ) %#ok<INUSL,INUSD>
% Draw phase map and individual oreantation map for phase
%
% Syntax
% out = viewPhases( sid, rid, region, ebsd, tasks, varargin )
%
% Output
% out - not used
%
% Input
% sid - sample id: 's01', 's02', 's03', 's04', 't01', 'p01', 'p02'
% rid - region id
% region - region coordinate
% ebsd - EBSD (all phases) data if 0, try load useing function "[sid '_load']"
% tasks - list of tasks
%
% History
% 07.12.12 Add description of the function.
% 14.04.13 Add saveing of comment.
% 05.04.14 New input system.
% 17.08.15 Makeup. Write wiki. Add titles.
out = {};
saveres = getpref('ebsdam','saveResult');
OutDir = checkDir(sid, 'phases', saveres);
ebsd = checkEBSD(sid, ebsd, 0);
phases = get(ebsd,'minerals');
if length(phases) == 1
warning('One phase. Nothing to do!'); %#ok<WNTAG>
return;
end
comment = getComment();
% Plot phase map
figure();
plotspatial(ebsd,'property','phase');
title('Phase map');
saveimg( saveres, 1, OutDir, sid, [rid '_phases'], 'png', comment );
% Get phases
phases = get(ebsd,'minerals');
for i = 1:length(phases)
if (strcmp(phases{i},'notIndexed') == 0)
if (size(ebsd(phases{i}), 1) ~= 0)
% Plot orientation map
figure();
plotspatial(ebsd(phases{i}), 'antipodal', 'r',zvector);
title(['Orientation map for phase ''' phases{i} '''']);
saveimg( saveres, 1, OutDir, sid, [rid '_phases_' phases{i}], 'png', comment );
% Plot individual orientation
figure();
plotpdf(get(ebsd(phases{i}),'orientation'),Miller(1,0,0), 'antipodal', 'r',zvector);
title(['Pole figure for phase ''' phases{i} '''']);
saveimg( saveres, 1, OutDir, sid, [rid '_io_' phases{i}], 'png', comment );
end
else
plot(ebsd('notIndexed'),'facecolor','r');
end
end
end