Simultaneous bright- and dark-field X-ray microscopy at X-ray free electron lasers

The structures, strain fields, and defect distributions in solid materials underlie the mechanical and physical properties across numerous applications. Many modern microstructural microscopy tools characterize crystal grains, domains and defects required to map lattice distortions or deformation, but are limited to studies of the (near) surface. Generally speaking, such tools cannot probe the structural dynamics in a way that is representative of bulk behavior. Synchrotron X-ray diffraction based imaging has long mapped the deeply embedded structural elements, and with enhanced resolution, dark field X-ray microscopy (DFXM) can now map those features with the requisite nm-resolution. However, these techniques still suffer from the required integration times due to limitations from the source and optics. This work extends DFXM to X-ray free electron lasers, showing how the \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$10^{12}$$\end{document}1012 photons per pulse available at these sources offer structural characterization down to 100 fs resolution (orders of magnitude faster than current synchrotron images). We introduce the XFEL DFXM setup with simultaneous bright field microscopy to probe density changes within the same volume. This work presents a comprehensive guide to the multi-modal ultrafast high-resolution X-ray microscope that we constructed and tested at two XFELs, and shows initial data demonstrating two timing strategies to study associated reversible or irreversible lattice dynamics.


Introduction
Across materials science -from dislocation junctions strengthening materials to interstitial defects fracturing batteries over many charge cycles -defects change how materials respond to their surroundings 1,2 .Point defects are routinely used to finely tune material properties 3 , and defects extending across many unit cells (mesoscale) can tune the properties and performance of thermal or electronic materials, among others 4,5 .For example, grain boundaries in bismuth selenide have been shown to create nanodomains that enhance their thermoelectric efficiency by orders of magnitude by decoupling the mean-free-paths of electrons and phonons 6 .Similarly, in metals grain boundaries and dislocation networks govern bulk properties such as strength and ductility 7 .At this time, our understanding and control of mesoscale defects and domains in bulk materials is primarily limited by our ability to probe their dynamics in a manner that is representative of bulk properties 8 .The multiscale defect or grain structure often encountered imply that sample thicknesses of tens or hundreds of micrometers are required for representative sampling.Electron microscopy, field-ion microscopy and atom probe tomography can resolve defect cores with atomic resolution.However, they are intrinsically near surface probes and they rely on long raster scans to generate 3D maps, during which sample conditions must be fixed 9,10 .Without in-situ measurement tools that can resolve how mesoscopic defects with nanometer cores interact to form large 3D networks that evolve over hundreds of micrometers, our understanding of the dynamics has been limited to theory that is yet untested at the microscopic scale.
The primary challenge in detecting the mesoscopic structure lies in the wide range of length-and time-scales that must be probed to fully interpret the system.Lattice defects are comprised of local disruptions in the crystal packing -either a truncated plane (dislocation) or missing/extra atom (vacancy, interstitial), or truncated domain of the crystal (grain boundary).While the cores of defects have Å-nm lengthscales, the long-range distortions from them that span micrometers to millimeters map key interactions that alter the macroscopic properties 5,11,12 .When these defects interact, the velocity of the property-transforming events can span from ballistic dynamics (ps-ns) through cumulative degradation (months to years), spanning >15 decades of timescales.A measurement tool to spatially and temporally resolve the evolution of plasticity in-situ and, specifically, the interactions between adjacent strain or defects, requires sub-nanosecond imaging with nm-resolution 13,14 .
X-rays have been demonstrated to have the necessary penetration power to access this regime.The information encoded in these X-ray images is dictated by the material attribute responsible for the light-matter interaction that produces the beam being imaged.Based on their contrast mechanisms, X-ray microscopes can largely be divided into three modalities: spectral imaging, monochromatic phase/amplitude imaging, and diffraction-contrast microscopy 13 .Spectral imaging gives contrast that delineates the elemental composition and sometimes the oxidation state, by scanning a microscopy measurement across an absorption or emission band of the material.Monochromatic X-ray microscopy at photon energies far from an absorption or emission peak have contrast mechanisms described by the amplitude (e.g.radiography) or phase (e.g.ptychography) of the light that has traversed the material.Those techniques offer information about the density, thickness, and porosity of the material.Finally, diffraction contrast microscopes map heterogeneity in the crystallography of the sample.While the contrast mechanism defines the materials-specific information contained in X-ray images, the resolution vs field of view are set by the imaging optics.
While the contrast mechanism defines the materials-specific information contained in X-ray images, the resolution vs field of view are set by the imaging optics.Scanning microscopy is performed by focusing the X-ray beam to a small spot, then rastering the spot across the sample to collect spatially-mapped signals; for this approach, the resolution is set by the beam's spot size while the field of view is set by the number of points in the scan.Tomographic microscopy requires a different approach to raster scans, collecting images from different rotational perspectives for a roughly cylindrical sample volume; the corresponding image stacks are compiled and Radon transformed to form the full 3D imaged volume.By contrast, full-field imaging collects information about the entire sampling volume in a single acquisition, with projections along one of the three sample dimensions.Near-field imaging (e.g.radiography, topography) captures full-field images very close to the sample, with a field of view limited by the detector or beam size and a resolution set by the Fresnel number of the image features.Magnified imaging with focusing optics that map the object onto its image plane in the far-field.Images collected along the X-ray transmitted beam (transmission X-ray microscopy, TXM) are collected along the bright-field (BF), and map the attenuation of the beam from absorption (and XRD in special cases).Conversely, images collected along the diffracted beam are produced by the X-rays scattering off of the undisrupted periodicity native to a given lattice plane, thereby mapping the crystallographic information along a specific symmetry of a crystal.These types of dark-field (DF) images result in spatial maps of the disruptions to crystalline order in the lattice (i.e. the defects).
So called Dark-Field X-ray Microscopy (DFXM) is a full-field magnified microscope that acquires images by placing an X-ray objective lens along the X-ray diffracted beam.DFXM captures crystallographic distortions, i.e. the strain and mosaicity of the lattice, with a spatial resolution of 30-150 nm, with strain resolution of 10 −5 and mosaicity (orientation) resolution of 10 −3 radians.Recent work has used DFXM to characterize deformation texture 15 , dislocation structures 16 , domain boundary migration in ferroelectrics 17 , fatigue in polycrystalline metals 18 , among other phenomena.We recently established time-resolved DFXM at the European Synchrotron Radiation Facility (ESRF) and demonstrated its utility with a first-ever study of collective dislocation dynamics deep inside bulk aluminum from 97 − 99% of the melting temperature 19 .Today, DFXM has a temporal resolution that is limited by the integration time required to acquire the images with synchrotron radiation; access to material dynamics at sub-microsecond timescales requires more brilliant X-ray sources.
The time resolution of X-ray microscopy tools is dictated by the acquisition scheme used for the measurement.For reversible and reproducible dynamics, a pump-probe modality may be used, whereby a "pump" excites a material into a transient state, then probe at some time-delay afterwards interrogates the relaxation of that state over fs-ps timescales, via millions of successive excitations that span all pump-probe delays and appropriate signal averaging.By contrast, irreversible processes require single-shot acquisitions with sufficiently high frame rates and signal to noise that they may gather all the relevant information about the system in the time that follows a single excitation pulse.Full-field imaging approaches are required to study irreversible processes.
Since the development of high photon energy (a.k.a."hard") X-ray free electron lasers (XFELs), ultrafast X-ray science has had breakthroughs across physics, engineering, biology and beyond as optical and synchrotron techniques have become achievable with single-shot acquisition capabilities 20 .With 10 12 photons per pulse, XFELs have shifted static techniques that were hindered by their integration times to now become possible via ultrafast pump-probe measurements using femtosecond single-shot measurements could overcome issues of collection time and cumulative radiation damage 21 .For structural imaging, holography and X-ray coherent diffractive imaging (XCDI) have demonstrated this type of spatiotemporal resolution at XFEL sources 22,23 , but the necessary apertures and foci at the sample have prevented these methods from capturing a sufficiently large field-of-view to capture statistical populations of nanoscale features 24 .While Bragg-XCDI has been able to spatially resolve the strain fields in nanoparticles 25 , the same lattice-resolution measurements have not been extended to real-space X-ray imaging.XFEL imaging in real-space (i.e. in x, y, z coordinates as opposed to XCDI's Fourier transformed raw images) has only been performed in the transmitted beam with associated density contrast 26 .This makes it insensitive to the sparse defects or anomalous strain fields that initiate plastic transformations or other macroscopic processes.To statistically probe the distortions that initiate large-scale material transformations, we need a technique with high spatiotemporal resolution and a large field-of-view that is sensitive to both density variation and localized strain fields inside the crystals.
To address this challenge, in this work, we introduce DFXM at XFELs and present a multi-modal setup that enable simultaneous density mapping using BFXM (in the TXM geometry).Using 32-fs X-ray pulses, local structural information is probed 13 orders of magnitude faster than previously accessible 19 .From experiments first at the the Pohang Accelerator Lab (PAL, 2019) and then at the Linac Coherent Light Source (LCLS, 2021), we present the instrumentation we have developed to build, align, acquire data, and analyze the results from the XFEL version of DFXM.To enhance the information-content of each frame and enable single-shot acquisitions of irreversible systems, we include simultaneous bright-and dark-field X-ray microscopy (BFXM & DFXM), as they afford complementary information about the strain states and defect populations in sample.In these experiments, we benchmark our measurements using diamond single crystals.We first present our instrument design, including important trade-offs that must be considered when designing XFEL-DFXM experiments.We then present the analysis approaches we used for our data analysis, and present the types of data that may be collected at each of our 4 detectors in the imaging setup.We conclude with a discussion about the future opportunities for this instrument at XFELs around the world, across many fields of science.

Dark-Field X-ray Microscopy Design
The DFXM geometry and the real-and reciprocal-space coordinate systems as used at synchrotrons are defined in Refs. 27,28 In this section, we introduce the design, coordinate systems, and axes for scanning, noting the key differences between the established synchrotron coordinate systems and the XFEL one for clarity.We use the same notation here for consistency, with one main exception related to the direct space: the XFEL is defined to follow the optical conventions that defines the ẑℓ axis as the beam's propagation direction (in the laboratory coordinate system).Given the complexity of the DFXM experiments, we detail a conversion from the synchrotron to XFEL systems here.For full understanding of how these coordinate systems convert to intensity and contrast mechanisms, see our previous work 27,29,30 .The full microscope setup in this orientation is shown in Figure 1, with diffraction in the horizontal scattering geometry used at XFELs.
The analytical form to convert an arbitrary vector ⃗ v from the laboratory coordinate system used in Ref. 27 ) into the XFEL one described in this work is As shown in Figure 1, the laboratory coordinate system is defined by {x ℓ , y ℓ , z ℓ } and rotations about those axes, {R x ℓ , R y ℓ , R z ℓ }, defined by the Poynting vector of the incident beam, ⃗ k i .When the beam reaches the sample, it interacts with the lattice planes green), and ω (magenta), the axial strain axis, 2∆θ (red), the azimuthal detector position, η (yellow), and the alignment rotation axis, µ (brown).The circular plot at the bottom illustrates how the µ motor is required to rotate all scanning stages from their initial orientations, R x ℓ , R y ℓ , and R z ℓ in the laboratory coordinate system, into the rotated sample coordinate system, {x s , y s , z s } for which the diffraction vector ⃗ Q hkl are aligned to the ẑs axis.(b) We also show images from representative points along a rocking-curve, showing intensity indicating the spatial populations of each point along the lattice distortion field for the same spatial plane in the sample.Images in this stack were collected from single-crystal aluminum DFXM at the ESRF synchrotron at ID06-HXM.
in the relevant grain based on the orientation of the lattice.We have previously defined a crystal coordinate system to describe how the crystallographic vectors, ⃗ a, ⃗ b, and ⃗ c map onto the lab system using {x c , y c , z c }, such that the transform matrix M ℓ− →c converts any arbitrary vector from the lab to crystal system 29 .
After traversing the sample, the diffracted beam propagates along a diffracted wavevector, ⃗ k d ||ẑ i , that defines the diffraction imaging coordinate system, {x i , y i , z i }, based on rotation about the ŷℓ -axis.
With DFXM, subtle changes to the contrast mechanism are provided by minor angular offsets of the diffraction vector from the nominal value for the undeformed lattice ⃗ Q hkl based on crystal rotations or by varying the scattering angle 2θ 28 .The latter motion requires a coherent translation of the far-field (ff) detector and imaging lenses along the 2θ arc.As can be seen in Fig. 1, a combined 2∆θ -φ scan will probe the local axial strain.The local variation in crystal orientation, as expressed by the pole figure of the reflection (a.k.a. the mosaicity), is probed by varying the goniometer settings, corresponding to rotations R y s and R z s .These are known as rocking and rolling scan, respectively.
The XFEL instrument constraints currently require diffraction in the horizontal scattering plane due to space, polarization, and infrastructure constraints, as shown by the orange plane in Fig. 1.Since ⃗ k i and ⃗ k d are defined in the horizontal plane, the 2θ value and diffraction plane constrains the ⃗ Q hkl vector orientations that may be probed for crystals in this microscope.As shown by the blue plane in Fig. 1, the {ω, χ, φ } rotation vectors that define the goniometer are explicitly defined in reference to the direction of ⃗ Q hkl , meaning that they define the relationship between the crystallographic and sample coordinate systems.If the sample's surface normal was already cut with Q hkl aligned to the surface normal of the crystal, this describes a rotation of θ about the ŷℓ axis in the lab system.We note that the sample coordinate system {x s , y s , z s } describes the motorized axes with respect to the surface normal of the sample with respect to the goniometer, while a separate crystallographic coordinate system, {x c , y c , z c }, allows one to account for the crystallographic orientation of that crystal with respect to its uvw vectors (scaled inverse of hkl).The components of M ℓ− →s detail the conversion from the rotations about the {x ℓ , y ℓ , z ℓ } system into the goniometer axes, {ω, χ, φ }, as is inspired by Busing and Levy 31 .
As in previous work, DFXM can collect image series' along scans that sample reciprocal space while rotating the crystal about ω, χ or φ ; by translating the lens and detector along 2θ and η; or by translating the sample along z s .It is worth noting that, while only 2 rotation stages are technically required to access the full sphere of rotation, the precision of this experiment's high sensitivity necessitates rotation stages about 4 axes for accurate scanning.As described in Poulsen, et al., 27,29 a bottom rotation stage, µ, is required to orient the 3-axis Eulerian cradle (ω, χ, φ ) to align the ω rotations to the ⃗ Q vector.The vector defining the relationship between each coordinate system is given for the XFEL coordinate system in Table 1.We note that in contrast to the previous work, χ does not rotate about the incident beam axis, z ℓ , but instead rotates about an axis that is rotated by an angle of θ with respect to ⃗ k i , to ensure the rotations occur about the principal axes of reciprocal space.We note that 2θ describes the scattering angle probed by the diffracting plane, while 2∆θ describes the strain scanning axis required to probe the material via θ -2θ scans.
Lab System Sample System Crystal System Imaging System ki = ẑℓ n = ẑs Qhkl = ẑc kd = ẑi Table 1.Coordinate systems to describe DFXM with relevant defining characteristics, given in the XFEL coordinate system that differs from the one described in Poulsen et al. 29 .

