research papers
LaueMatching: an approach for rapid and robust indexing of Laue diffraction patterns
aAdvanced Photon Source, Argonne National Laboratory, Lemont, IL 60439, USA
*Correspondence e-mail: [email protected]
Traditional Laue diffraction pattern indexing often struggles with noisy data, weak signals, peak overlap and missing reflections, particularly from complex or deformed microstructures. Here, we introduce LaueMatching, a high-throughput indexing algorithm designed to overcome these limitations. LaueMatching utilizes a fundamentally different approach based on direct pattern correlation: experimentally pre-processed images are compared against a comprehensive pre-computed library of simulated diffraction patterns corresponding to a dense grid of possible orientations. This approach bypasses the need for explicit peak identification and fitting, steps that are often a failure point for traditional methods. The algorithm rapidly and robustly indexes multiple crystallographic orientations and crystal systems simultaneously, even from challenging patterns. LaueMatching's effectiveness and accuracy have been rigorously tested and validated on diverse experimental (Ni, Al, EuAl2O4) and simulated diffraction patterns, demonstrating high-fidelity orientation refinement. Code to implement this approach on both CPU and GPU resources can be downloaded from https://github.com/AdvancedPhotonSource/LaueMatching.
Keywords: Laue microdiffraction; indexing; image processing; orientation refinement; pattern correlation.
1. Introduction
Materials science research relies heavily on understanding the microstructure of materials across varying length scales, from features down to the nanometre scale to millimetres and larger. The Laue microdiffraction technique occupies a unique position amongst the wide variety of techniques used to study the microstructure of materials. It provides non-destructive bulk information about the microstructure (crystallographic orientation and strain information) with sub-micrometre spatial resolution and absolute strain resolution (Liu et al., 2004
; Chung & Ice, 1999
; Ice & Larson, 2000
). A detailed overview of the multiple facilities implementing this technique is provided by Barabash & Ice (2014
). Laue microdiffraction works by rastering a sub-micrometre sized polychromatic X-ray beam across a sample, with the third dimension (depth resolution) coming from differential or coded aperture techniques (Tamura et al., 2002
; Larson & Levine, 2013
; Gürsoy et al., 2022
).
Traditional techniques for determining orientation and strains from a Laue diffraction pattern involve detecting the position of diffraction peaks in the pattern, indexing the diffraction peaks to orientations, and refining the crystal structure for each position and depth (Tischler, 2014
; Liu et al., 2004
; Barabash et al., 2001
; Plancher et al., 2016
; Zhang et al., 2017
, 2023
; Petit et al., 2015
; Dejoie & Tamura, 2020
; Li et al., 2020
; Vasilev et al., 2023
; Tamura, 2014
). Recent improvements in data processing for Laue microdiffraction involve machine learning techniques such as LaueNN (Purushottam Raj Purohit et al., 2022
; Kirstein et al., 2023
), dictionary-based searches (Gupta & Agnew, 2009
; Seret et al., 2022
) and zone-axis-assisted indexing (Kou & Chen, 2024
). In addition to Laue microdiffraction, dictionary-based approaches and pattern matching have been successfully used to index diffraction patterns in applications such as electron backscatter diffraction (Singh & De Graef, 2016
) and optical microscopy (Wittwer & Seita, 2022
). Gevorkov et al. (2020
) have developed an orientation-envelope-based indexing approach. All these methods rely on accurately determining the position of diffraction peaks to compute the angles between them, which can be challenging for heavily deformed materials. Another approach, recently proposed by Huang et al. (2023
), avoids the peak-searching step but requires the user to manually select diffraction peaks to kick-start the orientation search. While these advances have improved indexing, a robust fully automated method that does not rely on finding and fitting well defined diffraction peaks, especially for patterns with numerous overlapping grains or weak signals, remains a critical need.
The methods described above struggle if patterns consist of diffraction signals from a large number of orientations, if the experimental configuration and crystal structure result in only a small number of diffraction peaks, if the number of missing peaks is high, or if the crystal structure is not well known. This paper introduces LaueMatching, a novel method that indexes Laue patterns through direct correlation matching against a comprehensive simulated pattern library, which inherently overcomes many of the limitations of methods that rely on precise peak fitting and centroiding. The bulk of the computational work (computing the library of diffraction patterns) is done a priori, leading to extremely high computational performance in orientation determination. Pre-computed diffraction patterns are stored and can be used repeatedly on diffraction data with the same experimental configuration. The method works well even for cases where the crystal structure is not well known. While a candidate crystal structure (lattice parameter and space group) is required to generate the simulation library, LaueMatching can be used to test multiple candidate structures against an experimental pattern; the structure yielding the highest figure of merit is the most probable match. Although developed here for Laue microdiffraction, the underlying principle of indexing via correlation against a comprehensive simulated library holds potential applicability to other diffraction-pattern indexing challenges where traditional feature extraction is difficult, e.g. diffraction from deformed materials and weak scattering signals. The experimental Laue geometry and forward-simulation model are described in Section 2
. The workflow is detailed in Section 3
. The robustness of LaueMatching is demonstrated using multiple simulated and experimental diffraction patterns in Section 4
.
LaueMatching has been implemented as an application written in C and CUDA with Python bindings. Available to run on both CPU (on Linux and MacOS) and GPU (on NVIDIA GPUs) resources, the code can be downloaded from https://github.com/AdvancedPhotonSource/LaueMatching.
2. Forward simulations and Laue geometry
This section describes the geometry of the Laue microdiffraction setup and the forward-simulation model used to compute the diffraction-pattern library.
A key aspect of polychromatic `white-beam' Laue diffraction is that reflections are defined by a combination of scattering angle and the specific X-ray energy that satisfies the Bragg condition, forming a locus of possible diffraction events in angle–energy space. Our forward-simulation model explicitly accounts for this. For each candidate orientation and each allowed hkl reflection, the model calculates both the corresponding pixel position on the detector and the required energy, E. This list of potential reflections is then filtered, retaining only the pixel positions for which E falls within the known experimental energy range (,
). The simulation library therefore stores a set of 2D detector coordinates that implicitly represents the valid angle–energy combinations for each orientation.
Fig. 1
shows a schematic view of the Laue experiment in the reflection geometry at the Laue microdiffraction station 34-ID-E at the Advanced Photon Source. Such a configuration is common for Laue instruments at other synchrotrons. A polychromatic X-ray beam (spectrum of photon energies up to keV) from an undulator source is incident on a poly- or single-crystalline sample. A Laue diffraction pattern is formed on the 2D detector, nominally positioned at a distance L above the sample at a scattering angle centered at
[Fig. 1
(a)]. The detector frame size is by
, where
,
and
,
are the number of pixels and the pixel size along the first (
) and second (
) dimensions, respectively, shown in Fig. 1
(b). The detector position and orientation in the laboratory frame ( +z is the X-ray beam direction, +y is up and +x is outboard of the synchrotron ring) can be defined by two vectors: a translation vector and a rotation vector
.
| Figure 1 (a) Schematic drawing of the Laue diffraction experiment. The focused polychromatic beam is incident on the sample from the right. The detector is placed at |
To define the detector position using and
, we start with the center of the detector matrix at (0,0,0) of the laboratory coordinate system; the detector matrix is normal to the incident beam and is oriented with its first dimension (
) along +x; the second dimension (
) is along +y. This is denoted as the detector coordinate system, shown schematically in Fig. 1
(c) (initial position). The detector is first translated by the vector [Fig. 1
(c) (after translation)] and then rotated about the vector to arrive at the final position in the instrument [Fig. 1
(c) (final position)]. In our notation, the magnitude of the vector is the angle (in radians) by which the detector is rotated. Before an experiment, the
and
vectors are calibrated using a Laue diffraction pattern from a thin single-crystal Si sample with a known orientation positioned at the origin of the coordinate system.
Forward simulation, that is, computing the location of diffraction signal on the detector from an oriented crystal, involves these steps in reverse for each allowed hkl. The diffraction vector, according to the orientation of the crystal, is first computed in the laboratory coordinate system. This position is then rotated by and un-displaced by
to determine the pixel position on the un-displaced initial detector position lying in the XY plane. The procedure is as follows below.
We define initial crystal orientation using the orientation matrix, U, which transforms a vector from the crystal frame to the laboratory frame. The rotated reciprocal-space matrix, , is computed as
where A* is the reciprocal-space matrix calculated from the lattice parameter of the crystal. This, combined with a valid vector of {hkl} indices for the crystal structure, yields as
The unit vector in the direction of the diffraction signal, [shown in Fig. 1
(c)], is
where is the unit vector in the incident-beam direction and
is the unit vector in the direction of the diffraction-plane normal, computed as
We now compute a rotation matrix to rotate from the detector frame to the laboratory coordinate system using :
where ,
,
,
and
. This is the standard matrix formulation for an axis–angle rotation, where the vector
defines the axis of rotation and its magnitude,
, defines the angle of rotation in radians.
The inverse of can be used to rotate
to the detector coordinate system (before application of
) as
The term is then scaled to the z displacement of the detector to compute
as
Here is the component of
along the z axis in the initial (unrotated, undisplaced) detector coordinate system, representing the projection onto the detector-plane normal.
The position of the diffraction signal on the detector in the laboratory coordinate system after displacement of by
is
As described earlier, at this step, the middle of the detector is located at the origin of the laboratory coordinate system [Fig. 1
(c)]. Thus, the position of the diffraction signal on the detector ( and
element indices in the
and
directions, respectively) is computed from
by first transforming to pixel coordinates by dividing by the respective pixel size and then displacing the origin to the edge of the detector [Fig. 1
(b)] as follows:
The X-ray energy of the corresponding signal is
where keV nm. The following filters are subsequently used to determine valid diffraction signal:
3. Workflow
Before detailing the workflow, we will define several key terms to ensure clarity. A crystal orientation refers to the rotational transformation of a grain's crystallographic axes relative to the laboratory coordinate system. The terms `strong orientation candidate' or `weak orientation candidate' do not describe intrinsic properties of the orientation itself but rather the quality of the match between the simulated pattern for that orientation and the experimental data. A strong orientation candidate corresponds to a high figure of merit, indicating a significant diffraction signal, likely from a large or well oriented grain. Conversely, a weak orientation yields a lower figure of merit and typically corresponds to a weaker diffraction signal.
The LaueMatching workflow, detailed below, is structured into three key stages designed to efficiently generate the necessary simulated templates, prepare the experimental data for robust matching and perform the final orientation determination:
(i) Generation of the library of diffraction signals.
(ii) Pattern preprocessing.
(iii) Indexing and of orientations and crystal structure.
The following sections describe these steps in more detail.
3.1. Generation of the library of diffraction signals
In this step, the forward-simulation model generates a comprehensive library of hkl detector positions for a certain experimental configuration, and orientation grid. If the material consists of multiple phases, this procedure is repeated separately for each phase, and the workflow is applied independently each time. Fig. 2
shows the workflow to generate the library of signals. The required input is divided into three categories:
| Figure 2 Schematic diagram of workflow to generate the SimulationFile in LaueMatching. Blue boxes indicate file I/O to the system, green boxes indicate user inputs and yellow boxes indicate computation. |
(i) Sample parameters. These correspond to the phase of interest. The parameters supplied are the parameters and expected number of diffraction peaks (). The expected number of diffraction peaks is the number of peaks resulting in signal on the detector in the current experiment configuration.
serves as an estimate to optimize the size of the simulation library and does not need to be exact. It is used to pre-allocate memory and limit the number of reflections stored for each orientation, with a reasonable value easily estimated from a single forward simulation.
(ii) Experimental configuration. This corresponds to the experimental setup. The parameters supplied are detector position (experimentally calibrated translational and rotational vectors and
; see Section 2
for more details), pixel size (dx, dy) and number of pixels of the detector (,
), and range of X-ray energies used to filter allowed diffraction peaks in the simulation (
,
).
(iii) Candidate orientations. This is a list of orientations (supplied as quaternions and saved in an OrientationFile) that will be used for simulation. Typically, this list includes uniformly spaced orientations on a regular grid in the full orientation space, not just in the fundamental zone for the corresponding crystal structure. This is deliberate, as using the full space allows for a robustness check during indexing by requiring multiple symmetry-equivalent orientations to be found (see Section 3.3
). The orientation grid can be generated using programs based on EMsoft (Singh et al., 2017
), Orix (Johnstone et al., 2020
), Neper (Quey et al., 2018
) or MTEX (Krakow et al., 2017
). For example, 0.6, 1
and 2
orientation spacing results in ∼100 million, 20 million and 2.4 million orientations in the full orientation space, respectively. The LaueMatching repository includes an example file and example codes for the generation of the OrientationFile.
The first stage in this workflow involves the computation of a set of valid reflections, corresponding to [hkl] directions, that are allowed for diffraction after computing the lattice extinction rules for the assumed crystal structure. Reflections prohibited due to the structure factor (basis forbidden hkls) are not excluded at this stage. This list of hkls is saved to a ReflectionFile.
The next step is to generate the simulation. For each orientation in the candidate orientation list, a sub-set of hkls is computed that satisfies the following conditions: the diffraction signal lands on the calibrated detector position and falls within the specified X-ray energy range. The positions of up to valid diffraction peaks (sorted by d spacing) are saved in a SimulationFile. These positions are saved as pixel coordinates on the detector; doing this significantly reduces (i) the data size by reducing the highest stored values {
} from equation (11
) and (ii) the computation time during indexing by efficient indexing, described more in Section 3.3
.
OrientationFile, ReflectionFile and SimulationFile are generated once for each and experimental configuration. This orientation library is reused for any experimental where the sample satisfies the crystallographic parameters. New libraries of patterns can be pre-computed for new crystal structures as needed. The simulation library is specific to a given experimental geometry. If the detector position or other geometric parameters change, a new library must be generated. It is important to note the favorable scaling: the computationally intensive library generation is a one-time cost per configuration, while the indexing of individual patterns is extremely rapid, making the approach highly efficient for large datasets.
3.2. Pattern preprocessing
One unique feature of LaueMatching is that fitting peaks to obtain peak positions is unnecessary; the algorithm computes a correlation using the raw diffracted signal between the simulated diffraction peak positions and the corresponding intensity on the detector. This direct use of intensity avoids the challenge associated with precise peak finding and fitting, particularly for weak, overlapping or distorted peaks, which can affect traditional methods. The indexing process, described in the next section, selects a smaller set of orientations from the millions of candidate orientations computed in the library of diffraction signals. These are then refined to get the orientations present in the sample.
Computing the correlation between the experimental data and the pre-computed diffraction signal for an orientation is significantly faster than the step. Thus, reducing the number of orientations that need to be refined is computationally advantageous. This is achieved by pre-processing the diffraction patterns to isolate the diffraction signal from the background. By applying a threshold after background subtraction, pixels not containing diffraction information are set to zero counts. This is distinct from traditional peak finding, as it does not involve fitting peak profiles or finding peak centers, but rather prepares the entire diffraction signal for correlation. This threshold is applied globally on a per-frame basis.
The strict computation of the correlation function and a finite spacing of orientations necessitates incorporating the difference in the real orientation and its closest neighbor in the chosen orientation grid. (The maximum difference in these can be , where
is the orientation-grid spacing.) Seret et al. (2022
) used a similar approach with a regularly spaced orientation grid but applied an angular uncertainty to the experimental plane normal vectors each time when matching with the simulation. This approach is computationally expensive for the millions of orientations tested in LaueMatching. Thus LaueMatching uses a reverse approach: the thresholded experimental diffraction pattern is blurred with a Gaussian filter of width W, computed as follows:
where is the orientation spacing in radians and Tz is the sample-to-detector distance, assuming nominal
geometry. This assumes that the blurring effect extends to 4W pixels.
The pattern-processing workflow is shown in Fig. 3
, and Fig. 4
shows the results for an example diffraction pattern.
| Figure 3 Schematic diagram of the pattern-processing workflow in LaueMatching. Blue boxes indicate file I/O to the system, yellow boxes indicate computation, gray boxes with dashed border indicate optional user inputs and purple boxes indicate intermediate stored files. |
| Figure 4 Pattern-processing results for the |
The pattern-processing workflow consists of the following steps:
(1) The first step involves computing the background signal on the image. This is done by repeated application (4–5 times) of a median filter on the image. The median-filter size is ∼4× the size of the largest diffraction peak on the image using the DIPlib library (DIPlib, 2025
). Fig. 4
(b) shows the computed background for the diffraction image in Fig. 4
(a). This background is subtracted from the image. The empirically determined background may be used on different images acquired using the same experiment configuration.
(2) The next step involves the computation of a threshold to be applied to the background-corrected image. This threshold is typically of the background-corrected image or the intensity of 90th percentile of the pixels, where σ is the standard deviation. All pixels with intensity below this threshold are set to 0.
(3) A connected-components operation on the cleaned image is used to determine connected regions of the image. These connected components are used later to identify unindexed regions in the pattern for subsequent reprocessing.
(4) The Gaussian blurring filter of width σ is applied to the image. The image datatype is converted to `double' to preserve fractional intensities.
The Gaussian blurring step is critical for the algorithm's robustness. It effectively `smears' the intensity from each pixel, allowing a successful match to be found even if the true grain orientation lies between the discrete points of the simulation or if minor experimental misalignments cause small shifts in peak positions. It is this feature that allows LaueMatching to achieve high-precision orientation even with deliberately introduced peak-position noise, as quantitatively benchmarked in our simulated ground-truth analysis in Section 4
.
3.3. Indexing and subsequent refinement
Fig. 5
describes the workflow for determining orientations from a pre-processed pattern. This can be split up into two main parts: indexing and In the indexing step, diffraction peaks are assigned to different orientations, and the orientation and lattice parameters are refined in the step.
| Figure 5 Schematic diagram of the indexing and refinement workflow in LaueMatching. Blue boxes indicate file I/O to the system, green boxes indicate user inputs, yellow boxes indicate computation, red boxes indicate decision steps and purple boxes indicate intermediate stored files. The computation can be run on GPU or CPU resources. |
The first step is to run a look-up table search. For each orientation in the OrientationFile and each corresponding pixel position of the simulated peaks in the SimulationFile, experimental signal intensity is obtained by accessing the corresponding position in the diffraction pattern. The intensity sum is computed by adding the intensity values for all the peak pixel positions in the SimulationFile for the corresponding orientation. The term
and the number of peak positions with non-zero intensity (N) (pattern preprocessing ensures that only pixels belonging to the diffraction signal have non-zero intensity) are used to define the figure of merit (F) in different user-selectable ways:
,
,
,
and
.
These options allow users to tailor the search sensitivity according to the experimental conditions; for instance, weighting N higher might be beneficial when many peaks are expected but they are potentially weak, while weighting higher prioritizes stronger, potentially fewer, signals. While several figures of merit are available to tailor the search sensitivity, we found
to be the most robust and reliable metric across a wide range of experimental conditions. It effectively balances the need to find patterns with a sufficient number of peaks (N) and strong total intensity
. We therefore recommend it as the default for most applications. An orientation candidate is considered for subsequent refinement if the figure of merit exceeds
and
. The term
is detector-signal and crystal-quality dependent; typically, a value of ∼100 counts is used to detect weak signal. The term
depends on the detector configuration and the material's A good rule of thumb is to use
, where
is the number of expected diffraction peaks from a random orientation resulting in signal on the detector. This
value accounts for missing reflections due to non-uniform X-ray beam energy profiles, weakly reflecting materials and structure-factor Optimal values for these thresholds may require minor tuning depending on the specific material system and experimental signal-to-noise levels, though the provided rule of thumb for
offers a good starting point.
The list of candidate orientations found is then further processed. If multiple orientations are detected, the algorithm can optionally operate iteratively: identified peaks corresponding to strong orientation candidates are masked (conceptually removed) from the blurred pattern and the search process (look-up table search and F calculation) is repeated on the residual pattern. This helps in identifying weaker orientation candidates obscured by stronger ones. The connected components identified during preprocessing [Section 3.2
, step (3)] can be used to guide this masking or analyze remaining unidentified regions. The figure-of-merit approach, summing intensity over expected peak locations even if some are missing or weak, inherently handles cases with low numbers of detected peaks or missing reflections, a challenge for methods relying on inter-peak angles. This iterative masking procedure is particularly crucial for disentangling heavily overlapped signals, as will be demonstrated in the successful indexing of 28 overlapping orientations in the complex polycrystalline Al-wire example in Section 4
(Fig. 8).
Using the full orientation space instead of only the fundamental zone of the for simulation enables LaueMatching to apply another filter to the solutions; each unique orientation must be matched multiple times and orientations below this criterion are filtered out. This increases the execution time for searching by up to 24 times (for cubic crystal systems, the fundamental zone is 24 times smaller than the full orientation space) and adds duplicate solutions, but it has been observed to be very robust by removing low-quality or spurious matches. This redundancy check enhances the robustness compared with methods that might identify a single, potentially spurious, match. This is a deliberate methodological choice. While the is used initially to determine the list of allowed reflections, we do not restrict the search to the fundamental zone. Instead, searching the full orientation space allows us to use the discovery of multiple symmetry-equivalent orientations as a powerful filter for validation, which significantly enhances the robustness of the final result by eliminating spurious matches.
The process optimizes the orientation parameters and, optionally, selects lattice parameters by maximizing the figure of merit (F) using the NLopt non-linear optimization library (Johnson, 2025
). The optimal parameters are determined automatically by the optimization algorithm, which iteratively seeks the values that maximize the figure of merit. In a white-beam Laue experiment, a change in a lattice parameter is indistinguishable from a scaling of the incident photon energies. Because the energy for each reflection is not measured, this ambiguity prevents a full unconstrained refinement of the unit-cell volume. Therefore, LaueMatching refines lattice parameters under a constraint of constant unit-cell volume (e.g. by only optimizing the c/a ratio for hexagonal close-packed structures). The overall experimental geometry (described by vectors and
) is considered fixed during indexing, having been determined in a prior calibration step. The number of diffraction peaks for matching is increased up to
during to detect weaker diffraction peaks.
4. Experimental verification
Laue datasets from Ni, Al and samples were collected at the Advanced Photon Source using the Laue microdiffraction station 34-ID-E. A polychromatic X-ray beam (7–30 keV) from an undulator source is incident on a polycrystalline sample. The simulation range (6–30 keV, see Section 2
) was chosen to be slightly wider to ensure capture of all potential peaks near the experimental energy bandpass. A Laue diffraction pattern is formed on the 2D detector (PerkinElmer, matrix with square pixels of 200 µm), positioned ∼500 mm above the sample at a scattering angle centered near 2θ
90°. Experiment parameters and lattice parameters for each sample are given in Table 1
. LaueMatching was run with a candidate orientation list with orientation spacing, consisting of 100 million orientations. Lattice parameter was switched off for all datasets except for the
sample.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The first example of an Ni sample with three grain orientations, acquired without (Gürsoy et al., 2022
), is shown in Fig. 6
. All three orientations were identified using LaueGo (Tischler, 2014
). LaueMatching was able to identify the same three weak-signal orientations with only 70%, 60% and 30% of expected peaks detected on the pattern, with 14, 12 and 7 peaks identified for each corresponding orientation, respectively. The misorientation angles between the solutions from the two methods (LaueMatching and LaueGo) were exceptionally low – ,
and
, respectively – demonstrating excellent agreement.
| Figure 6 Diffraction pattern of an Ni sample with three indexed orientations. The fitted peak positions are overlaid as boxes colored according to refined orientations from LaueMatching on the cleaned diffraction pattern. Note the lack of any obvious zones for any orientation. |
The second example consists of an sample with two grain orientations, where one orientation is a crystallographic twin of the other; this specifically tests the handling of twins, which present a unique challenge because some hkls are shared between the two orientations ( O1 and O2) (Fig. 7
). The ideal misorientation between crystallographic twins is 60 around 〈111〉 for face-centred cubic structures. Three of the shared hkls, 753, 846 and 113 (113 in O1 is the same as 717 in O2), could be resolved by using an advanced pattern-processing technique such as watershed (Sharma et al., 2012
). However, 135, 246 and 133 (133 in O1 is the same as 11 5 5 in O2) are indistinguishable even using watershed. LaueMatching successfully identified the two orientations and assigned the correct indices to each peak. This demonstrates the robustness of LaueMatching using the correlative approach. LaueMatching successfully assigned the shared hkls to the two orientations. The misorientation between O1 and O2 was 59.978 around the [111] direction. Overall, 24 peaks were assigned to O1 and 21 to O2.
| Figure 7 Diffraction pattern of an Ni sample with two indexed orientations, where one is the crystallographic twin of the other. The fitted peak positions are overlaid as boxes colored according to refined orientations from LaueMatching on the cleaned diffraction pattern. |
In the third example, a Laue diffraction pattern was acquired on an wire without the diffraction signal from multiple grains superimposed significantly, creating a complex pattern typical of polycrystalline aggregates measured without as shown in Fig. 8
. LaueMatching found 28 separate grain orientations in the pattern, illustrating the ability to resolve a high number of overlapping orientations within a single pattern. The validity of these 28 orientations was confirmed by comparing them with results obtained using LaueGo on corresponding depth-resolved data (acquired up to 300 µm depth), with all orientations matching within a misorientation tolerance. Successfully resolving such a high density of orientations, ranging from strongly diffracting grains to weaker ones (indicated by the range of 5–19 peaks assigned to grains), highlights the effectiveness of the correlation approach combined with the iterative masking procedure (described in Section 3
) in disentangling heavily overlapped signals.
| Figure 8 Diffraction pattern of an Al sample acquired without depth resolution, resulting in heavily overlapped signals from multiple grains. The fitted peak positions for 28 distinct orientations identified by LaueMatching are overlaid as colored boxes, demonstrating the algorithm's ability to index high-multiplicity patterns common in polycrystalline samples. |
Next, LaueMatching was used on a diffraction pattern collected using an sample (Liu et al., 2013
), demonstrating indexing of a more complex (orthorhombic, space group 4) crystal structure and the optional lattice parameter refinement capability. Fig. 9
shows the diffraction pattern. LaueMatching was run using an intentionally deviated lattice parameter, shown in Table 1
, up to 5% from the reference value in the literature (Tezuka et al., 2013
), and the unit-cell volume was conserved. LaueMatching was able to detect two orientations, separated by . The successful indexing of this complex orthorhombic structure, even starting from intentionally deviated lattice parameters, highlights the effectiveness of the optional constant-volume lattice refinement capability described in Section 3.3
. The two orientations were assigned 206 and 81 peaks. The term for the two orientations was 57 735 and 16 888, respectively, indicating that the second orientation had a much weaker signal. Furthermore, Table 1
shows that the refined lattice parameter was within 0.5% of the reference value (Tezuka et al., 2013
). The details of lattice parameter refinement are given in Section 3.3
.
| Figure 9 Diffraction pattern of an |
Finally, to provide a quantitative benchmark against a known ground truth, a simulated diffraction pattern was generated using the same experiment configuration and as the Ni samples with 19 randomly chosen orientations. The simulation involved computing diffraction peak positions on the detector with an energy range of 6–30 keV and randomly discarding between 30 and 60% of the peaks. The positions of the remaining peaks were randomly perturbed by up to half a pixel, and Gaussian peaks were added to the diffraction pattern at each peak position with random heights up to 16 384 counts, covering the full 14-bit of a simulated detector. LaueMatching was run to detect orientations with a minimum of 30% of expected peaks. As shown in Fig. 10
, all 19 orientations were detected, with 6–15 peaks assigned to each orientation. Fig. 11
(a) shows the misorientation angle between the input and refined orientations. All angles are in degrees. The resulting misorientation angles were exceptionally low, with all 19 orientations matching the ground truth to within , highlighting the high precision of the refinement algorithm. The mean misorientation angle is
, while the minimum misorientation angle is
. Such low misorientation angles highlight the strength of LaueMatching, which can robustly refine orientations without requiring the precise fitting and centroiding of individual diffraction peaks. Fig. 11
(b) shows the difference in the computed position of diffraction peaks according to input and refined orientations. Even though the diffraction peaks were randomly displaced by up to half a pixel before running LaueMatching, the orientations detected using LaueMatching result in a computed diffraction signal located within pixels, on average, from the diffraction signal computed from the input orientations. Achieving such high accuracy, even with deliberately introduced peak-position noise (up to half a pixel) and missing peaks in the input simulation, underscores the algorithm's resilience to typical experimental imperfections and its ability to converge correctly without precise initial peak fitting.
| Figure 10 Simulated diffraction pattern of an Ni sample with 19 simulated orientations. All 19 orientations were successfully indexed. The fitted peak positions are overlaid as boxes colored according to refined orientations from LaueMatching on the simulated diffraction pattern. The simulation and reconstruction parameters are given in Table 1 |
| | Figure 11 For the simulation shown in Fig. 10 |
In each of the examples above, LaueMatching was run on two different systems: one workstation with 64 CPU cores of AMD EPYC 9174F CPUs and another workstation with a NVIDIA H100 GPU with 80 GB RAM. The single-pattern runtime of LaueMatching was similar on both systems. The Ni and Al examples (cubic structure, ) took ∼0.2 s to index, and the
example (orthorhombic structure,
) took ∼1 s to run. This base time scales with
, which determines the size and complexity of the SimulationFile. To approximate performance on more common hardware, LaueMatching was run on the AMD EPYC 9174F workstation utilizing only four of its 64 CPU cores for the cubic test cases. Indexing took 3.77 s in this scenario, a time comparable to execution on typical workstations or laptops.
The size of the SimulationFile is critical for determining parallel processing capabilities on memory-limited hardware like GPUs. For the cubic systems (Ni, Al), the SimulationFile was 12 GB, while for the more complex orthorhombic system (), it was 72 GB (stored as uncompressed binary files). On the NVIDIA H100 GPU with 80 GB RAM, the available memory dictates how many instances can run concurrently per GPU.
Given that each Laue diffraction pattern can be indexed independently, significant throughput gains are possible on multi-GPU systems. For the cubic case, the 12 GB file size allows six instances of LaueMatching to be loaded concurrently on a single H100 GPU (6 processes × 12 GB per process = 72 GB, fitting within the 80 GB RAM limit). Therefore on a supercomputer node like those on Polaris at the Argonne Leadership Computing Facility (https://www.alcf.anl.gov/polaris) equipped with eight such GPUs, a total of 48 processes (6 processes per GPU × 8 GPUs) can run in parallel. This configuration enables processing of up to ∼240 frames per second (FPS) for cubic structures.
However, for the more complex orthorhombic structure, the larger 72 GB SimulationFile only allows one instance per GPU to fit within the 80 GB RAM. Consequently, on an eight-GPU node, only eight processes can run concurrently. This results in a processing speed of up to 8 FPS for such complex crystal structures. These processing speeds facilitate near-real-time feedback during data acquisition or enable the efficient post-processing of large-scale microstructural maps containing thousands or millions of diffraction patterns.
Generation of the library of diffraction signals (SimulationFile) itself took 189 and 640 s for the cubic and orthorhombic crystal structures, respectively. Importantly, this SimulationFile needs to be generated only once for a given experiment configuration and representing a one-time computational cost amortized over potentially millions of analyzed patterns.
5. Limitations and future work
While LaueMatching demonstrates significant robustness, its performance relies on the quality and density of the pre-computed library. Generating dense libraries for very complex structures or extremely large orientation spaces can be computationally intensive, although this is a one-time cost per configuration. The effectiveness of the blurring and correlation approach may decrease in scenarios with extremely low signal-to-noise ratios where diffraction spots are barely distinguishable from background fluctuations after preprocessing. Similarly, the method's performance relies on the ability to adequately subtract the background during preprocessing. In cases with highly non-uniform backgrounds, strong sample fluorescence or detector artefacts that are not well removed by the chosen background-estimation method, the remaining residual intensity could interfere with the correlation metric. That could potentially reduce sensitivity, particularly for weak signals, or impact accuracy. To mitigate this, the preprocessing workflow in LaueMatching was specifically designed for robust background rejection. As demonstrated in the diverse experimental and simulated datasets, the combination of repeated median filtering and intensity thresholding proved highly effective for isolating the diffraction signal. The accuracy of lattice parameter is limited by the energy bandwidth and geometric calibration precision inherent in Laue diffraction. Furthermore, while the correlation approach offers robustness, extreme inaccuracies in the initial geometric calibration could potentially impact orientation accuracy, though less severely than methods reliant on precise peak metrology. Moreover, while the method is designed to be broadly applicable, the experimental validation in this work was performed on data from a single beamline; future work will involve testing LaueMatching on datasets from other facilities to confirm its robustness across different instrument geometries and sources. Future work could also explore adaptive grid strategies for library generation, integrating more sophisticated noise modeling and investigating alternative figures of merit tailored for specific challenging conditions, such as extremely low signal-to-noise ratios or differentiating between near-degenerate orientations.
6. Summary
In summary, we have developed and introduced LaueMatching, a novel high-throughput indexing algorithm that robustly solves Laue diffraction patterns by directly correlating them against a pre-computed library of simulations. The method leverages a pre-computed library of simulated diffraction signals covering a dense sampling of orientation space. Experimental patterns are efficiently pre-processed to enhance diffraction features and suppress background before being directly correlated with the library entries using a figure of merit based on summed intensity at expected peak locations. This correlation approach intrinsically handles challenges like weak signals, peak overlap and missing reflections that hinder traditional peak-fitting methods. Subsequent refinement optimizes orientation and, optionally, lattice parameters. We demonstrated LaueMatching's capabilities through validation on various experimental datasets, including multi-grain, twinned and complex crystal structures (Ni, Al, ), as well as on simulated patterns with known ground truth, consistently achieving rapid and highly accurate orientation determination. Its computational efficiency, especially on GPUs, enables high-speed processing suitable for large mapping experiments. Overall, LaueMatching provides a powerful and accessible tool for the materials characterization community. The code implementing this approach is available at https://github.com/AdvancedPhotonSource/LaueMatching.
Acknowledgements
HS would like to acknowledge discussions with Jun-Sang Park from the Advanced Photon Source to compute uniformly spaced orientations.
Funding information
This research used resources of the Advanced Photon Source, a US Department of Energy (DOE) Office of Science user facility at Argonne National Laboratory, and is based on research supported by the US DOE Office of Science–Basic Energy Sciences under contract No. DE-AC02-06CH11357.
References
Barabash, R. & Ice, G. (2014). Strain and Dislocation Gradients from Diffraction. Imperial College Press. Google Scholar
Barabash, R., Ice, G. E., Larson, B. C., Pharr, G. M., Chung, K.-S. & Yang, W. (2001). Appl. Phys. Lett. 79, 749–751. Web of Science CrossRef CAS Google Scholar
Chung, J.-S. & Ice, G. E. (1999). J. Appl. Phys. 86, 5249–5255. Web of Science CrossRef CAS Google Scholar
Dejoie, C. & Tamura, N. (2020). J. Appl. Cryst. 53, 824–836. Web of Science CrossRef CAS IUCr Journals Google Scholar
DIPlib (2025). DIPlib/diplib, https://github.com/DIPlib/diplib. Google Scholar
Gevorkov, Y., Barty, A., Brehm, W., White, T. A., Tolstikova, A., Wiedorn, M. O., Meents, A., Grigat, R.-R., Chapman, H. N. & Yefanov, O. (2020). Acta Cryst. A76, 121–131. Web of Science CrossRef IUCr Journals Google Scholar
Gupta, V. K. & Agnew, S. R. (2009). J. Appl. Cryst. 42, 116–124. Web of Science CrossRef CAS IUCr Journals Google Scholar
Gürsoy, D., Sheyfer, D., Wojcik, M., Liu, W. & Tischler, J. Z. (2022). J. Appl. Cryst. 55, 1104–1110. Web of Science CrossRef IUCr Journals Google Scholar
Huang, V. W., Liu, Y., Raghothamachar, B. & Dudley, M. (2023). J. Appl. Cryst. 56, 1610–1615. CrossRef CAS IUCr Journals Google Scholar
Ice, G. E. & Larson, B. C. (2000). Adv. Eng. Mater. 2, 643–646. Web of Science CrossRef CAS Google Scholar
Johnson, S. G. (2025). stevengj/nlopt, https://github.com/stevengj/nlopt. Google Scholar
Johnstone, D. N., Martineau, B. H., Crout, P., Midgley, P. A. & Eggeman, A. S. (2020). J. Appl. Cryst. 53, 1293–1298. Web of Science CrossRef CAS IUCr Journals Google Scholar
Kirstein, T., Petrich, L., Purushottam Raj Purohit, R. R. P., Micha, J. S. & Schmidt, V. (2023). Materials 16, 3397. CrossRef PubMed Google Scholar
Kou, J. & Chen, K. (2024). J. Appl. Cryst. 57, 539–551. CrossRef CAS IUCr Journals Google Scholar
Krakow, R., Bennett, R. J., Johnstone, D. N., Vukmanovic, Z., Solano-Alvarez, W., Lainé, S. J., Einsle, J. F., Midgley, P. A., Rae, C. M. F. & Hielscher, R. (2017). Proc. R. Soc. London Ser. A 473, 20170274. Google Scholar
Larson, B. C. & Levine, L. E. (2013). J. Appl. Cryst. 46, 153–164. Web of Science CrossRef CAS IUCr Journals Google Scholar
Li, Y., Chen, K., Dang, X., Zhang, F., Tamura, N., Ku, C.-S., Kang, H. & Wenk, H.-R. (2020). J. Appl. Cryst. 53, 1392–1403. Web of Science CrossRef CAS IUCr Journals Google Scholar
Liu, F., Budai, J. D., Li, X., Tischler, J. Z., Howe, J. Y., Sun, C., Meltzer, R. S. & Pan, Z. (2013). Adv. Funct. Mater. 23, 1998–2006. CrossRef CAS Google Scholar
Liu, W., Ice, G. E., Larson, B. C., Yang, W., Tischler, J. Z. & Budai, J. D. (2004). Metall. Mater. Trans. A 35, 1963–1967. Web of Science CrossRef Google Scholar
Petit, J., Castelnau, O., Bornert, M., Zhang, F. G., Hofmann, F., Korsunsky, A. M., Faurie, D., Le Bourlot, C., Micha, J. S., Robach, O. & Ulrich, O. (2015). J. Synchrotron Rad. 22, 980–994. Web of Science CrossRef CAS IUCr Journals Google Scholar
Plancher, E., Petit, J., Maurice, C., Favier, V., Saintoyant, L., Loisnard, D., Rupin, N., Marijon, J.-B., Ulrich, O., Bornert, M., Micha, J.-S., Robach, O. & Castelnau, O. (2016). Exp. Mech. 56, 483–492. Web of Science CrossRef Google Scholar
Purushottam Raj Purohit, R. R. P., Tardif, S., Castelnau, O., Eymery, J., Guinebretière, R., Robach, O., Ors, T. & Micha, J.-S. (2022). J. Appl. Cryst. 55, 737–750. Web of Science CrossRef CAS IUCr Journals Google Scholar
Quey, R., Villani, A. & Maurice, C. (2018). J. Appl. Cryst. 51, 1162–1173. Web of Science CrossRef CAS IUCr Journals Google Scholar
Seret, A., Gao, W., Juul Jensen, D., Godfrey, A. & Zhang, Y. (2022). J. Appl. Cryst. 55, 1085–1096. Web of Science CrossRef CAS IUCr Journals Google Scholar
Sharma, H., Huizenga, R. M. & Offerman, S. E. (2012). J. Appl. Cryst. 45, 693–704. Web of Science CrossRef CAS IUCr Journals Google Scholar
Singh, S. & De Graef, M. (2016). Modell. Simul. Mater. Sci. Eng. 24, 085013. Web of Science CrossRef Google Scholar
Singh, S., Ram, F. & De Graef, M. (2017). Microsc. Microanal. 23, 212–213. CrossRef Google Scholar
Tamura, N. (2014). Strain and Dislocation Gradients from Diffraction: Spatially Resolved Local Structure and Defects, edited by R. Barabash & G. Ice, ch. 4, pp. 125–155. London: Imperial College Press. Google Scholar
Tamura, N., Celestre, R. S., MacDowell, A. A., Padmore, H. A., Spolenak, R., Valek, B. C., Meier Chang, N., Manceau, A. & Patel, J. R. (2002). Rev. Sci. Instrum. 73, 1369–1372. Web of Science CrossRef CAS Google Scholar
Tezuka, K., Tokuhara, Y., Wakeshima, M., Shan, Y. J., Imoto, H. & Hinatsu, Y. (2013). Inorg. Chem. 52, 12972–12979. CrossRef ICSD CAS PubMed Google Scholar
Tischler, J. Z. (2014). Strain and Dislocation Gradients from Diffraction: Spatially Resolved Local Structure and Defects, edited by R. Barabash & G. Ice, ch. 10, pp. 358–375. London: Imperial College Press. Google Scholar
Vasilev, E., Popov, D., Somayazulu, M., Velisavljevic, N. & Knezevic, M. (2023). Sci. Rep. 13, 2173. CrossRef PubMed Google Scholar
Wittwer, M. & Seita, M. (2022). npj Comput. Mater. 8, 8. Web of Science CrossRef Google Scholar
Zhang, F. G., Bornert, M., Petit, J. & Castelnau, O. (2017). J. Synchrotron Rad. 24, 802–817. Web of Science CrossRef CAS IUCr Journals Google Scholar
Zhang, Y., Porter, J. N., Wilkin, M. J., Harder, R., Cha, W., Suter, R. M., Liu, H., Schnebly, L., Sandberg, R. L., Miller, J. A., Tischler, J., Pateras, A. & Rollett, A. D. (2023). J. Synchrotron Rad. 30, 796–806. CrossRef CAS IUCr Journals Google Scholar
This is an open-access article distributed under the terms of the Creative Commons Attribution (CC-BY) Licence, which permits unrestricted use, distribution, and reproduction in any medium, provided the original authors and source are cited.

journal menu
access



