Determination of the Spatial Resolution in the Case of Imaging Magnetic Fields by Polarized Neutrons

: One of the most important parameters characterizing imaging systems (neutrons, X-rays, etc.) is their spatial resolution. In magnetic ﬁeld imaging, the spatial resolution depends on the (magnetic) resolution of the depolarization of spin-polarized neutrons. This should be realized by different methods, but they all have in common that a spin-polarizing and spin-analyzing system is part of the resolution function. First a simple and useful method for determining the spatial resolution for unpolarized neutrons is presented, and then methods in the case of imaging with polarized neutrons. Spatial resolution in the case of polarized neutron imaging is fundamentally different from ‘classical’ spatial resolution. Because of π -periodicity, the shortest path along which a spin-ﬂip can occur is a measure of ‘magnetic’ spatial resolution. Conversely, the largest detectable magnetic ﬁeld (B-ﬁeld) within a given path length is also a measure of magnetic spatial resolution. This refers to the spatial resolution in the ﬂight direction of the neutrons ( ∆ y ). The ∆ x and ∆ z refers to the spatial resolution in x- or z-direction; however, in these cases a different method must be used. Therefore, two independent methods are used to distinguish longitudinal and lateral spatial resolution, one method to determine the modulation transfer function (MTF) by recording the frequency-dependent fringe contrast of magnetic ﬁeld images of a coil (longitudinal spatial resolution), and the second method, to observe the fringe displacement at the detector as a function of magnetic motion, provided that the accuracy of the motion is much better than the pixel size (at least half the pixel size) of the detector (lateral spatial resolution). The second method is a convolution of the fringe pattern with the pixel array of the detector.


Introduction
To recognize and distinguish small structures, inhomogeneities, defects, etc. in matter, it is necessary to know some basic conditions in neutron imaging regarding spatial resolution, beam divergence, contrast, etc. The theory to this subject is well established and described in detail in [1][2][3][4][5]. The spatial resolution of a neutron imaging system can be measured by several methods, two of them are frequently used and commonly accepted. The first one uses a so-called "Siemens star" and the second method by determining the modulation transfer function (MTF) of the imaging system. The determination with the "Siemens star" is simple because one can directly read the resolution from an image of the Siemens star. The disadvantage is that it does not cover the frequency range continuously.
Other methods use (absorbing) grids with different line pairs (LP) per unit length and plot the image contrast as a function of LP/unit length or calculate the MTF from the image of an edge. The more common method uses opaque edges, because absorbing grids with different line pairs (LP) per unit length yield only a discrete Fourier spectrum, different to an absorbing edge. There is a large number of publications showing up all advantages and disadvantages of this method, but using an edge is a simple but very straightforward method to derive the modulation transfer function of a digital radiography system from an edge image. The image examined with the point spread function (PSF) method must have a high contrast-to-noise ratio, so it is (for clinical studies) often inappropriate for describing the MTF as well as with the edge spread function (ESF) method [6,7]. A technique for rendering the ESF method robust to image noise is presented where the noisy ESF is smoothed out through multiple stages of filtering [8]. The MTF can be also measured directly as the image contrast as a function of the spatial frequency of absorbing gratings with increasing number of line pairs/unit length [9].
For radiography (and tomography) using polarized neutrons the magnetic spatial resolution is always associated with change of the neutron spin orientation due to a magnetic field. Polarized neutron imaging is used in many experiments and has been published, e.g., [29][30][31][32][33][34][35][36][37][38][39][40], but all have in common a spin analysis system which determines the resolution of the imaging system.
In this paper, first a simple and powerful method is proposed to determine the spatial resolution in the case of imaging with un-polarized neutrons. Then we describe how to determine the spatial resolution in the case of imaging with polarized neutrons. We use the image of de-polarized neutrons by special magnetic fields that produces fringe structures with different frequencies in the space domain and additionally the shift of a given pattern with respect to detector pixel array. However, first, some mathematical basics about conventional spatial resolution are summarized.