Experimental methods
We detail in this section the experimental methods we used to implement DFXM at the PAL-XFEL and subsequently at the LCLS.This section details the full instrument design details to explain the intuition necessary to design the appropriate microscope for specific applications.We begin explaining the selection of beam parameters and upstream optics (Section 3.1), then proceed to explain an overall picture of the imaging optics and microscope specifications (Section 3.2).We follow this with a detailed description of the goniometer stages and the rationale for our design choices in that based on the precision required for the sample and objective alignments (Section 3.3).We then detail our choice of imaging detectors and our procedure for the calibration of those detectors in Section 3.4.We close with a description of our alignment cameras and overall alignment strategy, with detail on the impact of these alignments in interpretability of the results (Section 3.5).

Upstream Beam-Conditioning Optics
While the setup configurations differed slightly between experiments at the PAL-XFEL and the LCLS, both studied diamond single crystals to demonstrate proof of concept for the technique under different sample conditions.The PAL-XFEL experiment used a 9.7-keV X-ray pulse with ∼ 10 11 photons per 32-fs duration pulse at a 30-Hz repetition rate; we prefocused the beam to a 30×10-µm 2 spot at the sample.Our DFXM experiment at LCLS used a 10.1 keV X-ray pulse with 10 12 photons per 50-fs per pulse with a repetition rate of 30 Hz.The energy of each XFEL pulse was calibrated using the Intensity-Position Monitors (IPMs) installed into the XCS hutch, as described in 32,33 .The LCLS beam was prefocused using a stack of 1D and 2D Be Compound Refractive Lenses (CRLs) with varied radii of curvature (focusing power), placed 3.435-m upstream of the sample to horizontally focus the beam into a vertical line beam at the sample position.From front to back, the 9-lenslets in the stack were: of two 2D lenses of R = 100-µm , two 2D lenses of R = 500-µm , one 1D lens of R = 200-µm , three 1D lenses of R = 300-µm , and one 1D lens of R = 500-µm .In both experiments, the photon flux was calibrated for each pulse and used to normalize the resulting images to correct for beam fluctuations.Since our first experiment at PAL-XFEL informed our full design for the refined DFXM microscope designed for XFELs, we focus our instrumentation descriptions on the setup in full for the latter experiment at LCLS.At the LCLS, our experiment used a channel-cut Si monochromator to reduce the bandwidth to ∆E/E ∼ 10 −4 , with a beam divergence of 1.1 × 1.1µrad 2 .A monochromatic beam with a stable spectrum is essential to be able to acquire interpretable results with DFXM because fluctuations in the incident beam's photon energy change the d-spacing and orientation that are imaged by DFXM 29,30 , as we discuss fully in Section 3.5.After passing through prefocusing lenses, the resulting beam was apertured further with power slits and then cleanup slits to reduce the size of the focused line beam to its minimum 3.4 × 3805-µm dimensions at the sample (as measured via curve fitting of BFXM images).To observe the beam positioning and pump-probe overlap, we installed a removable scintillator at the sample position and a viewing camera in reflection mode on the upstream side of the sample.
When selecting prefocusing lenses, it is important to achieve the narrowest beam waist at the sample position to ensure minimal integration over the observation plane that comprises the image.Placing condenser lenses with low focal length near the entry-surface of the crystal achieves the narrowest waist in the x-direction, but can shorten the depth of focus, making the Rayleigh range over which the beam is a constant size much smaller.In general, we have found that at XFELs, the longer prefocusing distances tended to be required due to space constraints, however, this does limit the interpretability of the results in some systems.

