Detector tilt considerations in high-energy Bragg coherent diffraction imaging: a simulation study

This paper addresses three-dimensional signal distortion and image reconstruction issues in x-ray Bragg coherent diffraction imaging (BCDI) in the event of a non-trivial, non-orthogonal orientation of the area detector with respect to the diffracted beam. Growing interest in novel BCDI adaptations at fourth-generation synchrotron light sources has necessitated improvisations in the experimental configuration and the subsequent data analysis. One such possibly unavoidable improvisation that is envisioned in this paper is a photon-counting area detector whose face is tilted away from the perpendicular to the Bragg-diffracted beam during acquisition of the coherent diffraction signal. We describe a likely circumstance in which one would require such a detector configuration. Using physically accurate diffraction simulations from synthetic scatterers in the presence of such tilted detectors, we analyze the general nature of the observed signal distortion qualitatively and quantitatively, and provide a prescription to correct for it during image reconstruction. Our simulations and reconstructions are based on an adaptation of the known theory of BCDI sampling geometry as well as recently developed geometry-aware projection-based methods of wavefield propagation. Such configurational modifications and their numerical remedies are potentially valuable in realizing unconventional coherent diffraction measurement configurations and eventually paving the way for novel materials characterization experiments in the future.


Introduction
Bragg coherent di ractionimaging (BCDI) is a synchrotron-based lensless imaging technique for spatial resolution of lattice structure and distortions on the scale of a few tens of nanometers [1,2,3,4]. As a means of obtaining three-dimensional (3D) real-space images via phase retrieval inversion algorithms [5,6,7,8], BCDI is a valuable means of materials characterization owing to its ability to spatially resolve speci c components of the 3D la ice strain tensor in deformed crystals, in a nondestructive manner. BCDI and the related imaging technique of Bragg ptychography [9,10,11,4] together constitute an important set of nano-scale imaging modalities for compact as well as extended single crystal materials.
With the several orders of magnitude increase in coherent ux at fourth-generation synchrotron light sources (e.g., ESRF-EBL and the upcoming APS-U), coherent di raction methods will play an increasingly important role in the 3D characterization of materials structure at the nanoscale. e need to incorporate these techniques into existing measurement pipelines will create a requirement for exible and unconventional di ractometer geometries for smooth functioning. Such a situation could arise in reciprocal space locations where it is di cult to rotate a detector arm into the required position, but BCDI capabilities are required nevertheless.
As an example, an experiment might require enhanced strain resolution corresponding to a higher-order Bragg re ection that may be outside the accessible rotation range of a conventional detector arm. In such a case, one may favor an alternate con guration such as a wall-mounted BCDI detector con guration in which the physical detector chip will not be perpendicular to the exit beam. Another example from a recent work describes the unprecedented nanoscale strain mapping on individual crystalline domains in a poly-grain material by exploiting the partial coherence of a high-energy x-ray beam (52 keV) typically used for meso-scale orientation and strain characterization [12]. e high beam energy necessitated a sample-detector distance of ∼ 7 m in order to resolve di raction fringes, which was achieved with a wall-mounted BCDI detector whose face was perpendicular to the downsteram direction, instead of the di racted beam. ese examples indicate the possible increasing need for BCDI with unconventional detector con gurations at future beamlines. In anticipation of the increased demand for BCDI capabilities with non-traditional di ractometer con gurations, this paper addresses the issue of real-space image reconstruction from a BCDI signal distorted by an arbitrary detector tilt. Speci cally, we describe (i) a Fourier transform -based forward model of far-eld propagation that correctly computes the di raction pa ern from a synthetic sca erer (collected on an area detector that is tilted away from the plane perpendicular to the exit beam) and (ii) the custom adaptation of a known BCDI post-phase retrieval method of shear-correction [13] to correctly obtain the original distortion-free sca erer from this di raction pa ern.
It is worth noting that a limited form of this geometric quanti cation is performed by the xrayutilities so ware package [14]. Speci cally, it addresses the case in which the detector tilt can be decomposed as two independent tilts along the mutually perpendicular sampling directions dictated by the pixels. Our manuscript generalizes this treatment to an arbitrary detector tilt relative to the perpendicular to the exit beam that need not correspond to this decomposition criterion, e.g., when the detector face is rotated about the exit beam. Such a measurement is ddescribed in Ref. [12].
As a recap of the representatice experimental schmematic [13], we refer to Fig. 1 that depicts the following features: • e sca ering geometry with the incident and di racted wave vectors k i and k f respectively, along with the sca ering angle 2θ B .
• e orthonormal detector frame B det = [k 1k2k3 ], wherek 1 andk 2 span the plane normal to the exit beam. We herea er referred to this as the 'imaging plane' as opposed to the 'detector plane', by which we mean the plane de ned by the detector pixels. In conventional BCDI, the detector plane is held parallel to the imaging plane.
• e rocking angle θ , in this case aboutŝ 2 , but in general about any direction permissible by the experimental arrangement.
• Most importantly, the discrete sampling steps in Fourier space corresponding to the detector pixels, represented as the columns of a 3 × 3 matrix: B recip = [q i q j q k ]. q i and q j are the reciprocal-space steps de ned by the pixel dimensions alongk 1 andk 2 . q k denotes the incremental migration of the 3D di raction signal through the imaging plane by virtue of the θ rotation and is independent of the detector pixel dimensions. e azimuth and elevation angles δ and γ in Fig. 1 are speci c to the con guration at the 34-ID-C end station of the Advanced Photon Source and denote the typical parameterizations of the detector position. In BCDI the column vectors of B recip are not mutually orthogonal owing to the geometry of q k (Ref. [13] contains a derivation of this fact). However the detector is typically arranged with its face is normal to the exit beam such that q i k 1 and q j k 2 , as seen in Fig. 1. Let the dimensions of the acquired data set be N 1 × N 2 × N 3 , where N 1 and N 2 denote the pixel span of the detector and N 3 the number of discrete steps in the rocking direction (θ in Fig. 1). e thesis of Ref. [13] is: given that B recip = [q i q j q k ] can be computed from the experimental geometry, the real-space sampling steps associated with the three axes of the Figure 2: Schematic of a BCDI di raction geometry with di erent detector con gurations: (i) the traditional mounting normal to the exit beam which is arranged by di ractometer rotation stages and a radial arm, and (ii) an unconventional wall-aligned mounting (i.e. normal to the incident beam). e la er is easily achieved with inexpensive translation stages that move the detector parallel to the far wall of the experimental enclosure.
phase-retrieved object array may be analogously expressed as the columns of another matrix B real . Generally, the mutual non-orthogonality of the columns of B real implies a non-orthogonality associated with the axes of the 3D array obtained from phase retrieval. It has been shown [13] that B real is given by: and −T equivalently denotes the inverse of the transpose or the transpose of the inverse. e phase-retrieved array containing the real-space sca erer, combined with knowledge of the shear encoded in B real , is su cient for accurate, un-distorted rendering of the sca erer with one of several available so ware packages for 3D visualization. For the interested reader, the method to directly compute gradients on a grid of such sheared sample points (required to convert the sca erer's complex phase to a spatially resolved la ice strain eld) is provided in the appendix of [13].

A tilted detector
e shear-correcting coordinate inversion method summarized in Section 1 generalizes to any BCDI con guration provided the sampling basis matrix B recip is properly parameterized according to the experimental degrees of freedom. e detector plane was assumed perpendicular to the exit beam, an arrangement typically ensured in BCDI by xing the detector on a radial arm, facing inwards and pointed at the mounted sca erer. In this section, we demonstrate the exibility of the sampling basis formalism of Eq. (1) in addressing the general case when q i and q j are not aligned parallel tok 1 and k 2 respectively. As demonstrated in Ref. [12], such a situation may arise in the design of future BCDI facilities in which detector motion is dictated not by di ractometer rotations such as γ and δ, but relatively inexpensive translation stages, an example of which is shown in Fig. 2. Such a design would greatly simplify the design of a BCDI measurement, with the burden of correcting for the tilt-induced signal distortion being placed on numerical methods.
We rst consider a simplifying assumption. We assume an ideal detector with perfectly fabricated pixels which faithfully register an incident photon in its entirety. e pixels are not susceptible to energy redistribution due to the passage of the incident radiation through multiple adjacent pixels owing to the slanted propagation path. is undesirable feature of realworld detectors would result in a blurring e ect of the acquired signal whose correction involves knowledge of the intricacies of detector chip design. Further corrections to address this issue will be detector-speci c and therefore outside the scope of this work.
We now refer to the schematic in Fig. 3. In 3(a), we see a simpli ed one-dimensional detector arranged to capture the peak of a Bragg re ection at its center, but tilted away from the imaging plane by an angle ξ. Here we denote the wavelength of the radiation as λ, the distance between the object and the center of the detector as D and the pixel pitch as p.
is arrangement renders the extent of angular space queried by the detector smaller by a factor of cos ξ (note the region of angular information 'lost' to the BCDI measurement). e Fourier space norm of the pixel step is no longer p/λD as shown in [13], but (p/λD) cos ξ, as indicated by the dashed arrow. e sca ered intensity in the region of lost information does not contribute to the acquired signal. In the case that the di raction fringes were to have reached the detector edges, this would Figure 3: (a) Di erence in sampling geometry when the imaging plane of the physical area detector is placed perpendicular to the exit beam, compared to when it is tilted with respect to this orientation. e tilt of the detector e ectively results in a smaller fraction of angle space being queried. e e ective sampling step |q| of the pixel is smaller than if the detector were perpendicular to k f by a factor of cos ξ, as seen by the dashed arrow. (b) A view of a similar scenario in two dimensions looking in the direction of the exit beam, with the ⊗ symbol denoting the direction perpendicular to the gure plane, inwards. For a general detector tilt away from the perpendicular position, the e ective sampling steps of the pixels are the projections of |q i | and q j in the plane perpendicular to k f . result in a measurement with missing higher-order Fourier components and therefore a reconstruction with necessarily lower spatial resolution. A more general treatment of this one-dimensional detector case is found in Ref. [14].
We wish to generalize this idea to the case of a two-dimensional area detector arbitrarily tilted with respect to the exit beam (i.e. when the pixel steps q i and q j no longer lie in the imaging plane). To do this, it su ces to compute the projections of q i and q j in the imaging plane. Fig. 3(b) is viewed with the imaging plane (red) coincident with the plane of the gure.
e exit beam k f (denoted by ⊗) enters the imaging plane perpendicularly. Also shown is the projection of the tilted detector face (blue), e ectively a sheared window when seen from the viewpoint of the incoming far-eld di raction. e region of lost information is now the shaded area in between the blue and red quadrilaterals. Because of this, the respective projections {q i , q j } of the pixel steps {q i , q j } are not orthogonal in general, even though they still span the imaging plane. e projection operator P into the imaging plane is: where I is the 3 × 3 identity matrix andk 3 is the third axis of the detector frame (along the direction of the exit beam), treated as a 3 × 1 column vector. With this, we can compute the e ective sampling steps in the imaging plane: e basis vectors q i and q j in the matrix expression for B recip are respectively replaced by q i and q j from Eqs. (3) and (4). We nally note that the third sampling vector q k is not modi ed by the tilt of the detector, since it depends only on the Bragg re ection of interest and the direction of sca erer rocking. e computation of B real then follows in the usual manner described in Eq. (1).

Simulation results
We now demonstrate the reconstruction of a synthetic digital object from simulated BCDI scans acquired at various arbitrary detector tilts. For all the following simulations, we adopt the self-conjugate detector frame B det = [k 1k2k3 ] instead of the laboratory frame B lab in which to render the original and reconstructed objects, as well as the Fourier-space signal. For simplicity, the synthetic object in question is a phase-less pyramid with a square base, with well-de ned facets and edges. e forward model devised in order to simulate the signal acquired using tilted detectors are described in detail in Appendix A, along with a summary of the various detector tilts used in the simulations. ese manipulations in fact form the theoretical basis of the back-projection method, whose detailed derivation is the subject of Ref. [15]. Here, in the interests of highlighting the tilt-induced shear and its correction, we bypass the phase retrieval process altogether and merely obtain the sca erer 'reconstructions' from the inverse FFT of the simulated wave elds, and compare their morphologies before Figure 4: Demonstrations of the simulated signal distortion for di erent detector tilts, along with the subsequent real-space distortions in the pyramid. In each sub-gure, the inverse FFT of the simulated wave eld is used as a substitute for the phase-retrieved object itself. (a) (i) central cross-section of the di raction pa ern, seen here in the (k 1 ,k 2 ) plane, (ii) central cross-section of the 'reconstructed' pyramid obtained by IFFT, (iii) e axes of the orthonormal coordinate frame for each of the isosurface plots in this gure, (iv) isosurface plot of the synthetic, phase-less pyramid; (b) (i) central slice of the signal when the detector is tilted by 60 • aboutk 1 , (ii) central slice of the 'reconstructed' object subsequently obtained by IFFT, (iii) isosurface plot of the pyramid without accounting for tilt-induced distortion, (iv) isosurface plot when tilt-induced distortion has been accounted for; (c) the corresponding images when the detector is tilted by 60 • aboutk 2 , (d) the corresponding images when the detector is tilted by 60 • about the in-plane vector [1/2 √ 3/2 0] T ; (e) the corresponding images when the detector is tilted by 60 • about [1/2 √ 3/2 0] T , followed by a 73 • rotation aboutk 3 . In each 2D image, the axis units are in pixels while in each isosurface plot, the axis units are in nanometers. Note that the last image in each of the panels (b), (c), (d) and (e), which depicts the shear-corrected pyramid morphology, is in agreement with the last image in panel (a), which is the ground truth. and a er the distortions that arise from Eqs. (3) and (4) have been corrected. Under these circumstances, the inverse FFT is simply a proxy for the phase retrieval solution in the limit of in nite signal to noise ratio. Fig. 4 shows the simulated di raction signals of the phase-less pyramid than has been arbitrarily oriented in the detector frame, when the detector is tilted in di erent ways with respect to the exit beam. We note the 'stretched' nature of the di raction pa erns in Figs. 4(b), 4(c), 4(d) and 4(e) along various directions owing to the tilted detector, when compared to the di raction pa ern in 4(a). For example, 4(b) shows the di raction when the detector is tilted by 60 • aboutk 1 , which appears like the pa ern in 4(a), but stretched alongk 2 .
is signal is missing higher-order fringe information along this direction, which translates to de ciency of spatial resolution that manifests in the blurred edges of the object cross-section obtained by IFFT. Similarly, Fig. 4(c) shows the signal when the detector is rotated by 60 • aboutk 2 , resulting in a stretch alongk 1 and a corresponding blurring along the edges of the recovered object. Figs. 4 show the distorted di raction signal in the case of more complicated detector tilts (see Appendix A for a full summary).
In each case, the distortions in the pyramidal shape in the absence of the shear correction are shown along with the shear-corrected 3D isosurface rendering (third and fourth images in each panel respectively). e la er shows much be er agreement with the original pyramid in Fig. 4(a) in terms of object size, shape and orientation. Further, we note that the loss of higher-order Fourier-space information due to the tilt results in the 'frayed' edges and non-uniform amplitude cross section in the real-space object (the second panel in each Fig. 4 sub-gure), a sign of reduced spatial information. e striations on the pyramid faces in panels (b), (c), (d) and (e) can also be explained by these less-than-perfect edges in the amplitude cross-sections.

Conclusion
We have derived a geometric correction for the morphology of a reconstructed sca erer in a BCDI measurement with a detector tilted with respect to the di racted beam. e correction method demonstrated is seen to be a straightforward generalization of the mathematial theory developed in Ref. [13]. We have successfully validated our theory by developing a customized forward model of the distorted di raction signal acquired by a tilted detector and applying the coordinate transform theory from Ref. [13] to recover the original object as it would have been obtained by phase retrieval.

Acknowledgements
e conceptualization of the tilted-detector BCDI measurement and development of the required wave propagators were supported by the US Department of Energy (DOE), O ce of Science, Basic Energy Sciences, Materials Science and Engineering Division. e generalized, geometry-aware propagator theory underlying this e ort was developed with the support of the European Research Council (European Union s Horizon H2020 research and innovation program grant agreement No. 724881).

Appendix A. Simulating di raction with a tilted detector
Consider a compact crystalline sca erer denoted by the complex scalar eld ψ(x) ≡ ψ(x, y, z) whose coordinates are de ned in the orthonormal detector frame B det = [k 1k2k3 ]. In a BCDI measurement, the squared modulus of its Fourier transform is measured slice by slice using an area detector whose Fourier-space imaging plane is displaced by integer multiples of q k , de ned by a single step along the rocking curve.
k ] T in the detector frame, then the nth slice of the 3D Fourier transform is given by the projection-slice theorem [16,17]: i.e. the nth slice of the sca ered 3D wave eld whose intensity is accessed by the area detector is equal to the 2D Fourier transform of the modulated projection of the sca erer, evaluated at the 2D points (k x + nq (1) k , k y + nq (2) k ). e modulation in question is the phase factor e −i2πznq (3) k . e expression (A.1) is evaluated numerically by means of the two-dimensional DFT operator F 2D and the projection operator R 3 along thek 3 -direction by: vi One may rewrite Eq. (A.1) more explicitly in terms of the two-dimensional quantities In order to model the tilt of the detector face, we employ the axis-angle parameterization of a rotation matrix R(α,n) (described in [13] Eq. (19)), acting on the columns of the 3 × 2 matrix [q i q j ]. We recall that these columns represent the pixel steps in perpendicular directions along the face of the detector. e tilt is modeled by the following two rotations applied in order: 1. A rotation R 1 = R(ξ,n(φ n )) by an angle ξ about an axisn(φ n ) ≡ [cos φ n sin φ n 0] T in the (k 1 ,k 2 ) imaging plane followed by. . . 2. A rotation R 2 = R(φ,k 3 ) by an angle φ about the exit beam direction.
In short, the pixel sampling steps (originally aligned alongk 1 andk 2 ) are transformed due to a tilted detector in the following manner: e in-plane sampling vectors described in Eq. (3) and (4) are obtained by: where P is the projection operator from Eq. (2). As mentioned in Section 2, q i and q j are no longer mutually perpendicular, even though they span the imaging plane. Of course, we ignore the extreme tilt of ξ = 90 • , in which case q i q j and they no longer span the imaging plane.
We note in passing that we have expressed the tilt of the detector as a general rotation matrix, a quantity known to require 3 parameters to be unambiguously speci ed. In our case, these parameters are: (1) the in-plane orientation φ n of the rst rotation axisn(φ n ), (2) the angle of rotation ξ about this axis, and (3) the angle of rotation φ about thek 3 direction. e xrayutilities library [14], on the other hand, restricts itself to a two-parameter tilt of the detector about mutually perpendicular directions and explicitly stops short of a full parameterization. In this sense, the formalism being developed here is more general and capable of addressing the experimental con gurations beyond the scope of xrayutilities.
We reiterate that there is no e ect of the tilted detector on the third sampling vector q k , which is determined solely by the manner of rotation of the sca erer ('rocking') during the measurement. We next de ne the projection operator K ≡ [k 1k2 ] T that extracts the rst two components of its 3D vector operand i.e. for any detector-frame 3D vector [x y z] T , we have K[x y z] T = [x y] T .
We now seek the two-dimensional shearing operation that distorts the wave eld in the imaging plane due to the detector tilt, in the manner described in Section 2. Put di erently, we seek the 2 × 2 shear matrix S that satis es the following condition: which gives us the formal expression for the two-dimensional in-plane distortion operator: us, from Eq. (A.7) we are now able to determine the 2D sample points k (t) 2D accessed by the tilted detector (superscript (t) stands for tilt), in terms of the sample points k 2D if the detector were not tilted: Using Eq. (A.8) to substitute for k 2D in Eq. (A.3), we get: where the nal expression above is obtained with the change of integration variables S −T x 2D ≡x 2D = [xỹ] T and in addition, the substitution Sq k,2D ≡q k,2D .
We note that up to the multiplicative term det(S), the expression (A.9) is completely analogous to Eq. (A.3), whose operator version is Eq. (A.2). Eq. (A.9) tells us that the far-eld coherent di raction can in fact be simulated on an arbitrarily tilted detector in a computationally e cient manner using Eq. (A.2), provided the following conditions are satis ed: 1.
e signal sampling shear S in the imaging plane is computed using Eq. (A.7). 2.
e real-space orthogonal grid x of the synthetic sca erer is sheared in its rst two dimensions by: e Fourier-space incremental step q k due to sample rocking is sheared in its rst two dimensions by: q k,2D −→ Sq k,2D .

4.
e sca erer ψ is re-sampled in its rst two dimensions by: ψ (x 2D , z) −→ ψ S −T x 2D , z is is the method adopted to obtain the 3D wave elds and subsequently the di raction pa erns incident upon a tilted detector. e parameters θ, φ and φ n used to generate the rotation matrices R(ξ,n(φ n )) and R(φ,k 3 ) for the simulated  detector tilts in Fig. 4 are listed in Table A.1