Spatial Resolution for Unpolarized Neutrons
Spatial resolution principally depends on the incident beam divergence φ, in neutron radiography and tomography it is called L/D ratio, the inverse number of ∼ φ. There are different definitions of the L/D ratio (see [4]); however, here we use the most common accepted one, depicted in Figure 1. Conventional neutron imaging instruments use a pinhole aperture (size D) as source, which together with the distance L from the object determines the divergence φ of the incident beam. Depending on the size of the source D, or on the mosaic spread of a crystal source D mosaic a point in a sample is magnified on a screen as d = l d D/L ( Figure 1). In the case of a crystal monochromator, D must be replaced by d mosaic , d moasic = mean grain size of the crystal monochromator and L/D then becomes L/d mosaic [41]. One can pay attention to the refraction of the beam at edges that causes additional tiny blurring in the image, but refraction is indeed used as well as an imaging signal. This is not to be confused with the additional blur caused by refraction. Here, edge diffraction can be neglected, details on this subject are given in [42][43][44][45][46][47].
A finite L/D ratio is always linked with beam divergence φ and ∆λ/λ > 0. Furthermore, a finite precision of scanning and detection (pixel size) contribute as well to smearing effects. To briefly recapitulate the mathematics of spatial resolution, divergence and blur, one considers a perfect straight edge, which is represented by the Heaviside step function h(x). If an edge is illuminated by divergent radiation, given by r = r(x), the geometrical image (shadow) is the convolution of h(x) ⊗ r(x). The function r(x) includes divergence and all other blurring effects and can be best represented by a Gauß function g(x), The convolution h(x) ⊗ g(x) is given as The question to be answered is the "correct" scanning (sampling) of the image of the edge, which requires that the sampling frequency f s must be twice as high as the highest occurring frequency f max in the corresponding frequency spectrum, i.e., f s = 2 f max (Shannon theorem [48]). The scanning frequency is usually the number of detector pixels per unit length.
The highest occurring frequency f max in the corresponding frequency spectrum is obtained from the Fourier Transform F T of the convolution h(x) ⊗ g(x), C(f) = F T {h(x) ⊗ g(x)}. If H( f ) and G( f ) are the Fourier Transforms of h(x) and g(x) and using the convolution theorem one obtains the Fourier transform of the convolution H( f ) · G( f ). Please note that H( f ) δ( f ) function. The normalized absolute value of G( f ) yields the modulation transfer function (MTF) or frequency contrast function C( f ). The frequency at 10% contrast gives the spatial resolution in the image. Please note that vice versa the integration of the Gauß function yields the error function erf(x) which perfectly can fit to an image of an edge .
Some further remarks: Any measurement of the spatial resolution of an instrument or experiment must clearly state how far the sample is from the detector, its thickness/size and what 'source' is used (pinhole, monochromator), and what collimation. If the distance of the sample to the detector is large compared to its thickness/size (extension in neutron flight direction), one can assume a uniform spatial resolution. In the other case, the largest distance should be used to calculate the spatial resolution.