Multi-Modal microscope design
After the X-ray pulse traversed the Bragg-oriented sample, its transmitted and {111} diffraction beam was imaged onto two far-field (FF) detectors, one along the transmitted and one along the diffracted beam (Fig. 2).Along the transmitted (direct) beam, TXM was installed.The imaging objective was a stack of N = 17 Be 2D CRLs (radius of curvature, R = 50-µm , distance between lenslet centers, T = 2-mm), corresponding to an effective focal length of 42 cm and a pupil aperture (FWHM) of 261 µm .The working distance (sample to entry of CRL) was set to d 1 = 47-cm while the distance from the exit-surface of the CRL to the detector was d 2 = 8.437-m (total sample-to-detector distance d tot = 8.941-m).From this follows a theoretical magnification of the X-ray beam of M = 18.4×.The relevant formalism for calculating the optical parameters are given in 27 .The stray unfocused light was blocked with 600-µm diameter pinholes at the front and exit surfaces of the CRL stack, cut from 1-mm thick copper.
For the DFXM imaging system, the CRL comprised N = 33 Be 2D CRLs (R = 50-µm , T = 2-mm), corresponding to an effective focal length of 20 cm and a pupil aperture (FWHM) of 370 µm.This objective was aligned with the center of the {111} diffracted beam.With d 1 = 23-cm and d 2 = 6.532-m (and total sample-to-detector distance d tot = 6.832-m), the calculated magnification is M = 27×.As the larger N stack for the DF imaging system produced a smaller effective aperture, we used smaller Cu pinholes of 300-µm diameter (1-mm thick) at the front and back faces of the stack to remove stray unfocussed light.
Long d 2 distances along both imaging systems attenuates the beams significantly if propagating through air.Attenuation was therefore mitigated using vacuum beam-tubes that spanned the longest possible extent of the d 2 beam path, though there was slight attenuation from the 125-µm thick kapton windows at each end.We placed a 50-µm thick sheet of aluminium foil at the front surface of our vacuum tube along the BFXM imaging arm to avoid saturating the detector with the unattenuated XFEL beam.In our case, the 2θ = 35 • limited the need to account for the polarization factor in our microscope design (P = 0.84), however, the coherence of the XFEL beam requires consideration for the polarization factor to ensure optimal signal to noise in the experiment 34 .Diamond single crystals cut with surface normals of [110] were placed into the interaction point with the XFEL beam; the 660-µm thick crystals were oriented to an angle of 37.5 • about the R y axis (i.e.rotated about y ℓ from being normal to the incident X-ray beam) in the direction opposite of the diffracting beam to meet the Bragg condition for the {111} plane.The 1D X-ray beam thus illuminated an angled but nearly planar sheet of 3.4×3805×1151-µm 3 volume in the sample, with the FWHM of the line focus of 3.4 µm .The region of interest (ROI) for each imaging system gave different views of the beam along the bright-field (BF) and dark-field (DF) imaging arms because of the different projection vectors, causing the integrated volumes differ between experiments.DF's diffraction projects the wavefront along a new wavevector, ⃗ k d (i.e.deflected it by 2θ in the horizontal plane).As such, the TXM images mapped the (x ℓ , y ℓ ) plane of the sample, integrating along the z ℓ -axis, while the DFXM images projected a map of the (z ℓ , y ℓ ) plane, integrating the images along x ℓ (the line-beam's narrowest waist).The numerical apertures, pinholes, and magnification of the two imaging systems made each one's field-of-view (FOV) differ slightly: TXM mapped 4×101-µm 2 , while DFXM mapped 700×200-µm 2 (or less, depending on the diffraction condition).
The DFXM had a total magnification of 54× (corresponding to 0.11 µm per pixel), while the TXM along the bright-field had a total magnification of 14× (corresponding to 0.44 µm per pixel).We note that the approximate magnification may be predicted based on the imaging equations and effective focal lengths described previously, however, since CRLs natively have aberrations, the actual magnification must be measured explicitly.At synchrotrons, this is often done either using resolution targets (e.g.Siemens stars, US Air Force Targets, TEM grids, etc.), or by moving translation motors to observe translation of the features on pixels.We note that at XFELs, the motorized approach is often highly inaccurate, as the precision, accuracy, and reproducibility of all motors are not always reliable down to the sub-µm lengthscales required by this experiment, and are subject to change based on the setup at any given implementation of the setup.As such, we strongly encourage the use of resolution targets, and used TEM grids (200-and 1500-mesh) for this work.Finally, we note the importance of understanding the orientation of the observation plane.As in X-ray topography (XRT), the contrast mechanism giving rise to image signal in DFXM arises from scattering along the diffraction vector of the lattice {Q hkl }.That said, the spatial plane that is imaged by DFXM is always rotated by an angle of θ with respect to the observation plane (as shown in Fig. 3b).

Goniometer Design
For quick alignment of this sensitive 2-path (TXM, DFXM) imaging experiment, we designed a custom goniometer to streamline the alignment and scanning precision.We defined our initial design criteria based on the points listed below: • Fully self-contained goniometer assembly for accurate pre-alignment before the XFEL beam turned on.
• Precise & reproducible positioning of sample translation (x s , y s , z s ) & rotation (χ, φ , ω) with sub-µm and 0.005 • precision, respectively.• Motor controls for fast translation between alignment targets (scintillators, resolution targets) and samples of interest (without manual realignment).• Rapid orientation of each crystal into its optimized Bragg condition in the horizontal scattering plane.
• Scanning & data acquisition capabilities to collect series' of images while scanning the sample & detector along x, z, χ, φ , ω, 2θ .• Independent motion control for each CRL stack along its local x i , y i , R x i , R y i with respect to the sample position along each imaging beam.• Viewing cameras near the Fourier plane of each imaging CRL stack for alignment (possible future aperturing opportunities).• Facile motion of the CRLs along an arc concentric with the samples for direct-beam alignment of both stacks.Based on the needs outlined above, we designed the goniometer and stage assemblies shown in Figure 2(a-b).We used a 12-axis goniometer, using (from top to bottom): 2 piezo motor translation stages (x, y) to position each sample of interest into the center of rotation for the rotation stages, 3 rotation stages to mimic an Eulerian cradle with rotation about the z, x, and y axes (i.e.R x , R y , R z ), 3 linear translation stages to center the pre-defined center of rotation into the center of rotation for the CRL carousel, and finally, a 2-axis linear translation stage (x,z) to position the goniometer's center of rotation into the XFEL interaction point.
To simplify CRL alignment and strain scans, we used a motorized 2θ rail that could independently rotate 3 carriages about its center, as shown in Fig 2 .The radius of this circle was selected based on the imaging distances for 10 keV photon energies and ∼33 imaging CRLs, and the baseplate for each carriage was planned to integrate radial translation stages for further focusing of each lens stack.Each carriage was fitted with stage stacks to position the BF and DF stacks of CRLs along their respective (x, y, R x , R y ) axes, as shown in Fig. 2b.The third carousel was used for the near-field alignment camera, though in future this could be used for 2-phase DFXM (i.e.diffractive imaging for a second phase).
At the top of the goniometer, we required resolution targets, alignment guides, calibration standards and single crystals for our measurements.For facile motion between these, we used a sample holder with interchangeable custom cartridges that could affix onto a sample holder frame that was stationed at the image plane of the microscope; cartridges were designed to hold targets either at an arbitrary geometry, or at a pre-aligned Bragg condition, depending on the intended use of the samples it intended to hold.The cartridges in our case were machined for high precision positioning, but in future we anticipate they could be 3D printed before or during an experiment for unexpected sample/ diffraction geometries.Pre-positioning the samples in this way simplified the goniometer design and alignment needs because it limited the range of angular sweeps to ≲ ±5 • required to orient the crystals.

