azdiargazder / mtextools Goto Github PK
View Code? Open in Web Editor NEWA collated library of additional MTEX functions & demonstration scripts.
Home Page: https://github.com/AzdiarGazder/mtexTools
License: MIT License
A collated library of additional MTEX functions & demonstration scripts.
Home Page: https://github.com/AzdiarGazder/mtexTools
License: MIT License
hello guys
I need help with a Matlab® code developed that uses the MTEX toolbox to first define grain boundaries based on selected grain tolerance angles and then calculate the KAM for each pixel. If the misorientation of a pixel exceeds 3°, the program classifies the grains as granular bainite; otherwise, it is classified as polygonal ferrite. The classification algorithm then color-codes the relative sorted grains it determines and calculates the measured granular bainite and polygonal fractions. This is my purpose, I have proceeded to calculate the kam value of each pixel but the follow-up process I don't know how to do.
I would be very grateful if anyone could help!
Wang Kang
Hi!@AzdiarGazder
The developed Matlab®code uses the MTEX toolbox [33] to define first the grain boundaries according to the selected grain tolerance angle and afterwards calculate the KAM of each pixel. The program classifies grains as granular bainite if one pixel exceeds a misorientation of 3°; otherwise it is categorized as polygonal ferrite. Subsequently, the classification algorithm color-codes the classified grains according to their determined phase and calculates the measured granular bainite and polygonal fraction.I can calculate the KAM value for each pixel, but then the classification algorithm color codes the classified grains based on the determined phase and calculates the measured grain bainitic and polygonal fractions I don't know how to do that with code.As shown in the figure below, the left is what I can achieve currently, and the right is the drawing I want to achieve.I would appreciate it if you could help me.
Attach the current code
%% Import Script for EBSD Data
%
% This script was automatically created by the import wizard. You should
% run the whoole script or parts of it in order to import your data. There
% is no problem in making any changes to this script.
%% Specify Crystal and Specimen Symmetries
% crystal symmetry
CS = {...
'notIndexed',...
crystalSymmetry('m-3m', [2.9 2.9 2.9], 'mineral', 'Iron bcc (old)', 'color', [0.53 0.81 0.98]),...
crystalSymmetry('m-3m', [3.7 3.7 3.7], 'mineral', 'Iron fcc', 'color', [0.56 0.74 0.56])};
% plotting convention
setMTEXpref('xAxisDirection','east');
setMTEXpref('zAxisDirection','intoPlane');
%% Specify File Names
% path to files
pname = 'D:\桌面\B钢数据\B-750\B钢\B钢EBSD\B750';
% which files to be imported
fname = [pname '\B750-1.crc'];
%% Import the Data
% create an EBSD variable containing the data
ebsd = EBSD.load(fname,CS,'interface','crc',...
'convertEuler2SpatialReferenceFrame');
% The second parameter that is involved in grain reconstruction is the threshold misorientation angle indicating a grain boundary.
grains = calcGrains(ebsd,'angle',5*degree)
[grains,ebsd.grainId] = calcGrains(ebsd('indexed'));
% remove one-three pixel grains
ebsd(grains(grains.grainSize <= 3)) = [];
[grains,ebsd.grainId] = calcGrains(ebsd('indexed'));
grains = smooth(grains,5);
plot(ebsd('indexed'),ebsd('indexed').orientations)
hold on
plot(grains.boundary,'lineWidth',1.5)
hold off
ebsd = ebsd.gridify;
kam = ebsd.KAM / degree;
% lets plot it
plot(ebsd,kam,'micronbar','off')
caxis([0,15])
mtexColorbar
mtexColorMap LaboTeX
hold on
plot(grains.boundary,'lineWidth',1.5)
hold off
plot(ebsd,ebsd.KAM('threshold',2.5*degree) ./ degree,'micronbar','off')
caxis([0,5])
mtexColorbar
mtexColorMap LaboTeX
hold on
plot(grains.boundary,'lineWidth',1.5)
hold off
% chose a denoising filter
F = halfQuadraticFilter;
F.alpha = 0.5;
% denoise the orientation map
ebsdS = smooth(ebsd,F,'fill',grains);
% plot the first order KAM
plot(ebsdS,ebsdS.KAM('threshold',2.5*degree) ./ degree,'micronbar','off')
caxis([0,5])
mtexColorbar
mtexColorMap LaboTeX
hold on
plot(grains.boundary,'lineWidth',1.5)
hold off
Best wishes
Wang Kang
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.