Longitudinal Spatial Resolution of a Magnetic Field
Regarding the spatial resolution dx, dy and dz in x-, y-and z-direction one can assume dx = dy = dz if no asymmetry of the imaging system is evident. The detection of the size of a magnetic field or to determine the magnitude of a magnetic field in a polarized neutron imaging depend on the number of spin rotations in the field. This measurement is based on the interaction of the neutron spin with B and provides information from B in only one direction, e.g., in the y-direction (neutron flight direction) in a {x, y, z} coordinate system. The neutron spin in a magnetic field B behaves like a classical particle, since the neutron velocity v c and its spin vector s rotates (classically seen) around B with the Larmor frequency ω l = γ L · B, where γ L is the gyromagnetic ratio of the neutron (γ L = −1.83247 × 10 8 rad· s −1 ·T −1 ). From ω L = γ L · B one obtains the rotation angle φ, if t is the transit time of the neutron through the magnetic field B. With λ = h/p, p = m n · v and the neutron mass m n = 1.67493 × 10 −27 kg [49] , φ is One realizes, only | B| = B is important, not the orientation of s with respect to B, i.e., ω L is independent of the angle between s and B. The factor γ L ·m , so a spin rotation φ around 180 • (spin-flip) for a neutron wavelength λ = 0.32 nm = 3.2 and B = 1 mT would occur for a path length ∼21.2 mm. From Equation (6), φ = φ(B, s, λ) is a function of magnetic field, path length s and wavelength λ.
and yields only a dependence on the path length 's', because in the sample B is constant, thus ∂φ ∂B · ∆B = 0, and the term ∂φ ∂λ · ∆λ can be considered to be small (∼0.06 rad for B = 4 mT, s = 10 mm, λ = 0.32 nm and ∆λ = 1% see Figure 2). Thus, the longitudinal spatial resolution of a B field is coupled to the magnitude of B, to the wavelength and wavelength spread ∆λ/λ used. Figure 2 shows the path length dependence of a spin-flip on magnetic field for three wavelengths. One sees, the larger λ the smaller the path length for a spin-flip. Therefore, a thin sample containing a magnetic field preferably requires a longer wavelength for the detection and determination of B and allows for a large ∆λ/λ ≈ 10% (thin in the sense of spin flips/sample thickness ≤ 6 spin flips, see Figure 3). ∆λ/λ determines the contrast in polarized neutron images and one sees in Figure 3 that with increasing B the contrast of spin flips decreases. However it can happen, for the determination of B, that for a given wavelength different B-fields produce nearly the same gray values in an image, as shown in the 90 • sample orientation in Figure 4, where a polarized neutron image of a coil shows for two different B-fields nearly the same gray values. On the other hand for λ = 0.32 nm the difference are 5.5 gray values on a gray scale of 0-127, a small change of the wavelength to λ = 0.34 nm increases the difference to 32 gray values as shown in Figure 5. The longitudinal spatial magnetic resolution ∆y is mainly a function of the path length s, s = s(s spin− f lip ), the size of B in the sample, on λ and the wavelength spread ∆λ λ .   A longitudinal magnetic transfer function can be achieved by measuring the image fringe contrast as a function of different B with decreasing path length s. A fringe pattern is obtained by a proper coil operated with different currents, and measured by polarized neutron imaging (see Figure 6). The longitudinal spatial B resolution refers to the path length in the direction of the neutron trajectory through B. A fraction of this path length correlates with a fraction of the spin-flip and results in a different gray value in the image than a full spin-flip. For the {x, z}-plane (and any other plane), one obtains a frequency-dependent contrast function of different fringe patterns with a coil and imaged with polarized neutrons. The magnetic field in a coil of finite length L and radius R, B is given by [50] where the axis of the coil is parallel to B = [B(x), 0, 0]. For L R one obtains for B(0) ≈ µ 0 · n · I, and B(±L/2) ≈ 1/2 · B(0) (see Figure 7). The B-field in a coil with a length L much greater than the radius R, is known to be µ 0 · N · I/L, µ 0 = 4π · 10 −7 , N = number of winding, I = current and L = length. Figure 4 shows the calculated 2D polarized neutron images of a coil due to position-dependent depolarization of a polarized neutron beam, using the Radon Transform of the B-field of the sample. Such calculations (using the Radon Transform of a B-field) give perfect agreement with experimental results [36], even for rather complicated samples [51]. The images in Figure 4 were calculated with B = µ 0 · N · I/L. For a coil, µ o , N and L are given device parameters, the current I and thus also B can be varied.

Lateral Spatial Resolution of a Magnetic Field
To acquire information about the lateral resolution one must use a different method. The lateral spatial resolution relates to the spatial symmetry mentioned above (Section 2.2). The divergence of B is zero, ∇ B = 0, so B is constant in any volume element ∆V = ∆x × ∆y × ∆z, (∆y ∼ = ∆s in Equation (7)), one can further assume that the spatial resolution is ∆x = ∆z, i.e., if the horizontal and vertical divergence (φ hor , φ vert ) are equal, otherwise, ∆z = ∆x because the vertical divergence is φ vert = φ hor . The lateral spatial resolution is directly measured from moving a defined fringe pattern across the detector array, i.e., one measures the convolution of the pattern with the detector array. If p = p(x, z) is the fringe pattern function and D = D(x, z) the detector function, and one moves the pattern across the detector D, one measures the I = I(x, z), where x means one detector row. The convolution is described experimentally below (Section 3.3). Other considerations given Section 2.2 can be adopted for lateral magnetic resolution, too.