Imaging detectors
Selecting the appropriate imaging detectors for this experiment requires consideration of the dynamic range, resolution, and frame rates.Indirect X-ray detection (i.e.conversion of X-ray to optical light via scintillator crystals) offers the highest spatial resolution, as the magnification may be amplified by a relay visible-light imaging system that offers higher fidelity/ magnification lenses and smaller pixel sizes on the visible-light cameras.However, this comes at the cost of a much lower photon detection efficiency.The experiments in this work used home-built indirect detectors (similar to those employed in 35 ) for the far-field (FF) cameras along both TXM and DFXM arms, using 50-µm thick Ce:LuAG scintillator crystals (thicker crystals correspond to decreased spatial resolution).Each scintillator crystal was placed into the X-ray image plane, then was relay imaged with ∼1x magnification to form an optical image on the visible-light camera.We used an Optem 34-11-10 zoom-lens attached to an Andor Zyla 5.5 sCMOS camera for both detectors, with scintillator-lens distances of 285-mm along the TXM arm and 130-mm along the DFXM arm.This resulted in an optical magnification of 0.71× for the TXM arm and 0.75× optical magnification for the DFXM arm.A turning mirror was placed between the scintillator and zoom lens to avoid burning the detector and lens with unconverted X-ray.We used both cameras at full resolution, but over a limited ROI that spanned the spatial extent of the scintillator screen to achieve the detector readout rates of 30-Hz.Since the light under-filled the active area of each detector, this did not limit our field of view in the material.
For all detectors in this work, we calibrated the spatial resolution and magnification using TEM grids.For each detector, we placed a TEM grid (200-mesh) at the upstream surface of the scintillator crystal to calibrate the optical magnification based on comparisons to the pixel sizes of each camera.We then calibrated the magnification of each imaging system using an illuminated TEM grid placed at the sample position.As the sample holder (Fig. 2c) held all calibration and imaging samples at the same z-position defining the object, we were able to calibrate the BF imaging systems with a bare TEM grid held at normal incidence to the sample, and the DF imaging systems using a TEM grid affixed to the exit surface of a single-crystal of diamond.The exit surface was important to avoid effects from dynamical diffraction from hindering the measurement of the diffraction image.simplifies image interpretation, it also necessitates careful calibration of image stretching to correct for this scattering projection, as shown in Figure 3.
Because the LADM detector is oriented at normal incidence to the diffracted XFEL beam, the stretch in the images differs from what has been described for imaging at ID06 at ESRF (shown in Figure 3 as z det 2 ) 29 .If we consider that the detector orientation at the XFEL is perpendicular to the Bragg-scattered beam (det 1 ), and that the standard detector orientation at ID06 is normal to the direct beam (det 2 ), the appropriate expressions relating the pixel size on the detector p det to the effective pixel size p 0 in the observation plane along z ℓ is as shown graphically in Figure 3.The effective pixel size along the non stretched direction y ℓ , retains the equation, p det = p 0y •M in both cases.We note that the TEM grids affixed to the exit surface of the diamond crystals necessitate that the resolution calibrations be performed with an additional stretch of the image by a factor of cos γ to account for the orientation of the crystal (also annotated in Figure 3a).Finally, we note the importance of understanding the orientation of the observation plane.As in XRT, the contrast mechanism giving rise to image signal in DFXM arises from scattering contrast along the {Q hkl } diffraction vector of the lattice.That said, the spatial observation plane that gives rise to DFXM images is always rotated by an angle of θ about the scattering plane normal with respect to the reciprocal lattice vector of the crystal's diffracting plane.The crystallographic notation in legends for all acquired images shown in this work are all offset by the θ rotation for simplicity, but careful analyses of DFXM images requires calibration for the observation-plane's orientational offset for accurate interpretation.

Alignment strategy
As each imaging system had a long beam path, we installed alignment cameras at three additional viewing positions: (1) upstream of the sample, (2) immediately behind the sample, in the near-field (NF), and (3) slightly downstream of the CRLs, in the "intermediate field" (IF).The upstream camera was primarily for alignment of the sample positioning stages -to confirm pump-probe overlap, XFEL positioning, and sample motion.The two alignment cameras downstream of the sample confirmed the orientation of the crystals for alignment to the far-field detectors.As the IF camera was located behind the imaging CRLs, it also served as an alignment guide for the imaging CRLs.
Viewing Camera.The first alignment camera was a viewing camera, placed upstream of the sample holder, that was a simple optical camera with a Zoom lens that resolved the interaction point of the XFEL with our sample.This camera allowed us to effectively position the sample and identify the position of the XFEL on our holder mount.
Near-Field (NF) Camera.On the third carriage of the 2θ carousel stage, we placed a NF camera 6.5-cm behind the sample, along the direct beam.We then positioned it using a ±100-mm linear translation stage, to identify the position of the diffracted beam, which appeared at the appropriate angle of 34.75 • (with respect to the 0 • reference along the transmitted beam).In this way, our NF detector could capture images along the BF and DF beams, allowing us to optimize the crystal's orientation into the horizontal Bragg condition, which is quite strict with the coherent and monochromatic XFEL beam 30 .This NF camera also enabled us to orient the CRL stacks to the appropriate angles around the carousel stage, and to optimize the R z alignment (∼ ω) to orient the crystal's ⃗ Q such that the {111} beam scattered into the horizontal plane.This low magnification detector used a 35µm -thick Ce:LuAG scintillator crystal to convert from X-ray to optical light, then relay imaged the visible light with a Zoom lens onto an Allied Vision Mako g-319b camera.Its 3.45-µm pixels produced an ultimate magnification of 0.01× for images collected along the NF camera.
Intermediate Field (IF) Camera.Behind the CRLs, we placed an alignment detector at a position 1.32-m behind the samples, with rotation along the 2θ axis on its own separate rail system that allowed it to shift between the BF and DF beams.This intermediate-field detector used a 35-µm thick Ce:LuAG scintillator crystal with a Navitar zoom lens and an Allied Vision Manta g419b camera.Our intermediate-field camera had a resolution of 32-µm per pixel, corresponding to an optical magnification of 0.17×.
As is described fully in previous work 29,30 , the resolution function of DFXM enforces a strict Bragg condition, requiring very precise, accurate, and reproducible alignment.Due to the scarcity of XFEL facilities, no permanent and dedicated DFXM facility exists at this time; this necessitates full alignment of the entire microscope and the samples within the beamtime accessible for one experiment.We detail the steps required for efficient alignment that we perfected after experiments at PAL-XFEL and then at LCLS below: 1.With the full 2D beam, align the direct beam to the FF detector to align, position, and calibrate the beam size & optical magnification of the home-built BF detector.2. Align the CRL assemblies along the x ℓ and y ℓ axes (dark-field, DF then bright-field, BF) using the IF alignment camera, with each lens stack placed along the direct-beam to avoid spatial jitter in the beam positioning during alignment.

9/21
3. Watching on the FF camera, align the focus (z-position) of the CRLs for the BF arm using the TXM camera, then calibrate the TXM imaging system's resolution, field of view, and any aberration distortions with its full magnification.4. Align the 1D prefocusing CRLs to achieve the narrowest possible beam waist for the 1D vertical line beam at the sample position (calibrated using a TEM grid at the sample position).Calibrate beam size with magnified and unmagnified images (i.e. with and without the objective) along the direct beam.(Comparison of the magnified and unmagnified images allows one to calibrate the divergence of the XFEL beam) 5. Orient the crystal of interest (or grain of interest in a polycrystal) into optimal Bragg condition along χ,φ ,ω directions (intrinsic motor rotations of R y , R x , R z from bottom to top) using a photodiode, then a NF camera at the DF angle.6. Orient the crystal's diffraction peak into the horizontal scattering geometry by rotating in along ω, confirming its position on the NF, then IF, then FF detectors along the DF path.7. Rotate the laterally pre-aligned DF CRLs into the diffracted beam; adjust lateral alignment as needed for accurate positioning on the IF then FF cameras.8. Focus the DFXM imaging system by translating the DF CRL stack along the z i direction while monitoring on the DFXM FF camera.Once aligned, calibrate the resolution, field of view, and distortions on the DFXM images using a crystal with a TEM grid affixed to the exit surface of the crystal.9.For single crystals -translate the sample along z s to identify the upstream and downstream faces of the crystal, then select your ROI to ensure the motor encoders can track the ROI's precise position in the sample.

