MTEX allows you to import EBSD data from a wide variety of file formats. In the most simplest case import can be done by the command EBSD.load
ebsd = EBSD.load([mtexEBSDPath filesep 'twins.ctf'],...
'EulerCorrection',rotation.byAxisAngle(xvector,180*degree))ebsd = EBSD (y↓→x)
Phase Orientations Mineral Color Symmetry Crystal reference frame
0 46 (0.2%) notIndexed none
1 22833 (100%) Magnesium LightSkyBlue 6/mmm X||a*, Y||b, Z||c
Properties: bands, bc, bs, error, mad
Scan unit : um
X x Y x Z : [0, 50] x [0, 41] x [0, 0]
Normal vector: (0,0,1)This command automatically detects the file format and generates a variable of type EBSD which contains all the information of the EBSD data set. Let us quickly do an orientation plot of the Magnesium phase
plot(ebsd('Magnesium'),ebsd('Magnesium').orientations)
The variable of type EBSD is the starting point for all further analysis, e.g., grain reconstruction, ODF reconstruction, misorientation analysis, etc.
Importing EBSD data using the import wizard
In many cases however, importing EBSD data is not that straightforward as suggested above. The reason is that during the measuring process different reference systems are involved and resulting coordinates, i.e., the spatial coordinates and the Euler angles, are often not stored in a consistent way by commercial software. Please read EBSD Reference Systems for more information about how to set up reference frames correctly.
In order to help the user to import EBSD data consistently to a fixed specimen reference frame (which the user should know), MTEX provide the import wizard as a graphical user interface. The import_wizard can be started either by typing into the command line
import_wizard
EBSD Data files can be also imported via the file browser by choosing Import Data from the context menu of the selected file if its file extension was registered with mtex_settings.m
The import wizard guides through the correct setup of:
- crystal symmetries associated with phases
- specimen symmetry and plotting conventions
The import wizard allows you to either create directly a workspace variable of type EBSD or to generates a m-file, which contains all the customization and allows you to import the data in future sessions without the import wizard. This last option is highly recommended as the created script is also a good starting point for further analysis and data processing.
The Import Script
A script generated by the import wizard has approximately the following form:
% crystal symmetry
CS = {...
'notIndexed',...
crystalSymmetry('6/mmm', [3.2 3.2 5.2], 'X||a*', 'Y||b', 'Z||c*',...
'mineral', 'Magnesium', 'color', [0.53 0.81 0.98])};
% plotting convention
setMTEXpref('xAxisDirection','east');
setMTEXpref('zAxisDirection','outOfPlane');
% path to files
pname = mtexEBSDPath;
% which files to be imported
fname = [pname filesep 'twins.ctf'];
% create an EBSD variable containing the data
ebsd = EBSD.load(fname,CS,'interface','ctf',...
'EulerCorrection',rotation.byAxisAngle(zvector,180*degree));Running this script imports the data into a variable named ebsd. From this point, the script can be extended to your needs, e.g:
plot(ebsd,ebsd.orientations)
Supported Data Formats
MTEX supports the following EBSD data formats:
|
EDAX ascii files. |
single orientation files. |
||
|
Oxford binary files. |
EDAX binary files. |
||
|
HKL single orientation files. |
ASCII files with Euler angles as columns. |
||
|
Bruker, EDAX, Oxford, ThermoFisher, EMsoft/EMsphinx binary files. |
If the data is recognized as an ASCII list of orientations, phase and spatial coordinates in the form
alpha_1 beta_1 gamma_1 phase_1 x_1 y_1 alpha_2 beta_2 gamma_2 phase_2 x_2 y_2 alpha_3 beta_3 gamma_3 phase_3 x_3 y_3 . . . . . . . . . . . . . . . . . . alpha_M beta_M gamma_M phase_m x_m y_m
an additional tool supports you to associated the columns with the corresponding properties.
HDF5 Files With Several Data Sets
HDF5 files are often project files holding more than one map - an EDAX project stores its maps as Area N/OIM Map N, an Oxford project its slices as /1, /2, ..., an EMSphInx file its scans as Scan N. Whenever a file contains more than one, the import lists them and states which one it took
├── Data sets : 2 │ ▸ [1] Area 1/OIM Map 1/EBSD │ [2] Area 2/OIM Map 7/EBSD
Pick another one by its number or by (part of) its name
ebsd = EBSD.load(fname,'dataSet',2)
ebsd = EBSD.load(fname,'dataSet','OIM Map 7')The data set that has been imported is recorded as its full HDF5 path in ebsd.opt.dataSet, the short names of all of them in ebsd.opt.dataSets. In order to see what a file contains without importing any data use
ebsd = EBSD.load(fname,'headerOnly')The import wizard lists everything a file offers below its file browser - selecting a row imports it.
Raw and Post Processed Data
An Oxford h5oina file may store the map twice - as recorded by the detector under EBSD and as cleaned up by the vendor software under Data Processing. Both are simply data sets of that file, so they are listed and picked exactly like the maps above, the cleaned up one first
ebsd = EBSD.load(fname) % post processed
ebsd = EBSD.load(fname,'dataSet','EBSD') % as recordedThe recorded version comes with the full set of per pixel properties - band contrast, band slope, pattern quality, the pattern centre, ... - while the cleaned up one keeps only a few of them, but has its bad pixels cleaned up. Both refer to the same reference frame, so orientations may be compared between them directly.
A file that was never processed holds the recorded version alone and simply lists one data set per map.
Writing your own interface
In the rare case of an EBSD format that is not supported, the user can write its own interface to import the data. Once you have successfully written that, you can integrate this method into MTEX by copying it into the folder mtex/interfaces and rename your function loadEBSD_xxx. Then it will be automatically recognized by the import wizard. Examples how to write such an interface can be found in the directory mtex/interfaces.