Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
Update README
  • Loading branch information
christopher-daniel committed Dec 30, 2022
1 parent cd985c7 commit 75159d0
Show file tree
Hide file tree
Showing 7 changed files with 506 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
.DS_Store
._*
*.fuse
/Analysis/*
/Data/*
/Analysis/Ti64*
/Data/Ti64*
6 changes: 6 additions & 0 deletions Analysis/README-Analysis.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Example Analysis
-----------

Example analysis files can be downloaded from Zenodo. Please download these analysis files and unzip them into this folder, to compare with your own example analysis with MTEX-texture-block-analysis.

The analysis files for a hot-rolled Ti-6Al-4V sample recorded along the TD-ND plane (in the RD direction) can be downloaded from ebsd.zip in [Synchrotron X-ray Diffraction Results - Measuring Bulk Crystallographic Texture from Differently-Orientated Ti-6Al-4V Samples](https://doi.org/10.5281/zenodo.7319352)
6 changes: 6 additions & 0 deletions Data/README-Data.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Example Data
-----------

Example electron backscatter diffraction (EBSD) data files can be downloaded from Zenodo. Please download these data files and unzip them into this folder, to run an example analysis with MTEX-texture-block-analysis.

The EBSD data for a hot-rolled Ti-6Al-4V sample recorded along the TD-ND plane (in the RD direction) can be downloaded from material_data.zip in [Synchrotron X-ray Diffraction Dataset - Measuring Bulk Crystallographic Texture from Differently-Orientated Ti-6Al-4V Samples](https://doi.org/10.5281/zenodo.7311306)
2 changes: 2 additions & 0 deletions IPF_map_plot.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
color = oM.orientation2color(ebsd('Ti-Hex').orientations);
plot(ebsd('Ti-Hex'),color);
hold off
legend off
saveas (IPF_map, outputFileName, 'png');
close(IPF_map);

Expand All @@ -35,6 +36,7 @@
color = oM.orientation2color(ebsd('Titanium Cubic').orientations);
plot(ebsd('Titanium Cubic'),color);
hold off
legend off
saveas (IPF_map, outputFileName, 'png');
close(IPF_map);

Expand Down
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
MTEX-texture-block-analysis
-----------

MTEX scripts for sequentially cropping electron backscatter diffraction (EBSD) maps, producing a grid of equivalent-sized squares (in x and y), for calculating and plotting the crystallographic texture variation across a sample.

Includes MTEX scripts to calculate the ODFs, calculate texture intensity values and plot pole figures for each individual square.

Contents
-----------

1. `texture_block_analysis.m` An MTEX script to segment the EBSD map into a grid of equivalent sized squares, to calculate crystallographic texture for the alpha phase, plot pole figures, plot ODFs and calculate texture strength values.

2. `texture_block_analysis_beta.m` An MTEX script to segment the EBSD map to calculate crystallographic texture for the beta phase.

MATLAB Setup
-----------

The scripts have been tested with MATLAB Version R2019b.

MTEX Installation
-----------

The MTEX toolbox can be downloaded from [here](https://mtex-toolbox.github.io/download), which also includes instructions for installing MTEX and troubleshooting any issues.

The scripts have been tested with MTEX Version 5.2.8, but should only require minor adjustments to work with future versions.

Some minor changes to the base MTEX code have been made to produce better looking figures. See [here](https://lightform-group.github.io/wiki/software_and_simulation/mtex-nice-figures) for more information.
48 changes: 38 additions & 10 deletions texture_block_analysis.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
ebsd = EBSD.load(fname,CS,'interface','crc',...
'convertEuler2SpatialReferenceFrame')

%% Reduce the Data

ebsd = reduce(ebsd) % take every second pixel horiz. and vert.

%% Rotate the data

rot = rotation('Euler', 90*degree, 90*degree, 0*degree);
Expand Down Expand Up @@ -85,6 +89,7 @@
%% Calculate the Texture Index for the whole sample

TEXTURE_INDEX = textureindex(odf)
MAX = max(odf)

%% Plot the ODF slices without contouring for the whole sample

Expand Down Expand Up @@ -140,6 +145,7 @@

% calculate the Texture Index for the cropped compression sample
TEXTURE_INDEX = textureindex(odf_cropped)
MAX = max(odf_cropped)

% plot the ODF slices without contouring for the cropped compression sample
outputFileName = strcat(analysis_path,sample_name,'_ODF_cropped')
Expand Down Expand Up @@ -232,7 +238,7 @@
cs = ebsd('Ti-Hex').CS;

% define the maximum possible misorientation
misorientation = 10
misorientation = 5

% Define a texture component for the hexagonal phase
% basal_ND = symmetrise(orientation.byMiller([0 0 0 1],[1 0 -1 0],cs),'unique'); % define component with directions
Expand Down Expand Up @@ -289,9 +295,9 @@
%misorientation_ODF_max = angle(mori)/degree

% calculate PHI angle of ODF maxima
phi1 = ori_square_max.phi1
PHI = ori_square_max.Phi
phi2 = ori_square_max.phi2
phi1(square_index) = ori_square_max(square_index).phi1
PHI(square_index) = ori_square_max(square_index).Phi
phi2(square_index) = ori_square_max(square_index).phi2

% seperate the texture components and calculate the volume fractions
total_volume = length(ebsd_cutmap) % calculate the total volume as the number of points in the map
Expand All @@ -307,14 +313,18 @@
%tilted_ND_volume_fraction(square_index) = (tilted_ND_volume/total_volume)

% seperate a texture component and calculate the volume fraction
ebsd_basal_TD = ebsd_cutmap('Ti-Hex').findByOrientation(basal_TD, misorientation*degree);
basal_TD_volume = length(ebsd_basal_TD);
basal_TD_volume_fraction(square_index) = (basal_TD_volume/total_volume)
%ebsd_basal_TD = ebsd_cutmap('Ti-Hex').findByOrientation(basal_TD, misorientation*degree);
%basal_TD_volume = length(ebsd_basal_TD);
%basal_TD_volume_fraction(square_index) = (basal_TD_volume/total_volume)

% seperate a texture component and calculate the volume fraction
%ebsd_basal_RD = ebsd_cutmap('Ti-Hex').findByOrientation(basal_RD, misorientation*degree);
%basal_RD_volume = length(ebsd_basal_RD);
%basal_RD_volume_fraction(square_index) = (basal_RD_volume/total_volume)

% seperate a texture component and calculate the volume fraction
ebsd_basal_RD = ebsd_cutmap('Ti-Hex').findByOrientation(basal_RD, misorientation*degree);
basal_RD_volume = length(ebsd_basal_RD);
basal_RD_volume_fraction(square_index) = (basal_RD_volume/total_volume)
basal_TD_volume_fraction(square_index) = volume(odf_square, basal_TD, misorientation*degree);
basal_RD_volume_fraction(square_index) = volume(odf_square, basal_RD, misorientation*degree);
end

%% Open and write to file to save the different texture strength values
Expand Down Expand Up @@ -405,3 +415,21 @@
hold off
legend('{11-20} Pole Figure Max.')
saveas (PF_prismatic2_figure, strcat(analysis_path,sample_name,'_PF_prismatic2_line_plot_',num2str(num_squares), '.png'));

TD_volume_fraction_figure = figure();
hold on
plot(square_index,basal_TD_volume_fraction*100,'Color',[1,0,0],'lineWidth',2) % red;
xlabel('Slice Number')
ylabel('TD Volume Fraction (%)')
hold off
legend('TD Volume Fraction')
saveas (TD_volume_fraction_figure, strcat(analysis_path,sample_name,'_basal_TD_volume_fraction_line_plot_',num2str(num_squares), '.png'));

RD_volume_fraction_figure = figure();
hold on
plot(square_index,basal_RD_volume_fraction*100,'Color',[1,0,0],'lineWidth',2) % red;
xlabel('Slice Number')
ylabel('RD Volume Fraction (%)')
hold off
legend('RD Volume Fraction')
saveas (RD_volume_fraction_figure, strcat(analysis_path,sample_name,'_basal_RD_volume_fraction_line_plot_',num2str(num_squares), '.png'));
Loading

0 comments on commit 75159d0

Please sign in to comment.