Rotate & translate the sample as needed for data acquisition scans
The specific points in this list have been identified with significant considerations, which we explain in more detail below: CRL alignment precision.X-ray lenses are notoriously difficult to align due to their small effective apertures, long working distances, and the necessity of remote alignments.To align the 66-mm thick stack of imaging CRLs (280-µm pupil aperture) along the principal axis of the X-ray beam requires precise alignment along 5-axes -four lateral (x, y, R x , R y ) and one along the beam's path for focusing (z i ) -and is highly sensitive 36 .Lateral alignment of DFXM CRLs is particularly challenging at XFELs because of the microscope's sensitivity; the high X-ray flux and strong interactions can thermally distort the material 21 .Since DFXM's high sensitivity to lattice distortions is amplified by the coherence and monochromaticity at XFELs 30 , even subtle thermal expansions and creep deformations can completely alter the material attributes resolved in DFXM images (by deflecting the diffraction condition).To simplify alignment, we thus performed lateral alignment for both the BF and DF CRL stacks along the more stable direct beam, using a custom circular carousel translation stage that independently rotates three separate carriages about a concentric 2θ arc around the sample position.This allowed us to easily translate each lens stack between the diffracted and transmitted beams without changing the lateral alignment.
Imaging axial strains To position the FF detector along the diffracted beam is also rather difficult, as the sample-to-detector distance is 4-8 m propagation distance that must be precisely positioned along the diffracted beam, requiring specialized translation stages.Since the spot size of the beam is quite small, we identified that a temporary optical table for the DFXM far-field detector was very time consuming to position accurately.Our optimized design used the Large Angle Detector Mover (LADM) stage at XCS (LCLS) to position the FF detector along the 2θ arc of the diffracted beam.Long-term, detector stages like this will be essential for strain scanning capabilities in highly deformed crystals, which requires coupled translations of the CRL and FF-detector along the DFXM imaging arm to capture the full 2θ content of the diffracting crystal.
Alignment targets.The specifics of the alignment targets must be carefully planned.Along the direct beam, we used standalone apertures and TEM grids to track the position, size, and distortions of the beam and imaging system.Optical magnifications of the detectors were measured with no sample, but with a TEM grid placed over the front face of the FF scintillator crystal to allow us to compare the grid to the known camera pixel sizes.We calibrated the magnification similarly with the full imaging system, placing the TEM grids instead at the sample position for the full calibration of the total magnification.For the DFXM, we calibrated the magnification and FOV using TEM grids placed on the exit surface of a diamond single crystal.While this only acts as a mask over the back face of the crystal, it does create a pattern on the imaged beam that is stretched along the same projection angle, enabling us to calibrate the distortions.
Precision of Scanning Stages.For DFXM to accurately image the different points in reciprocal space, it must collect accurate and precise (∼10 −5 radian, ∼500-nm) scans of the sample along x ℓ , φ , χ, and 2θ , as shown in Fig. 1.This requires scanning stages with high accuracy and precision along the required directions of travel for acquisition scans.While many XFEL experiments take advantage of the continuous range of travel afforded by hexapods, the accuracy of travel through the entire scanning range is not as high as for classical stepper motors.We have thus found that accurate selection of the scanning motors is essential to the success of the ad-hoc (temporary) DFXM experiments at XFELs.For the best data acquisition, precise rotations along φ , χ and ω require an extrinsic µ rotation stage at the bottom of the stack to align the ω rotation to be about the diffracting Q vector 28 .Since it takes only two angular axes to rotate about the sphere, the designation of the χ and φ axes may be defined for each experiment (i.e. they are only a formalism).
Beam stability.The stability of the XFEL beam is important to this experiment because of the sensitive alignment of the 10/21 microscope and the connection between goniometer angles and contrast mechanism.There are four aspects of the stability of XFEL beams: (1) the Poynting, (2) the spatial mode, (3) the timing, and (4) the spectrum.We detail these points below.
1. Deviations in the Poynting vector of the incident beam must be < 10% of the beam's spatial profile; poynting stability is essential to define precise alignment of the < 500-µm apertures of the CRLs 36 .For cases with poor spatial stability, we have used a large beam size with a smaller aperture, which converts the spatial instabilities to intensity instabilities.
2. Spatial mode stability is important to ensure that the interpretation of features in images arises from the material and not from the beam.This has been challenging for many XFEL imaging studies 37 , especially for experiments whose features of interest span a wide range of intensity gradients.The setup described in this work uses the simultaneous images from TXM to self-calibrate for spatial mode and intensity jitter known to be prevalent at XFELs.This effect may in some cases by mitigated by demagnifying the source, but can also be sensitive to aberrations along the undulator and X-ray optics halls.
3. While timing jitter is known to be a challenge at XFELs for sub-100-fs measurements 38 , the timing stability required for DFXM at XFELs usually would not require the use of those specialized timing tools.The time resolution required for each DFXM experiment is dictated by the physics of the material studied and specifically by the velocity of the dynamics as compared to the image's spatial resolution.For example, to image a 10 km/s wave would traverse a 0.4-µm pixel in 40-ps, dictating a timing stability of <40-ps would be required to image this wave with a spatial resolution of 400-nm.
4. The spectral stability is perhaps the single most important point for DFXM image interpretability.Since λ dictates the strain states that give rise to contrast in DFXM, the random fluctuations in the photon energy inherent to the source causes different d-spacings to diffract through the stationary lenses -changing the materials information inherent to the measurement.The high brightness at XFELs stems from the Stimulated Amplification of Spontaneous Emission (SASE) process, which amplifies spontaneous emissions and therefore fluctuates its spectral content pulse to pulse across the entire range of the 0.3% bandwith.This significant photon-energy jitter is greater than the ≳18 eV required to entirely shift (in the present system) the d-spacing that accounts for the image out of the the 286-µm aperture of the imaging CRL, since 2θ = f (λ , d).
In general, we find that DFXM experiments at XFELs require either a monochromator or a seeded monochromatic beam (i.e.filtering the SASE beam before amplification 39 ) are best to ensure high sensitivity.In highly deformed systems (e.g.shock waves, fracture), the very wide range of strain states present in the material would make it advantageous to use the full SASE spectrum to ensure that a sufficient range of strain states are represented to resolve the system.Reversible systems (i.e.those that are feasible to measure with pump-probe experiments) may use signal averaging over many XFEL pulses to mitigate the spectral jitter, though this imposes an unchangeable minimum strain-resolution that would be set by the bandwidth of the SASE spectrum.

Results
We present the results from our microscopy data in this section.To present the full overview of the data, we first summarize the raw data we measure on each detector, and explain what each image dataset tells us about the material and its dynamics.Next, we describe the analysis necessary to extract the full information contained in different types of sample rotational scans and explain how this changes our view of the material by imaging along different momentum vectors in reciprocal space, providing detail to explain the interpretation and analysis of the datasets.Finally, we present the results of rotational scans (rocking curve along φ and rolling scans along χ) from our IF, and FF detectors, and explain the scientific insights afforded by each detector.
As discussed in the introduction, the timescales available with this instrument depend on the approach used to time-resolve the measurement.When probing reversible dynamics, the range of timescales accessible with XFEL-DFXM is from ∼ 50 fs through 1 ms, based on the tools for short-time calibration (minimum ∆t) and the repetition rate of the XFEL (maximum ∆t).To probe irreversible dynamics requires single-shot acquisitions in a bunch train, and is thus dependent on the inter-pulse spacing available at the XFEL and the detector readout rate.The range of lengthscales is more complex; the spatial resolution of the microscope is ∼1-µm in this work, but will likely be higher by using higher magnification focusing elements, as has been demonstrated at up to 30-nm resolution at synchrotrons 40 .As noted in Beam Stability, the lengthscale of the information that must be resolved by the technique depends on the velocity and/ or rate of dynamics in the material being studied.