Determination of the Spatial Resolution for Unpolarized Neutrons
The following experiments were performed at PONTO II, an instrument of the University of Applied Sciences, Beuth Hochschule Berlin, dedicated to polarized neutron imaging at the BER II reactor of the Helmholtz-Zentrum für Materialien und Energie. The first experiments with edge measurements were performed to determine the MTF of the system and thus the spatial resolution for unpolarized neutron imaging. A Cd edge (Figure 8) was placed in a cold neutron beam (λ = 0.32 nm) and an image taken at a distance of 60 mm from the 2D detector, which had a pixel size = 13.5 µm (Figure 8). From the fitted shape of the smeared grid e.g., by a Gauß function, the Fourier Transform of the Gauß function, F T {G}, yields the modulation transfer function MTF, the frequency-dependent contrast function C(f) of the edge image.  . This works better than using the error function itself, and above this, the Gauß function is fitted at the same time. The Fourier transform of the (fitted) Gauß function is then used to calculate the MTF = (F T (G(x)) of the edge profile and to determine the 10% contrast f max and thus the spatial resolution of the instrument. The correct scanning frequency f scan is given by f scan = 2 · f max . The detector pixel size was 13.5 µm but due to binning = 27 µm. The best spatial resolution is found at 54 µm (∼ f max ), which agrees perfectly with 2 × 27 µm (∼ f scan ) for l d = 5 mm. The spatial resolution also depends on the distance l d of the object to the detector (see Figure 1). The larger l d the worse is the spatial resolution. This was measured for l d = 5, 60, 100, 120, 140 and 200 [mm]. If one plots the particular spatial resolution as a function of l d one obtains the principal limit of the imaging system of ∼13 µm for l d = 0, i.e., the pixel size of the detector 13.5 µm, which agrees perfectly with the data fit line for l d = 0 mm (see Figure 10). Comparing the results in Figure 10 one sees the discrepancy between theory based on the 1/r 2 law if a pin hole source is used and measured data. The measured data show an entirely different behavior. The explanation is given in [41], there already could be measured that using a mosaic crystal as monochromator the pin hole as source diameter must be replaced by the mosaic structure of the monochromator yielding an improvement of the L/D ratio of a factor ∼2.7, here a factor 2.2 ( Figure 10).
The spatial resolution can be well derived by plotting the value of the modulation transfer function MTF at 10% contrast as function of the distance of the edge from the detector. For pin hole geometry on observes a 1/r 2 behavior, any other geometry, such as using a mosaic crystal as source or a collimator system yields different results (see Figure 10).  is given by f scan = 2 · f max . The detector pixel size was 13.5µm but due to binning = 27µm. 6 The best spatial resolution is found at 54µm (∼ f max ), which agrees perfectly with 2× 27µm 7 (∼ f scan ) for l d = 5mm. The spatial resolution also depends on the distance l d of the object to 8 the detector (see Fig.1). The larger l d the worse is the spatial resolution. This was measured 9 for l d = 5, 60, 100, 120, 140 and 200 [mm]. If one plots the particular spatial resolution as a 10 function of l d one obtains the principal limit of the imaging system of ∼ 13µm for l d = 0, i.e. 11 the pixel size of the detector 13.5µm, which agrees perfectly with the data fit line for l d = 0mm 12 (see Fig.9). Comparing the results in Fig.9 one sees the discrepancy between theory based on 13 the 1/r 2 law if a pin hole source is used and measured data. The measured data show an entirely 14 different behavior. The explanation is given in [40], there already could be measured that using 15 a mosaic crystal as monochromator the pin hole as source diameter must be replaced by the 16 9 Figure 9. Fitting procedure and evaluation of the spatial resolution. The spatial resolution can be directly read from the 10% contrast at 17.4 LP/mm (appr. 57 µm). 17.4 LP/mm are the maximum frequency f max that appears in the image with 10% contrast. Figure 10. Spatial resolution as a function of distance of the edge from detector l d . Note the difference between the measured and calculated resolution, the latter using the 1/r 2 law and when the source geometry is assumed to be a pinhole rather than a mosaic crystal. φ geom = 0.1 • means the geometric collimation obtained with a solid-state collimator and φ mosaic = 0.045 • the measured beam collimation due to the mosaic crystal monochromator, see also [41].

Longitudinal Magnetic Spatial Resolution
In polarized neutron imaging, the magnetic modulation transfer function (mMTF) is the contrast function that depends on the number of neutron spin flips per path length in a magnetic field. It was determined as frequency-dependent fringe contrast function of neutron spin-depolarizing magnetic fields from a magnetized coil. The neutrons were spin-polarized and spin-analyzed by so-called solid-state benders (m = 2.5 and m = 3), length = 40 mm, cross section 30 mm × 30 mm [53], the neutron detector was 4k × 4k CCD camera. The fringe function as a 2D image of a pattern was generated by a magnetized coil as calculated with Equation (6) and with the Radon Transform of the magnetic field [40]. Figure 6 shows the fringe pattern of coil with a quadratic and a cylindrical shape. A quadratic shaped coil creates equidistant fringe patterns different to a cylindrical shaped one and the fringe pattern is much easier to measure.
The spatial resolution was therefore limited to 110 µm in the {x, y} plane and concerning the vertical divergence (φ vert = 0.2 • ) in the {x, z} plane, respectively (compare Figure 4). This geometry involved a vertical geometric smearing of 0.340 mm.
For each current I[A] a radiography with polarized neutrons was recorded as seen in Figure 11, exposure time was 5400 s. From each reduced image (size = 566 × 296 pixel ∼ = 15.28 mm × 7.99 mm) the background was subtracted, and outlier data removed by a [5 × 5] median filter. Then a 150 pixel ( 4.05 mm) broad and 296 pixel (7.99 mm) high area was selected from the image and the contrast C = (I max − I min )/(I max + I min ) calculated as a function of fringes/7.99 mm. Figure 12 shows the result. The MTF function was fitted to an error function, yielding a vertical spatial resolution of 343 µm, which agrees well with the theoretical value of 0.340 mm Figure 12).
The fringe pattern at current I = 6A in Figure 11 is shown enlarged in Figure 13 which is under-laid with the corresponding line graph. It can be seen that the contrast of the fringes within the plot varies, mainly caused by small stray fields and imperfections of the neutron polarizer and the neutron analyzer, but the fringes are still well separated. The magnetic modulation transfer function was obtained by fitting the contrast values from the I = 3A, 3.5A ... 6A images with an error function and plotting the corresponding contrast as function of the frequency (Figure 12. Despite the rather small number of points (due to a limited coil current), a quite reliable value of 2.9 line pairs/8 mm at 10% contrast was obtained, corresponding to a resolution of 345 (20) µm. The error can be derived from the different number of observed fringes (±1).

Lateral Magnetic Spatial Resolution
The spatial magnetic resolution in the case of polarized neutron imaging was also investigated in the case of lateral spatial resolution. In the coil experiment of Figure 11, the B-field increased and the number of spin rotations (spin flips) along the flight path (y-direction) determined. One measures the number of spin flips (number of fringes) as a function of the B-field for a given distance. So one acquires information about the shortest path length a spin-flip can occur (longitudinal magnetic spatial resolution).
This experiment determines the largest B-field that can be measured with a certain spatial instrumental resolution. However, both the largest and the smallest B-field to be detected depend on the wavelength of the neutron. B and thus the path length for a spin-flip are inverse functions to the neutron wavelength, as given by Equation (6) and seen in Figure 2. Due to knowledge of horizontal and vertical divergences φ hor as described in Section 2.3 the fringe pattern must be adapted to the expected resolution. The detector pixel size (also known) must much smaller than the produced fringe pattern, so that the measured convolution provides useful results.
To determine the lateral spatial resolution, one must measure the spatial resolution with respect to ∆x and ∆z, varying only the position of a fringe pattern on the 2D detector. This was done by a magnetized quadratic coil (I = 3A) placed on a µm precise stage and moving it up by 50 steps each of one 50 µm, so that the pattern, generated by the magnetized coil and the spin analyzer, is shifted 2.5 mm above the 2D pixel array of the detector. For each step, an image was taken with polarized neutrons. If the fringe pattern moves perpendicular to the detector (horizontal) lines, the movement of the pattern produces different gray values in the detector lines, which can be plotted as a line graph ( Figure 14).     This was checked in detail with the result that the periodicity of the measured patterns varies from position to position: Table 1   The experimental results of the lateral spatial resolution ∆z (380(48) µm) agree well with the (vertical) geometric spatial resolution (350 µm) and with the calculated result of the convolution of the fringe pattern with the 2D detector (pixel array) (376 µm). Due to the vertical beam divergence φ vert = 2φ horiz , ∆x can be given as 1 2 ∆z = 190 µm.

Summary
In this paper, at first some basics on spatial resolution and modulation transfer function determination are given and it is proposed to obtain the modulation transfer function from edge image experiments. The edge data are fit to the convolution of a Gauß function with a step function, resulting in a smooth function for the edge image (and for the Gauß function) the Fourier transform is then applied to the (already smoothed) Gauß function, yielding the corresponding modulation transfer function and thus the spatial resolution at 10% contrast.
In this setup (PONTO II) the spatial resolution as a function of the distance of the edge from the detector differs significantly from the pin hole-source geometry. The use of a mosaic monochromator increased the L/D ratio by a factor of 2.2 from L/D(pin hole) = 573 to L/D (mosaic monochromator) = 1270, which has already been demonstrated with another instrument [41]. The spatial resolution for unpolarized neutrons at PONTO II was determined to be 57(3) µm for an object at a distance of 5 mm from the detector, which is an improvement from earlier measurements (80 µm) [35].
When determining spatial resolution in the case of polarized neutron imaging, it is necessary to distinguish longitudinal and lateral resolution. The spin depolarization was measured using a special neutron supermirror device (SwissNeutronics) as polarizer and analyzer elements. The measurement is governed by the Larmor precession ω L resp. by the spin rotation angle φ (see Equation (6)).
The longitudinal resolution was determined by increasing the number of spin flips (fringes) within a given path length. The measured spatial resolution by the modulation transfer function (345(20) µm) agrees well with the calculated value (350 µm) and with the calculated convolution value (376 µm). The longitudinal resolution refers to the largest B in the sample, the smallest B results from the minimum spin rotation which can still be determined. In addition, the magnetic resolution depends on the incident beam polarization P, and both the largest and smallest B to be detected also depend strongly on the neutron wavelength used. Lateral spatial resolution (∆z) was measured by moving a given fringe pattern, generated with a magnetized square coil, across the 2D detector in steps of 50 µm. The detector pixels are a known parameter, as is the fringe pattern, so experimental convolution yields the correct values (380(48) µm for a spin-flip. Due to the vertical beam divergence φ vert = 2 φ horiz , ∆x can be given as 1 2 ∆z = 190 µm. Finally, it can be stated that the wave nature of neutrons does not affect spatial resolution in magnetic field imaging as described in this paper. The wave nature would cause phase effects, i.e., refraction and diffraction (interference effects). Both interactions require sharp phase transitions [42][43][44][45][46], or ordered structures, for example, in bodies with magnetic domains [54] or in magnetic structures [55], which are not discussed here.  Acknowledgments: The authors would like to thank the Helmholtz-Zentrum Berlin für Materialien und Energie (HZB) for strong support of the research work in the framework of the collaboration with the Berlin Hochschule für Technik, University of Applied Sciences. The experiments were performed with the PONTO II instrument at the HZB's BER II research reactor, an instrument funded by the German Federal Ministry of Education and Research (BMBF) and used for radiography and tomography with polarized neutrons. It was installed and operated by the Berlin University of Applied Sciences, Hochschule für Technik, and had to be dismantled at the end of 2019 due to the shutdown of the BER II reactor.

Conflicts of Interest:
The authors declare no conflict of interest.