Example 2: Relations between the 12 Ti alpha variants, and plot pole figure and map of a single variant #64
-
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Hi @Lu-Peter, I am happy to hear you're enjoying using ORTools. Please keep in mind that the phase transformation tools in MTEX and ORTools are constantly being improved upon.
To illustrate the above point, here is a script that uses Examples 1 and 2 to initialise the map data and Examples 8 and 10 for the parent grain reconstruction. % *********************************************************************
% ORTools - Modified Example
% *********************************************************************
% Reconstruction of beta parent grains from
% alpha in titanium alloys.
% *********************************************************************
% Dr. Azdiar Gazder, 2020, azdiaratuowdotedudotau
% Dr. Frank Niessen, 2020, contactatfniessendotcom
% (Remove "dot" and "at" to make this email address valid)
% *********************************************************************
home; close all; clear variables;
currentFolder;
set(0,'DefaultFigureWindowStyle','normal');
screenPrint('StartUp','ORTools - Example 2 (Modified)');
%% Initialize MTEX
% Startup and set some settings
startup_mtex;
setMTEXpref('xAxisDirection','east');
setMTEXpref('zAxisDirection','outOfPlane');
setMTEXpref('FontSize',14);
setInterp2Tex;
% Default directories - Do not modify
Ini.dataPath = [strrep(pwd,'\','/'),'/data/'];
Ini.cifPath = [Ini.dataPath,'input/cif/'];
Ini.ebsdPath = [Ini.dataPath,'input/ebsd/'];
Ini.texturePath = [Ini.dataPath,'output/texture/'];
Ini.imagePath = [Ini.dataPath,'output/images/'];
%% Load data
% Open the MTEX dataset on alpha and beta titanium
mtexDataset = 'alphaBetaTitanium';
screenPrint('SegmentStart',sprintf('Loading MTEX example data ''%s''',mtexDataset));
ebsd = mtexdata(mtexDataset);
%% Compute, filter and smooth grains
screenPrint('SegmentStart','Computing, filtering and smoothing grains');
% Grains are calculated with a 1.5° threshold
[grains,ebsd.grainId] = calcGrains(ebsd('indexed'),'threshold',1.5*degree,...
'removeQuadruplePoints');
% EBSD data in small grains are removed
ebsd(grains(grains.grainSize < 3)) = [];
% Recalculate the grains from the remaining data ...
[grains,ebsd.grainId] = calcGrains(ebsd('indexed'),'angle',1.5*degree);
% ... and smooth the grain boundaries
grains = smooth(grains,5);
%% Rename and recolor phases
screenPrint('SegmentStart','Renaming and recoloring phases');
phaseNames = {'Alpha','Beta'};
% Rename "Ti (BETA) to "Beta"and "Ti (alpha)" to "Alpha"
ebsd = renamePhases(ebsd,phaseNames);
% Choose your favourite colors
ebsd = recolorPhases(ebsd);
%% Define and refine parent-to-child orientation relationship
screenPrint('SegmentStart','Define and refine parent-to-child OR');
% Define 'Gamma" as the parent and 'AlphaP' as the child phase
job = setParentGrainReconstructor(ebsd,grains,Ini.cifPath);
% Give an initial guess for the OR: Burgers ...
job.p2c = orientation.Burgers(job.csParent, job.csChild);
% ... and refine it based on the fit with boundary misorientations
job.calcParent2Child;
% Check the disorientation and compare it with the ideal Burgers OR
% (The disorientation is the misfit between the grain misorientations
% and the misorientation of the OR)
plotHist_OR_misfit(job,orientation.Burgers(job.csParent,job.csChild),...
'legend',{'Burgers OR'});
xlim([0,10]);
% Display information about the refined OR
ORinfo(job.p2c);
%% Reconstruct parent microstructure
% - Reconstruct the microstructure with the variant graph based approach
job.calcVariantGraph('threshold',2.5*degree,'tolerance',2.5*degree)
job.clusterVariantGraph
% ... plot the votes (high values show high certainty)
figure; plot(job.grains,job.votes.prob(:,1))
mtexColorbar
% ... and calculate the parent orientations
job.calcParentFromVote('minProb',0.5)
% Plot the reconstructed parent microstructure
figure;
plot(job.parentGrains,job.parentGrains.meanOrientation,'linewidth',1);
%% Remove badly reconstructed clusters
% In order to reconstruct the remaining parent grains, we can calculate the
% votes for surrounding parent grains by the already reconstructed parent
% grains
% compute the votes
job.calcGBVotes('p2c','reconsiderAll')
% assign parent orientations according to the votes
job.calcParentFromVote
% plot the result
plot(job.parentGrains,job.parentGrains.meanOrientation,'linewidth',1)
%% Clean reconstructed grains
% Now clean the grains by:
% - merging grains with similar orientation
job.mergeSimilar('threshold',7.5*degree);
% - merging small inclusions
job.mergeInclusions('maxSize',150);
% This is the cleaned reconstructed parent microstructure
figure;
plot(job.parentGrains,job.parentGrains.meanOrientation,'linewidth',1)
%% Get parent EBSD data
figure;
parentEBSD = job.ebsd;
plot(parentEBSD('Beta'),parentEBSD('Beta').orientations);
hold on;
plot(job.grains.boundary,'linewidth',1);
hold off;
%% Variant analysis
% We can calculate variants and packets
job.calcVariants;
% and plot the variant map
plotMap_variants(job,'linewidth',1);
% and plot the packet map
plotMap_packets(job,'linewidth',1);
% and plot the Bain group map
plotMap_bain(job,'linewidth',1,'colormap',magma);
%% Get data on individual beta grains interactively by clicking on them
grainClick(job,'noScalebar','noFrame'); %Plot EBSD data
% grainClick(job,'grains','noScalebar','noFrame'); %Plot grain data
% Display information about the refined OR
ORinfo(job.p2c); ...provides all the detailed information on the refined OR and the variants which are numbered from 1 to N.
%% Get data on individual beta grains interactively by clicking on them
grainClick(job,'noScalebar','noFrame'); %Plot EBSD data
% grainClick(job,'grains','noScalebar','noFrame'); %Plot grain data ...provides all the detailed information on the variants contained in a single parent grain. If you need to plot a single variant, here is the script modified from the plotStack function for parent grain number 35: %% Define the parent grain
pGrain = job.parentGrains(job.parentGrains.id == 35);
pEBSD = job.ebsd(pGrain);
pEBSD = pEBSD(job.csParent);
%% Define the child grain(s)
clusterGrains = job.grainsPrior(job.mergeId == 35);
cGrains = clusterGrains(job.csChild);
cEBSD = job.ebsdPrior(job.ebsdPrior.id2ind(pEBSD.id));
cEBSD = cEBSD(job.csChild);
% Define the child PDF
hChild = Miller(0,0,1,job.csChild,'hkl');
%% Calculate the child variant, packet and Bain ids
[vId,pId,bId] = calcVariantId(pGrain.meanOrientation,cEBSD.orientations,job.p2c, ...
'variantMap', job.variantMap);
%% Plot the child variants PDF
% ...using grain data
plotPDF(cGrains.meanOrientation,...
cGrains.variantId,...
hChild,...
'equal','antipodal','points','all',...
'MarkerSize',5,'MarkerEdgeColor','k');
% ...using EBSD data
plotPDF(cEBSD.orientations,...
vId,...
hChild,...
'equal','antipodal','points','all',...
'MarkerSize',3,'MarkerEdgeColor','k'); **Lastly, and importantly, if an explanation from the maintainers resolves your issue, please press the "Mark as answer" button on the appropriate response. Your assistance in this regard enables us to close discussions as complete. ** Hope this helps. Warm regards, |
Beta Was this translation helpful? Give feedback.
-
Hi Azdi Thank you so much for your quick response. Almost solve all my questions. kind regards |
Beta Was this translation helpful? Give feedback.
-
Hi Azdi Thanks so much for your reply. The following code worked. hChild = Miller(1,1,-2,0, job.csChild,'hkil');
vId1st=cGrains(cGrains.variantId == 1);
plotPDF(vId1st.meanOrientation,...
hChild,...
'equal','antipodal','points','all',...
'MarkerSize',5,'MarkerEdgeColor','k');
EBSDvariant1=ebsd(vId1st);
plot(EBSDvariant1,EBSDvariant1.orientations); |
Beta Was this translation helpful? Give feedback.
Hi @Lu-Peter,
I am happy to hear you're enjoying using ORTools.
I hope it proves useful to your research.
Please keep in mind that the phase transformation tools in MTEX and ORTools are constantly being improved upon.
That means, and as a general rule of thumb, you should:
To illustrate the above point, here is a script that uses Examples 1 and 2 to initialise the map data and Examples 8 and 10 for the parent grain reconstruction.
% ***********…