Single-frame images with ultrafast high-resolution X-ray microscopy (U-HXM) instrument
For every pulse generated by the XFEL, the U-HXM instrument's data acquisition (DAQ) system saves the: (1) pulse energy, (2) goniometer stage positions, (3) TXM image of the line beam, and (4) DFXM image related to the elastic distortion states.As DFXM is a full-field microscope, each pulse produces a full real-space image on the camera; with beam tubes in place, we found that generally, a ∼1-mJ pulse energy gave DFXM and TXM images with appropriate signal-to-noise for single-shot acquisition.A full comparison of the different types of images collected along the BF and DF imaging arms is shown in Fig. 4, illustrating the change in resolution vs field of view afforded by each imaging modality.The pulse energy measured from the upstream monitors informs the incident intensity required to normalize the signal intensity, while the goniometer angles catalogue the information required to interpret the microstructure and displacement states being sampled by each DFXM image.It is most effective to monitor the pulse energy with a monitor downstream of the monochromator due to the spectral jitter of the incident pulse (see Beam Stability section above).If the energy monitor is downstream of the monochromator, it may be used to calibrate the DFXM signal; if the intensity monitor is upstream of the monochromator, an in-line spectrometer is required, or conservation of intensity must be assumed across many averaged pulses between the BF and DF images in the FF.We note that future DFXM experiments may benefit from the new seeded monochromatic capabilities at XFELs, which produce low-bandwidth pulses with higher photon flux 39 .
As described above, images collected in the FF along the BF may comprise information on density variations but are also important to calibrate the DFXM images.As shown in Fig. 4, the line beams collected from the BF camera can provide information about the spatial mode of the XFEL beam, the amount of dynamical diffraction occurring in DFXM, and context about the non-diffracting regions of the crystal (e.g.beam damage, phase transitions, etc.).In samples with no significant density variation, the TXM images can calibrate the fluctuations in the spatial mode of the XFEL, allowing one to correct for artifacts from the illumination.The TXM can also be helpful as a guide to quantify the amount of dynamical diffraction that occurs in a given diffraction condition (see TXM in Strong-Beam in Fig. 4).For nearly perfect crystals of sufficient thickness, dynamical diffraction (multiple scattering) causes the line-beam to scatter multiple times; for even numbers of scattering, the beam remains along the ⃗ k d wavevector, while an odd number of scattering events returns the beam back to the ⃗ k i wavevector.In both cases, the beam is translated from its initial position due to these multiple scattering events.This effect, termed the Borrmann effect 41 , makes the TXM line beam spread out laterally, as ghost-fringes appear next to the primary 12/21 beam.Information about the extent of dynamical diffraction can be helpful in understanding how to interpret image features with DFXM, as they also complicate signal in DFXM images.Finally, the TXM images give important information about the structure and its evolution in the entire illuminated region of the sample.Notably, DFXM is designed to image the specific part of the crystal that gives rise to scattering over a narrow range of reciprocal space, giving it very high resolution in real and reciprocal space.In general it does not provide any information on other material phases and grains that are oriented differently, as there is either no diffraction signal or the diffraction occurs at angle not compatible with the DFXM settings.With simultaneous density contrast that images these "missing regions," TXM gives a complementary view of the material, giving important context for interpretation of the DFXM images.At the PAL-XFEL, we also measured simultaneous wide-angle X-ray diffraction on the side opposite from the DF beam (mirrored across the BF beam), however, we do not include this in the presentation in this work, as that data was not meaningful without a phase transition or breakup of the crystal grains to observe.In future experiments, simultaneous diffraction can be helpful for interpretation of multi-phase and/or polycrystalline changes to the material.
As described in Poulsen, et al. 29 , each raw DFXM image contains bright and dark features that map specific components of the crystallography, detailing components of the strain and orientation states along the lattice plane being measured, hkl i .The content of these images is related to the spatial derivatives of the elastic displacement fields, which includes information about defects in materials and distortion waves like phonons, shock waves, and heat 42 .
A full comparison of the different types of images collected along the bright-field (BF) and dark-field (DF) imaging arms is shown in Figure 4, illustrating the change in resolution vs field of view afforded by each imaging modality.

Overview of DFXM scanning modalities
While significant insights may be gathered by time-resolving single-frames with DFXM, full information about dynamics of interest with DFXM, require scans along the parameters outlined in Table 2.A full DFXM scan is collected by measuring images at a series of different motor positions, photon energies, and/or times as described in Table 2. Strain and orientation scans probe different populations of reciprocal space in a region around the diffraction vector; alternatively this is presented in terms of axial strain and orientation (a local pole figure).The 3D and time scans capture the same structural information as a function of position and time, respectively (without changing the contrast mechanism).In most experiments, a combination of these scans are performed, where some combination of structure and dynamics are measured at a series of positions across different axes of a crystal's diffraction extent (rocking or rolling curve).

Axial Strain
Orientation 3D Structure Time Scan Parameters 2θ or λ φ and/ or χ ω, and x ℓ t or τ pp Table 2. Scanning modalities of DFXM that give observable image contrast for different types of structural information about material dynamics.
For strain and orientation scans, each image spatially maps the populations of displacement fields that meet the Bragg condition at that position in reciprocal space, within the reciprocal-space resolution function of the microscope (as shown in Fig. 1b).As described fully in Jakobsen, et al, 16 images collected at the brightest point of a rotational scan display the entire extent of the undeformed grain of the crystal domain, and define the strong-beam condition.Images collected at microscope settings at the edges of the rotational scan only describe specific anomalous types of distortions in the lattice, showing the defects or other sparse structural features in the sample; these images define the weak-beam condition.The nomenclature in this terminology was selected in analogy to dark-field TEM experiments in electron microscopy.At XFELs, the time-resolved scanning capabilities introduce another set of displacement states not described in previous DFXM work: temporally weak-beam states.We use this term to denote new weak-beam distortion states that populate during the transient dynamics probed by the experiment, but that are not populated at t < 0, before the pump pulse.
Strain scans are typically acquired at the synchrotron by collectively moving the detector and CRL stages coherently along the 2θ arc of the diffracting crystal.While the dedicated instruments at synchrotrons make this approach viable, the extra setup requirements at XFELs make it simpler to hold the entire experiment stationary, scanning the d-spacing with small changes to the photon energy for ∆λ .For the case of probing diamond (111) planes by an X-ray pulse of E = 10.1 keV and ∆E/E = 10 −4 , a single X-ray pulse with a bandwidth of ∆E = 1 eV covers a narrow range of δ d = 2 × 10 −5 -nm and 2δ θ = 0.004 • .For example, in the present experiment, a strain scan spanning a range of ∆ε = 1 × 10 −3 (∆d = 2 × 10 −4 nm) would require 10 steps of ∆E = 1 eV.This range of strain scanned by changing photon energy is equivalent to that scanned by changing scattering angle for 2∆θ = 0.03 • .Strain scans were not performed in this work, but we include this description for future users' benefit in planning experimental capabilities.
The reciprocal space resolution function for DFXM is highly anisotropic, with the beam divergence accounting for the highest sensitivity in ⃗ q; this effect is amplified by the coherence of the XFEL 30 .To map different strain components, it is important to consider the orientation of the lattice in relation to the axis of the resolution function, as is discussed fully in 28,29 , to ensure the appropriate match between the microscope's resolution and material's displacement fields.
Different types of dynamics are more suitable to study in the strong-beam or weak-beam condition based on the grain sizes and the spatial population of states present.In past, we have found defect measurements in low-defect density materials are easiest to interpret in the weak-beam conditions.For highly deformed crystals, the local orientation changes are typically much larger than the Darwin width and the diffracted signal can be interpretable when acquired in the strong-beam condition.At the XFELs, the temporally-weak condition will be most helpful to study dynamics in many samples and conditions.While the temporally-weak beam condition is usually the easiest data to interpret during an experiment, however, those data often lack sufficient information about the initial microstructural features in the sample that inform how and why those dynamics began.As such, we suggest a balance between strong, weak, and temporally-weak conditions when planning for XFEL-DFXM studies.
When studying dynamics at the XFEL, it is important to consider the tradeoffs between different approaches.For irreversible processes, real-time images must be collected to capture the dynamics of a material as it changes -this approach will always be limited by the camera acquisition speeds (frame rate and shutter speed), the inter-pulse separations for timing sequences, and the data transfer rates that are possible for the data acquisition system.Optical fibers for rapid data transfer are essential to achieve sufficient data transfer rates for the high-resolution and high dynamic range detectors required to acquire the full content of DFXM images (>12 bit-depth per pixel).From our experience, the U-HXM instrument performs best when each camera is connected to its own data-transfer line to enable parallel data transfer capabilities.From our experience, the 10 12 photons per pulse available at the XFEL are indeed able to acquire sufficient signal-to-noise for single-shot acquisitions, however, for weak-beam conditions, this can introduce significant challenges in interpretation (e.g.Fig. 5b).Our experiments at the PAL-XFEL observed damage bands appearing in diamond after 20,000 pulses of the XFEL (∼14.3Gy of radiation absorbed, assuming 0.1-mJ/pulse), however, the low intensity at the DFXM detector presented challenges in distinguishing this signal from burns to the Kapton tape behind it.
By contrast, for crystals exhibiting reversible dynamics, a pump-probe modality may be employed.In that modality, an optical pump laser drives reversible dynamics in the same sample region illuminated by the XFEL probing laser, at a series of time delays, τ i , that can be stepped through the full dynamics of the system.This approach enables signal averaging over hundreds or thousands of pulses, giving results like the image in Fig. 5a, offering much higher signal to noise.The pump-probe approach often requires longer than anticipated acquisition times, as the XFEL pulse may require attenuation to avoid sample damage over the long duration scans.The example image in Fig. 5a showing a strain wave propagating in diamond, generated by laser irradiation of the gold surface transducer layer as discussed in 42 .Finally, as presented above, one DFXM image probes a single observation plane in the specimen.A spatial 3D map may therefore be acquired by collecting image stacks while stepping the sample along the x ℓ axis, though this was beyond the scope of our initial study.We note that the sensitivity of the DFXM microscope requires that the images in such (x, y, z) scans are collected with rotational scans of at least one tilt axis for each observation plane to correct for motor drift (> 0.0005 • ) or spatial changes to the microstructure over the scan volume 11 .As the reciprocal space resolution function is thinnest in direction φ , it is natural to perform this additional scan along φ .
As an alternative to layer-by-layer mapping, the condenser may be removed an the specimen therefore illuminated by a square shaped beam.The DFXM images then represent a projection, though along a more complex geometry due to the tilted angle of the projection.Similar to classical tomography, 3D mapping may then be facilitated in a tomographic fashion by rotating in ω around the diffraction vector.This so-called topo-tomographic DFXM modality can give faster 3D information but is more complicated in terms of sampling 43 .
In large crystalline materials, combined analysis of the NF, the IF and FF images is quite helpful.The large difference in the field of view provides context as the NF and IF detectors can capture global dynamics occurring in volumes that are outside the field-of-view of DFXM (over mm-lengthscales).Changes to the real-space sample (e.g.thermal expansion, fatigue, etc.) would be evident in the NF and IF cameras, showing images that clearly demonstrate a change in the strong-beam image.New components of reciprocal space that populate are most evident at the IF camera, where satellite images may begin to appear to indicate new strain/orientation components that could also be of-interest to DFXM but would require realignment to the new 2θ and η positions.In our experiment, we observed images along the IF that showed the strong-beam and the temporally-weak beam signals to identify the position of the temporally weak-beam signal (image not saved).

