Parent Grain Reconstruction won't work with my data :( #2263
-
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 4 replies
-
Although I am not much help on this topic... you might need/want to share the exact code (and maybe the data) you refer to using. |
Beta Was this translation helpful? Give feedback.
-
At least some of the structures look like reconstruction would be possible. The variant graph references the grain map and the error appears when the graph is being generated. This implies there is some sort of issue with the grain map. It would be helpful if you could let us know which version of MTEX you are using. In addition, posting your full reconstruction script would speed up the process of resolving your issues significantly. |
Beta Was this translation helpful? Give feedback.
-
thank you guys !! I am using version 5.10.2 of mtex. Not quite sure how to share my data as its not the right file type unfortunately % Load in EBSD data
fileloc = "C:\Users\quee4976\OxfordUniversity\phd\Documents\Aztec data\c4-8\fz\h5oina\fz Specimen 1 Site 1 Map Data 1.h5oina";
ebsd = loadEBSD_h5oina(fileloc);
% grain reconstruction
[grains,ebsd.grainId] = calcGrains(ebsd('indexed'), 'angle', 3*degree, 'minPixel',2);
grains = smooth(grains,5);
% plot the data and the grain boundaries
%changed Iron bcc to Fe (gamma, austenite, bcc)
plot(ebsd('Iron bcc'),ebsd('Iron bcc').orientations,'figSize','large')
hold on
plot(grains.boundary,'linewidth',0.1)
hold off
% set up the job
job = parentGrainReconstructor(ebsd,grains);
% initial guess for the parent to child orientation relationship
job.p2c = orientation.KurdjumovSachs(job.csParent, job.csChild);
close all
histogram(job.calcGBFit./degree,'BinMethod','sqrt')
xlabel('disorientation angle')
job.calcParent2Child
hold on
histogram(job.calcGBFit./degree,'BinMethod','sqrt')
hold off
% compute the misfit for all child to child grain neighbors
[fit,c2cPairs] = job.calcGBFit;
% select grain boundary segments by grain ids
[gB,pairId] = job.grains.boundary.selectByGrainId(c2cPairs);
% plot the child phase
%changed Iron bcc to Fe (gamma, austenite, fcc)
plot(ebsd('Iron bcc'),ebsd('Iron bcc').orientations,'figSize','large','faceAlpha',0.5)
% and on top of it the boundaries colorized by the misfit
hold on;
% scale fit between 0 and 1 - required for |edgeAlpha|
plot(gB, 'edgeAlpha', (fit(pairId) ./ degree - 2.5)./2 ,'linewidth',0.1);
hold off
%this is used for smaller maps
%job.calcVariantGraph('threshold',3.5*degree,'tolerance',2.5*degree)
%this is used for larger maps
job.calcVariantGraph('threshold',2.5*degree,'tolerance',2.5*degree,'mergeSimilar')
job.clusterVariantGraph
job.calcVariantGraph('threshold',2.5*degree,'tolerance',2.5*degree)
plot(job.grains,job.votes.prob(:,1))
mtexColorbar
job.calcParentFromVote('minProb',0.5)
% plot the result
plot(job.parentGrains,job.parentGrains.meanOrientation)
%with this you can reconstruct the remaining parents orentations manually
%job.selectInteractive
%this way is to rerun the variant graph approach above a second time but
%with relaxed settings ie with a lower probability
% compute the votes
job.calcGBVotes('p2c','reconsiderAll','threshold',3*degree,'tolerance',1.5*degree)
% assign parent orientations according to the votes
job.calcParentFromVote
% plot the result
plot(job.parentGrains,job.parentGrains.meanOrientation)
% merge grains with similar orientation
job.mergeSimilar('threshold',7.5*degree);
% plot the result
plot(job.parentGrains,job.parentGrains.meanOrientation)
job.mergeInclusions('maxSize',50);
% plot the result
plot(job.parentGrains,job.parentGrains.meanOrientation)
job.calcVariants
% associate to each packet id a color and plot
color = ind2color(job.transformedGrains.packetId);
plot(job.transformedGrains,color,'faceAlpha',0.5)
hold on
parentGrains = smooth(job.parentGrains,10);
plot(parentGrains.boundary,'linewidth',3)
% outline a specific parent grain
grainSelected = parentGrains(parentGrains.findByLocation([100,80]));
hold on
plot(grainSelected.boundary,'linewidth',3,'lineColor','w')
hold off
% identify childs of the selected parent grain
childGrains = job.grainsPrior(job.mergeId == grainSelected.id);
% plot these childs
plot(childGrains,childGrains.meanOrientation)
% and top the parent grain boundary
hold on
plot(grainSelected.boundary,'linewidth',2)
hold off
% the measured child orientations that belong to parent grain 279
childOri = job.ebsdPrior(childGrains).orientations;
% the orientation of parent grain 279
parentOri = grainSelected.meanOrientation;
% compute variantIds and packeIds
[variantId, packetId] = calcVariantId(parentOri,childOri,job.p2c);
% colorize child orientations by packetId
color = ind2color(packetId);
plotPDF(childOri,color, Miller(0,0,1,childOri.CS),'MarkerSize',2,'all')
% the positions of the parent (001) directions
hold on
plot(parentOri.symmetrise * Miller(0,0,1,parentOri.CS),'markerSize',10,...
'marker','s','markerFaceColor','w','MarkerEdgeColor','k','linewidth',2)
% the theoretical child variants
childVariants = variants(job.p2c, parentOri);
plotPDF(childVariants, 'markerFaceColor','none','linewidth',1.5,'markerEdgeColor','k')
hold off
parentEBSD = job.calcParentEBSD;
% plot the result
plot(parentEBSD('Iron fcc'),parentEBSD('Iron fcc').orientations,'figSize','large')
% the fit between ebsd child orientation and the reconstructed parent grain
% orientation
plot(parentEBSD, parentEBSD.fit ./ degree,'figSize','large')
mtexColorbar
setColorRange([0,5])
mtexColorMap('LaboTeX')
hold on
plot(job.grains.boundary,'lineWidth',2)
hold off
[parentGrains, parentEBSD.grainId] = calcGrains(parentEBSD('indexed'),'angle',3*degree);
% remove very small grains
parentEBSD(parentGrains(parentGrains.grainSize<10)) = [];
% redo grain reconstruction
[parentGrains, parentEBSD.grainId] = calcGrains(parentEBSD('indexed'),'angle',3*degree);
parentGrains = smooth(parentGrains,10);
plot(ebsd('indexed'),ebsd('indexed').orientations,'figSize','large')
hold on
plot(parentGrains.boundary,'lineWidth',2)
hold off
% fill the holes
F = halfQuadraticFilter;
parentEBSD = smooth(parentEBSD('indexed'),F,'fill',parentGrains);
% plot the parent map
plot(parentEBSD('Iron fcc'),parentEBSD('Iron fcc').orientations,'figSize','large')
% with grain boundaries
hold on
plot(parentGrains.boundary,'lineWidth',2)
hold off |
Beta Was this translation helpful? Give feedback.
-
First off, the option "minPixel" does not work in MTEX 5.10.2, since the functionality was only introduced in the latest version. That being said, can you try the more basic script below: Please post all error messages fully to get more help.
|
Beta Was this translation helpful? Give feedback.
You need to define the parent phase somehow. MTEX tries to guess it from the phase list when you create the parentGrainReconstructor job class object, but if there is no other phase than "Iron bcc" in your dataset then MTEX has nothing to go on with. In this case, you need to add the parent phase manually.
In the future, I would suggest you include "Iron fcc" in the phase list, even you expect that the material is wholly transformed. If you have prepared the specimen well and have set up the microscope and the measurement parameters correctly, the amount of misindexed phases will be very limited. It is good information if there indeed happens to be retained austenite somewhere in the stru…