Analysis for U-HXM Data
In this section, we provide an overview of the data analysis approach to evaluate the crystalline domains sampled by different scan modalities.For a detailed overview of the analysis, we encourage the reader to explore more thorough guides of specific analysis tools developed in darfix 44 and elsewhere 11 .
As in classical XRD, the diffraction condition in DFXM is determined by the conservation of momentum criteria that arise from the sum of the momentum vector for the incident, ⃗ k i , and diffracted, ⃗ k d , beams being equal to a lattice vector, ⃗ Q.While a perfect crystal would diffract only at a specific value of ⃗ Q 0 , the defects and distortions within the lattice cause additional ⃗ Q i states to populate as well, mapping the vectors characteristic of the subtle distortions in the lattice spacing and orientation, i.e., the displacement gradient tensor field 45 .The specific components of the displacement gradient tensor field that contribute to the diffracted signal arise from the crystal's orientation and the position of the detector.For a full derivation of the contrast mechanism for DFXM, we refer the reader to recent work using ray optics 29 and wavefront propagation 46 with synchrotron radiation, and XFEL sources 30 .
Experimentally, DFXM crystallographic scans are collected by capturing images produced by the crystal when it is rotated to each point along the rocking curve.The corresponding stack of images then has coordinates of (z, y, χ, φ , 2θ ) (assuming ω = µ = 0), and may be reconstructed into a single mosaicity map by constructing an image for which each pixel (z i , y i ) has an intensity, I(z i , y i ), that corresponds to the maximum intensity observed at that pixel throughout the scan, I(z i , y i ) = max χ,φ ,2θ (I(z i , y i , χ, φ )), and is plotted with a color, C(z i , y i ), that encodes the χ, φ , 2θ orientation that diffracted with that maximal intensity.A schematic is shown in Fig. 1 displays the scanning procedure and associated image sequences, with experimental data to show the characteristic images and reconstructed results (collected at the ESRF).
We note that the above description of the Center-of-Mass (COM) images is relevant when measuring the average properties of the lattice locally, e.g.measuring the orientation of a local domain.When studying the distortion fields surrounding single defects, the average properties typically wash out the lower intensity signal from defect structures, causing single images of the weak-beam conditions to be preferable 11,16 .
For static or reversible systems, the detailed mapping accessible from reconstructed DFXM scans along φ , χ, and 2θ would be most important to fully characterize unknown defect structure that is not well understood.For irreversible systems (e.g.fracture, radiation damage), a crystal grain with sufficiently well-understood defect structures may be measured in real-time, using simulations of all possible defect structures to evaluate the image features appearing in DFXM images collected at only a single crystal orientation.This may be done manually 19 , or using Bayesian inference for physics-informed image interpretation 47 .

Guide for Image Reconstruction from DFXM Scans
In this section, we introduce the general approach we used for the image processing treatments, and reconstructions to measure the observables for the basic rotational scans.
Noise Removal.After passing through the monochromator, the photon-energy fluctuations from the SASE beam manifest as 100% fluctuations in the XFEL beam intensity.Thus, for pump-probe and static experiments, we average over multiple X-ray pulses at a fixed sample position to improve the signal-to-noise ratio for the image at the selected microscope conditions.During the experiment, dark frames with the X-ray and optical laser beams blocked were acquired and saved every 13 frames to measure the pedestal noise from the detector 48 .For the XFEL beam, we account for the intensity variation on a shot-to-shot basis by integrating DFXM and TXM images over all images for a given microscope condition.For sufficiently sampled scans, this may be calibrated by comparison of the integrated intensity from each microscope position in both the DFXM and BFXM images, plotted across the rocking curve.By then comparing the integrated intensity vs microscope condition for the full scan and fitting them to a Gaussian (DF) and an inverted Gaussian (BF), we plotted the two complementary rocking curves measured for the DFXM (i.e.I DF (φ )/I 0 ≈ 1 − I BF (φ )/I 0 ).If the BFXM shows a complementary Gaussian curve to the DFXM rocking curve, this confirms that intensity loss arose from only the change in intensity of the XFEL beam, and the multiplier may be deduced from curve-fitting of the integrated intensity rocking-curve functions.Because of the noise subtraction, there were pixels with a negative intensity, requiring that all negative values be thresholded to 0 before subsequent processing.We note that when plotting these images, it is important to ensure that the minimum and maximum color limits are set carefully, as hot pixels in the image make python/matlab choose poor colormap limits if not set manually.The 1 st and 99 th percentile are normally a good choice for the limits of the colormap.
Scanning Reconstructions.A powerful way to reconstruct the strain or mosaicity fields from the scans collected by DFXM is to compile a COM data reduction over one or more scanning axes considered.Before starting the comparison between different motor positions of the scan, we first normalize the summed images to account for the intensity variation of the XFEL.Noise in the images collected at angles far from the center of the rocking curve have an outsized impact on the center of mass (COM) calculation, and will bring the COM towards the center of the scan.We reduce the impact of this by setting the intensity of pixels below the n th percentile to zero, or alternately subtracting a fixed value from all pixels before normalization.Finally, we then calculate the center of mass by fitting the I x,y (φ , χ, 2∆θ ) function for each pixel to a Gaussian and taking the weighted average of each pixel for each scanning parameter, as mentioned in the Analysis for U-HXM data section..More detailed descriptions of how the strain and mosaicity are solved from this approach can be found elsewhere. 43

Example Image Reconstructions
To demonstrate the mapping of local orientation, we include set of representative reconstructed images in Figure 6, showing the relationships between the XRT and DFXM images as well as the different types of scanning modalities.Fig. 6(a) shows the reconstruction from an unmagnified XRT image series, while (b-c) show a stretched TEM grid over a domain wall in diamond {111}, measured along the R y and the (R x , R z ) rotation stages to map φ and χ, respectively.
The XRT image shown in Fig. 6a illustrates the additional context provided by the IF scans.Fig. 6a shows the reconstructed image of a φ scan collected from an R y scanning acquisition.The ∼ 1150-µm field of view along the horizontal axis shows the entire extent of the observation plane in the crystal that is viewed in our images, D sin(2θ ) for D = 660µm crystal thickness , as viewed by diffraction-contrast microscopy.The XRT image is highly pixelated, showing a significantly lower spatial resolution, but maps the contextual structure of the crystalline domain across the entire extent of the domain (that passed through the CRL).In this way, XRT provides context at the IF detector for the full crystal information -guiding the imaging alignment and the interpretation of the microstructure in the DFXM images that follow.
Fig. 6(b-c) show the representative images that may be collected in the FF in the magnified DFXM geometry, showing rotational scan reconstructions from the χ (R x , R z ) and the φ (R y ) directions, respectively.Both images map the exact same region of the diamond (though a different one than in XRT) -with a low-angle boundary bisecting the left and right regions of the crystal by an angle that maps between the two rotational directions.While Fig. 6(c) shows the R y rotations that map directly to the φ rotational axis described above, the reconstructed results in Fig. 6(b) included rotational offsets in R z to correct for the fact that the R x rotation shown in Fig. 1 includes components of rotation in χ and ω.The R z corrections were performed by ensuring that the same TEM-grid fiducial appeared over the same pixels in each frame of the rotational scan.As such, the image in Fig. 6(b) approximates a χ scan.
The results from Fig. 6b-c indicate that the misorientation of the diamond across the boundary in its center is ∼ 5 × 10 −1 degrees in the χ direction, and −6 × 10 −3 degrees in the φ direction.More thorough investigation of this type of feature may inform the Burgers vector and spacing of the dislocations that comprise the boundary -serving as a direct measurement of the microstructure.

Discussion
Our results in this work demonstrate a new capability for X-ray science that holds opportunities to enhance DFXM from the 0.1 second timescale all the way to the 100-fs timescales.Using the instrument design we describe here, this setup allows for simultaneous multi-beam imaging experiments that can probe multiscale dynamics in materials under a range of different conditions.Using the simultaneous DF and BF imaging (DFXM and TXM, respectively), we have demonstrated a new opportunity to explore the reciprocal space components that underlie a specific feature captured by a TXM image of the material.This is important in applications like fracture or amorphization, in which materials begin to "cloud" in an image collected along the direct-beam because the transmitted beam attenuates from Fresnel and/or Bragg scattering as voids begin forming that instigate the fracture process 49 .While the BF TXM spatially maps a material's density by imaging along the transmitted beam (magnified version of radiography), DFXM resolves the local lattice distortions that underlie those density variations.Together, these techniques hold the opportunity to resolve snapshots of how defects and domains (and their associated strain fields) grow, propagate and interact as they cascade into large-scale material dynamics.This work sets the stage for a new host of experiments to study how mesoscale defects deep beneath a material's surface initiate phase transitions, strengthen materials, modify their physical properties, and beyond, as they respond to external stimuli.
Beyond the impact of this technique, we also stress the sensitivity of this microscope, and the importance to consider the full scope of preparations required to effectively sample materials with DFXM.We note that effects like dynamical diffraction and phase transformations can introduce uncertainties to the interpretation of the data in ways that require complementary probing methods to be able to interpret.We anticipate that future theory papers may explore this interpretation explicitly, enabled by the additional coherence available at XFELs.We additionally comment that our choice of CRLs as the focusing optics for the microscopes also holds opportunity for future directions.To capture enough of reciprocal space to avoid imaging artifacts, DFXM requires the largest possible numerical aperture, which is limited by the pupil aperture available with X-ray lenses.We selected CRLs as the best compromise between flexible effective focal lengths, relatively high pupil apertures, relatively high sample-to-lens distances, and ease of alignment.We note that alternative focusing optics have been explored in the synchrotron DFXM and are a viable future option for XFEL DFXM.
Finally, we also emphasize that beyond the challenges to building a DFXM instrument from scratch, there are additional considerations required for these experiments at XFELs due to the unique attributes of the source.In the sections above, we have detailed how the XFEL's polarization, photon energy jitter, and nonuniform spatial modes can add complexity to interpretation if not properly controlled during the experiment.In addition, we also emphasize the importance of considering the damage threshold of the material carefully when designing experiments.Our work did not need to consider beam damage for the pump-probe and static measurements because we used diamond samples for the proof-of-concept measurements, which has the highest known X-ray damage threshold.For other samples, the material's damage threshold must be compared against the power density of the X-ray beam.As DFXM often is used to resolve dynamics in long-range microstructural features, we often enlarge the microscope's field of view to lower the power density, however, attenuators may be used for sufficiently high efficiency detectors and/or highly scattering samples.
The use of DFXM at XFELs offers new insights into mesoscale materials science, offering complementary information to the current state of the art in XFEL imaging.Current XFEL imaging along the X-ray diffracted beam has been performed for X-ray ptychography and Bragg XCDI 50 .While X-ray ptychography is often used at synchrotrons to enhance the resolution of XCDI, at XFELs it has been employed primarily for full nano and micro beam characterization 51,52 .Coherent diffraction imaging has been used extensively at XFELs to image ultrafast structural dynamics in nanomaterials, including acoustic phonons in zinc oxide 53 , melting in nanoparticles 54 , and deformations in catalysts 55 .At synchrotrons, both techniques are leveraged for providing both the amplitude and phase of the diffracted beams, which can give more subtle information about phase-contrast from fine features.Ptychographic analysis and reconstruction was recently extended to DFXM studies 56 , and may be able to provide this type of information in future implementations of XFEL-DFXM.

Conclusion
We have presented a full integrated design for multi-modal ultrafast imaging at XFELs using simultaneous DFXM and TXM.
Our new technique provides opportunities to resolve dynamics that occur from slow to ultrafast timescales -spanning 13 orders of magnitude beyond the current state of the art for DFXM dynamics.The shift from stroboscopic integrated measurements to the single-shot ultrafast measurements that are now accessible at XFELs can enable a new class of experiments in materials science.We envision this new capability offers opportunities to understand ultrafast deformations (e.g.fracture), rapid phase transformation heterogeneity, thermal transport, and charge-density waves in superconductors, and important phenomena in many other fields.

Figure 1 .
Figure 1.(a) Schematic showing the DFXM geometry and scanning procedure, including the rotational axes, χ (cyan), φ(green), and ω (magenta), the axial strain axis, 2∆θ (red), the azimuthal detector position, η (yellow), and the alignment rotation axis, µ (brown).The circular plot at the bottom illustrates how the µ motor is required to rotate all scanning stages from their initial orientations, R x ℓ , R y ℓ , and R z ℓ in the laboratory coordinate system, into the rotated sample coordinate system, {x s , y s , z s } for which the diffraction vector ⃗ Q hkl are aligned to the ẑs axis.(b) We also show images from representative points along a rocking-curve, showing intensity indicating the spatial populations of each point along the lattice distortion field for the same spatial plane in the sample.Images in this stack were collected from single-crystal aluminum DFXM at the ESRF synchrotron at ID06-HXM.

Figure 2 .
Figure 2. 3D models of the different stage assembly at the sample position.(a) An overview of the entire setup, including the sample environment assembly, the beam tubes, and the far-field detectors, to show the scale of the experiment.(b) A zoomed in perspective of the Sample Environment, showing the arrangement of each camera, stage assembly, and imaging beam surrounding the sample position.The remaining images show zoomed-in isolated models of each components described in the text, including (c) the sample holder, (d) the goniometer assembly, (e) the intermediate field (IF) camera, (f) the CRL holder, (g) the near-field (NF) detector.

Figure 3 .
Figure 3. (a) Schematic showing a view from the top (along y ℓ ) of the microscope that illustrates how a single pixel is projected onto the detector in two different detector orientations: ẑdet 1 to describe the orientation with the detector face perpendicular to the incident beam ( ⃗ k i ⊥ ẑdet 1 ) as done in 29 , and ẑdet 2 to describe the orientation with the detector face perpendicular to the diffracted beam ( ⃗ k d ⊥ ẑdet 2 ).(b) Schematic showing the relationship between the observation plane normal, ⃗ N obs , and the scattering vector, ⃗ Q hkl

Figure 4 .
Figure 4. Sample images from each detector in the BF (above) and DF (below) imaging configurations.The general schematic for BF and DF are shown, with sample images collected in the NF (brown), IF (dark green) and FF (light green) shown for each position.NF and IF images are important for validation of the alignment of optics along the (x ℓ , y ℓ ) plane for BF to complement the (z ℓ , y ℓ ) observation plane along the DF imaging arm.The FF for each imaging line show representative images collected in the weak-beam and strong-beam conditions to illustrate the feature contrast (DF) and Bormann fan (BF), respectively.The BF images at the NF and IF positions show the 2D square beam, while the FF image for BF shows the line beam.We note that the IF image along BF is a screenshot and should thus only be considered qualitatively.

Figure 5 .
Figure 5. Raw data showing DFXM images captured at (a) LCLS using pump-probe acquisition mode, and (b) the PAL-XFEL using real-time image acquisition modalities.The image in (a) shows an integrated image of a strain wave traversing a diamond single-crystal, while (b) shows the incipient beam damage after 20,000 pulses from the XFEL at PAL-XFEL.We note that the crystallographic legends shown in all images are rotated by an angle of θ = 17.5 • about the vertical axis from the orientations shown.For description of the dynamics of the strain wave images and measurements, see Holstad et al. 42 .

Figure 6 .
Figure 6.Reconstructed diffraction-contrast imaging scans, collected (a) at the IF detector, producing a COM XRT image reconstructed from a φ , and (b-c) after magnification at the FF detector, COM reconstructions along (b) χ and (c) φ .Scale bars for the DFXM images are identical, while the XRT image is 10× larger, but the crystallographic legend are consistent for all images.