Method to quantify accuracy of position feedback signals of a three-dimensional two-photon laser-scanning microscope

: Two-photon laser-scanning microscopy enables to record neuronal network activity in three-dimensional space while maintaining single-cellular resolution. One of the proposed approaches combines galvanometric x-y scanning with piezo-driven objective movements and employs hardware feedback signals for position monitoring. However, readily applicable methods to quantify the accuracy of those feedback signals are currently lacking. Here we provide techniques based on contact-free laser reflection and laser triangulation for the quantification of positioning accuracy of each spatial axis. We found that the lateral feedback signals are sufficiently accurate (defined as <2.5 µm) for a wide range of scan trajectories and frequencies. We further show that axial positioning accuracy does not only depend on objective acceleration and mass but also its geometry. We conclude that the introduced methods allow a reliable quantification of position feedback signals in a cost-efficient, easy-to-install manner and should be applicable for a wide range of two-photon laser scanning microscopes.


Introduction
Since the introduction of two-photon laser scanning microscopy [1] and its application for measuring neuronal network activity in three-dimensional space in vivo [2], the technique has been continuously improved, gaining for higher temporal resolution and higher coverage of three-dimensional networks at single cell resolution [3-12, for review see 13]. As naïve neuronal networks are distributed not only in two spatial dimensions, functional threedimensional investigations increasingly play a central role in neuroscience. Recently, the feasibility of quasi-simultaneous calcium imaging from hundreds of cells was demonstrated using three-dimensional random access scanning [14][15][16]. Alternatively, a simpler approach combines widely used classical galvanometric lateral scanning with a focusing piezo actuator, providing volume scans with an edge length of 100 -250 µm at 10 Hz by using a spiralshaped scan trajectory [2,17]. The disadvantage of losing morphological information of cellular targets by both continuous spiral scan trajectories and discontinuous random access scanning can be overcome by reconstructing the spatial information using a spatially highly resolved reference z-stack acquired directly before or after the fast functional measurements [2,[14][15][16][17]. Therefore, an accurate monitoring of the absolute position of the focal volume over time is the main requirement accomplishing a reliable reconstruction of the spatial information of targeted cells. So far, internal feedback signals of the microscope's positioning devices were routinely used to achieve this goal [2,4,10,17]. Using fluorescent beads embedded in agarose, the feasibility of reconstructing morphological information was shown [2]. Furthermore, the stability of the scan trajectory was qualitatively demonstrated by bleaching a homogeneous fluorescent plastic sample [7]. Nevertheless to our knowledge, a quantitative validation of the position feedback signals is still missing.
Hence, the aim of our study was to develop independent methods to quantify absolute positioning accuracy using external references. Considering that the mean diameter of neuronal cell bodies is about 10 µm, the maximal tolerable positioning deviation of the feedback from the reference was defined to be ±2.5 µm. Two different experimental arrangements were used to quantify the lateral and axial positioning accuracy for each axis separately. Lateral positioning accuracy was quantified by scanning a stage micrometer with reflective tick marks providing discrete position information. For quantification of axial positioning accuracy, a commercial laser triangulation sensor was used as axial position reference. These methods are cost-efficient, easy to install and should be applicable for a wide range of two-photon laser scanning microscopes (2PLSM).

Fluorescent beads embedded in agarose
For an initial assessment of positioning stability, we used fluorescent beads embedded in agarose. Fluorescent beads (F8836, Thermo Fisher Scientific, Waltham, MA, USA), 10 µm in diameter, were dispersed in an agar block (4% in double distilled water) to a final concentration of approximately 20000 beads/mm 3 . A volume of 500 × 500 × 200 µm 3 was scanned at a frequency of 10 Hz over a period of 10 minutes using spiral scanning [2]. A three-dimensional spiral consisted of damped sinusoidal movements of the x-and ygalvanometers (phase shifted by 90°), which were repeated 18 times during one period of a sinusoidal movement of the piezo actuator (including a 180°-phase shift at the half period). The number of windings per xy-spiral was 5.6 and the three-dimensional distance between each scan point was set to 1 µm. Immediately before spiral scanning, a z-stack was acquired [512 × 512 pixels, 496 × 496 µm, 101 optical sections in z direction (Δz = 2 µm), 5 images per section were averaged, frame rate 2 Hz], providing bead position information in the scanned volume. Intersected beads (scan positions which are located in or near a bead volume from a bright plateau along the scan trajectory) were identified by visual inspection of the intensity plot of spiral scan data (80000 scan points × 6000 scan periods). Using a threshold algorithm, changes in length of each intersection were calculated in 5 s intervals (data was averaged over 50 scan periods, n = 120 time intervals per intersection). Initial intersection lengths were determined as the mean of the first 10 intervals. Clotted beads, which appear as close or combined plateaus in the intensity profile were excluded from analysis.

Lateral positioning accuracy
Using reflective tick marks of a stage micrometer (tick mark distance: 10 ± 0.2 µm, R1L3S2P, Thorlabs, Newton, NJ, USA) as one-dimensional reference positions enabled us to quantify the lateral positioning accuracy (x-and y-axis respectively, Fig. 1(A)). To this end, the light beam provided by a tunable Ti:Sapphire laser set to 740 nm (Chameleon Ultra II, Coherent, Santa Clara, CA, USA) was directed through a 670 nm dichroic mirror (670 DCXXR, Chroma Technology, Bellows Falls, VT, USA) and projected onto the micrometer using a 20× water immersion objective (XLUMPLFLN 20XW, Olympus, Tokio, Japan). The stage micrometer was positioned under the objective, optically coupled with a drop of water. An achromatic quarz-MgF 2 zero-order wave plate (10RP52-2, Newport Corporation, Irvine, CA, USA), a glan-laser calcite polarizer (10GL08, Newport Corporation, Irvine, CA, USA) and a pockels cell (M350-80LA, Conoptics, Danbury, CT, USA) mounted consecutively were used to adjust laser power. Care was taken not to damage the photomultiplier tube (PMT) due to high reflected light intensities. Applying command voltages to a single galvanometer (u Cx or u Cy ) provided the detection of maximal reflection intensities of reference positions during motion of the projected light beam ( Fig. 1(B)). Intensities were converted in currents by a PMT (H10770PA-40, Hamamatsu Photonics, Hamamatsu, Japan) and subsequently in voltages (u PMT ) by a preamplifier (C7319, bandwidth: 100 kHz, Hamamatsu Photonics, Hamamatsu, Japan). Starting from the leftmost scan position, the first detected peak was annotated with 0 µm. Every consecutive peak position was incremented by 10 µm (reference position p Rx or p Ry ). In order to validate the positioning accuracy of the x-and y-axis, each feedback signal of a galvanometer (u Fx or u Fy ) was correlated to the determined external reference positions (p Rx or p Ry ). Laser focus is dynamically deflected by one of two galvanometers and projected on a reflective grid of lines (distance: 10 ± 0.2 µm). Focus position at a specific time point depends on applied galvanometer command voltage u Cx (t) (or u Cy (t)). Position feedback signal u Fx (t) (or u Fy (t)) is continuously measured. Reflected laser beam intensity is simultaneously measured by a PMT and converted into voltage u PMT (t). Inset shows relation between absolute focus position and grid tick marks. (B) Exemplified x-axis measurement. Top: Traces of u Cx (t), u Fx (t) and u PMT (t). Gray box is scaled up and displayed below. Note that there is a significant phase shift between command signal u C (t) and resulting mirror movement (u F (t)). Peak detection indicates identified reflection maxima in u PMT (t). Absolute positions p Rx (or p Ry ) are calculated by discrete 10 µm distances of detected peaks. Note that calibrated position reverses after a change of galvanometer motion direction (gray highlighted, position 470 µm). Dashed lines indicate zero points (0 V). The dashed dotted line indicates position turning point.
The stage micrometer was aligned to the microscope by using a 1 Hz full field frame scan (512 × 512 pixels) and a micromanipulator (Mini 25 3Axes, Luigs & Neumann, Ratingen, Germany). Tick marks were oriented at right angle to the assessed scan axis. Tilt effect was minimized by small angular movements and visually inspected in the reflection image. Alignment was done until all reflected lines were in approximately one focal plane (<5° tilt angle of the reflected profile). After alignment, the command signal of the y-axis galvanometer u Cy (t) was constantly set to 0 V, in order hold its mirror in center position, while assessing the x-axis. Subsequently, command signals u Cx (t) consisting of at least 30 periods of triangular, saw-tooth or undamped and damped sinusoidal shaped trajectories were tested (amplitudes: 0.5 -2 V, frequencies: 1 -2000 Hz). A damped sinusoidal trajectory represents a one-dimensional component of a two-or three-dimensional spiral scan (five windings per xy-spiral, one or 12 repetitions, scan point distance 1 µm).
Trials producing hardware errors, e.g. because acceleration limits were passed, were excluded from analysis. To assign the tick mark positions to scan time points, a threshold algorithm was applied to the acquired reflection data u PMT (t) of each scanning trial and the results were visually inspected subsequently. A local maximum in reflection intensity (peak) was considered to be the center of a micrometer tick mark and therefore used for further analysis, if 1) u PMT (t) locally exceeded the threshold (1.7 -2.2 V) and returned to subthreshold level, 2) no saturation in any sample point of the peak occurred, 3) the distance in time to a change in galvanometer motion direction was at least 15 samples, and 4) the peak could be verified by subsequent visual inspection. The same procedure was applied to assess the y-axis, by a 90°-rotation of the stage micrometer and a swapping of u Cx (t) and u Cy (t).

Axial positioning accuracy
In order to validate accuracy of the z-axis feedback signal, a position reference signal was derived from a simultaneously measured distance between a moving piezo load and a stationary laser triangulation sensor (AM400, CMOS resolution: 0.1 µm, ALLSENS Messtechnik, Dreieich, Germany, Fig. 2(A)). The objective was replaced by a dummy in order to provide an appropriate target surface. The axial position of the dummy was monitored via the integrated capacitive position detector of the piezo focussing unit (position feedback u Fz ) and correlated with a simultaneously measured reference position (p Rz ) using laser triangulation (Fig. 2). The piezo amplifier operated in closed-loop mode, thereby reducing drift and hysteretic effects. In order to maintain the necessary speed for fast threedimensional scans, accelerations were minimized by using sinusoidal command voltages (u Cz , amplitude: 0.625 -5 V, frequency: 1 -20 Hz, 100 periods per trial). To investigate a potential dependence of the position of the center of mass, three objective dummies of different length were used as piezo load and, also, as triangulation targets: 1) "regular": L regular = 73 mm, 2) "short": L short = 0.5 × L regular , 3) "long": L long = 2 × L regular (material: sandblasted brass or bronze). The mass of all three dummies was equal to the mass of the original objective (m = 230 g, XLUMPLFLN 20XW). An additional target referred to as "none" with a length of <1 mm and a mass of about 2 g has been used as almost massless control (material: sandblasted aluminum). The triangulation sensor was centered on the front surface of every respective target. Initial tilt angles between the optical axes of the sensor and the microscope were corrected using a pitch and yaw platform (PY003, Thorlabs, Newton, NJ, USA). For each scan trial, the analysis was restricted to the steady-state of the piezo positioning response function by excluding the initial 50 periods [7].

Position signal correlation
For each axis separately, we analyzed phase shifts between internal feedback signals (u Fj ) and corresponding reference signals (p Rj ) to the applied command signals (u Cj ). j is a placeholder for x, y or z representing each axis. Over an interval of 10 periods, the time dependent sinusoidal command signal u Cj (t) with an angular velocity of ω, was normalized to s Cj (t) (range of s Cj : −1 to 1): t Lag is a placeholder for: 1) Lag between reference and command signals t Rj and 2) Lag between feedback and command signals t Fj . Normalized command signals s Cj (t) were phase shifted by Lag t ω ⋅ , where t Lag is a discrete time interval of 1 µs and k a variable to test different phase shifts (range of k : 0 -12000, k ∈  ): t Lag was quantized, because the resolution of the acquired signals was limited to 1 µs. Subsequently, s Cj was subtracted from the respective amplitude-normalized feedback (s Fj , range: −1 to 1) or reference position signal (s Rj , range: −1 to 1). For different phase shifts Lag t ω ⋅ , the sum square error (SSE) of the differences was calculated (N: number of samples The local minimum of ( ) was considered to represent the inherent time lag of the respective position signal to the command signal. Thus, a difference between the inherent time lag of the reference signal and the inherent time lag of the corresponding internal feedback signal represents a time lag between the nominal real-time scan point position and its representation in the feedback signal.
In a next step and for each axis separately, time lag corrected feedback signals were calibrated to corresponding reference positions. Assuming minimal positioning error in response to low frequency triangular command signals, 1 Hz for lateral and 0.02 Hz for axial measurements respectively, the feedback signal u Fj was linearly fitted to the corresponding reference position p Rj as: where i represents the index of an acquired position pair ( i ∈  ) and 0 j β , 1 j β represent the ). The deviation d j (i) in µm of each feedback position compared to a reference position was then calculated as: In order to reduce laser speckle noise, position signals of z-axis were smoothed by a moving average filter (window size: 250 samples). Subsequently, axial deviations were calculated as average of 50 consecutive periods of one scan trial. In order to minimize the impact of slow mechanical drift (e.g. of the stage micrometer or the triangulation sensor), each intercept was repeatedly determined and corrected.
Data were analyzed offline using ImageJ

Fluorescent beads embedded in agarose
In a first step, we assessed positioning instability by means of fluorescent beads (10 µm diameter) embedded in agarose, as a frequently used test object in laser scanning microscopy. To this end, we performed three-dimensional line-scanning along a spiral trajectory (500 × 500 × 200 µm 3 , 10 Hz) and analyzed the changes in length of bead intersections over a period of 10 minutes (Fig. 3). Whereas most intersections displayed no change in length, some of them indicated position deviations due to a detectable change in length over time (Fig. 3(B), examples 1 -4 versus 5). During the first two minutes these changes ranged from -2.5 µm to +1.8 µm (0.48 µm SD). In addition, the SD of the change in intersection length clearly increased over time (Spearman's rho = 0.99, n = 120 time intervals, Fig. 3(C)), indicating an increase in positioning inaccuracy. A limitation of this approach lies in the fact that a change (or lack of change) in intersection length is not uniquely related to a positional deviation in three-dimensional space. Hence, vectors of deviations cannot be obtained by this type of measurement. In the following, we introduce alternative methods which enable a quantification of absolute positioning accuracy for each spatial axis separately.

Hardware time lag
A positioning process involves a time-dependent response to a requested position. Due to mass inertia and signal processing two types of time lag need to be considered: 1) command versus position (reference) signal t Rj and 2) command versus position feedback signal t Fj . Hence, it is essential to quantify potential hardware lags for each axis prior to correlating feedback signals with reference positions. Time lag between x-axis command signal and reference signal was 77.5 ± 0.8 µs (n = 11 scan trials, Fig. 4(A)). The y-axis showed a significantly higher time lag, probably due to higher rotor inertia (79.5 ± 0.5 µs, Mann-Whitney U test: t Rx -t Ry , P < 0.001, n = 11 scan trials). For both axes, the lag of feedback signals was significantly higher, indicating that the feedback circuits introduce an additional delay (t Fx : 83.2 ± 1.2 µs, t Fy : 85.4 ± 0.8 µs, Wilcoxon signed rank tests: t Rx -t Fx and t Ry -t Fy , P < 0.001, n = 11 scan trials). The resulting difference between feedback and reference lag was similar for both axes (x-axis: 5.7 ± 0.5 µs, y-axis: 5.9 ± 0.5 µs, Mann-Whitney U test, P > 0.05, n = 11 scan trials).
The time lag between the axial command signal and reference signal was two orders of magnitude higher compared to x-and y-axis (t Rz : 9.3 ± 0.6 ms, n = 20 trials, Fig. 4(B)). In addition, higher amplitudes of the command signal (û Cz ) tended to result into a smaller time lag (Fig. 4(B)). Analog to the lateral axes, feedback signal displayed an additional lag component (t Fz : 9.8 ± 0.6 ms, difference t Fz -t Rz : 0.5 ± 0.0 ms, n = 20). Fig. 4. Hardware time lag of measured position signals (t Rx -x-axis reference, t Fx -x-axis feedback, t Ry -y-axis reference, t Fy -y-axis feedback, t Rz -z-axis reference, t Fz -z-axis feedback) compared to command signals. (A) Lateral measurements. Data are pooled from sinusoidal movements (amplitude range: 62 -248 µm, frequency range: 1 -2000 Hz). x-and y-axis display different lag characteristics (Mann-Whitney U test: t Rx -t Ry , P < 0.001, n = 11 scan trials). Note additional constant lag between feedback and reference measurements (Wilcoxon signed rank tests: t Rx -t Fx and t Ry -t Fy , P < 0.001, n = 11 scan trials). (B) Axial measurements. Data is pooled from sinusoidal movements (command signal amplitude û Cz : 0.625 -5 V, frequency: 1 -20 Hz). Note additional constant lag between feedback and reference measurements (two-sided students t-Test: t Rz -t Fz , P < 0.001, n = 20 scan trials). Each symbol represents lag derived from a single scan trial. *** P < 0.001. mean ± standard error of the mean.
The 0.999-quantile of all absolute deviations was 1.60 µm, indicating that the accuracy of the vast majority of positions is higher. In a next step we analyzed position deviations of the y-axis. All tested command signals displayed position deviations smaller than 2.5 µm (maximal absolute deviation: 2.38 µm, n = 484042 positions of 193 scan trials, Fig. 7(B)). The 0.999-quantile of all absolute deviations was 1.74 µm, indicating that the accuracy of the vast majority of positions is higher.
Taken together, the positioning accuracy of the x-and y-axis is at least ±2.5 µm for triangular, saw-tooth, undamped and damped sinusoidal scans of different scan amplitudes (62 -248 µm) and frequencies (1 -2000 Hz). Furthermore, hardware lag correction is essential for a high positioning accuracy.

Axial positioning accuracy
In a next step, we analyzed deviations of axial feedback positions. The main drawback of using a mechanical focussing device is its inaccuracy at high load accelerations. In the case of the used piezo actuator, the load (objective) is mounted at one side of a lever arm which is oriented perpendicularly to the optical axis. Therefore, we would expect position deviations produced by an acting torque, mainly resulting in a dynamic tilt of the load. Thus, the axial position accuracy is expected to depend on mass inertia and geometry of the load.
In order to minimize accelerations, spiral scanning uses sinusoidal command signals [2]. We therefore examined sinusoidal movements along the z-axis in an amplitude range of 0.625 -5 V (calibrated: 25 -200 µm, Fig. 5(C)) and frequency range of 1 -20 Hz. Position deviations of 50 averaged scan periods were determined (Fig. 8). Up to 2 Hz, none of the tested scans applied to the regular objective dummy displayed deviations exceeding 2.5 µm (maximal absolute deviation: 2.21 µm, n = 156 scan trials, regular piezo load in Fig. 8(B)). By increasing amplitude and/or frequency, maximal absolute deviations increased up to 15 µm (n = 260 scan trials, regular piezo load). Additionally, a hysteresis occurs at high accelerations (scan frequency: 20 Hz, scan amplitude: 200 µm, Fig. 8(A)), indicating that the positioning depends on the actuator motion direction. These data suggest an influence of objective acceleration on axial positioning accuracy.
Next, we repeated measurements using minimal load of piezo actuator to test the influence of objective mass. Interestingly, maximal absolute deviations were increased, except for 50 -200 µm scan amplitude at 20 Hz (none versus regular piezo load in Fig. 8(B) and Fig. 9). These data indicate an influence of objective mass. In order to test the influence of the center of mass independently of mass itself, two additional objective dummies of different length, but the same mass as the regular dummy were tested (short and long dummy). Whereas the short dummy displayed comparable and reduced deviation levels (short versus regular piezo load in Fig. 8(B)), not even a single scan using the long objective dummy displayed sub-threshold maximal absolute deviations (maximal absolute deviation ≥7.22 µm, n = 260 scan trials). Comparing maximal absolute deviations of scans with highest acceleration (none: 8.8 ± 1.1 µm, short: 10.9 ± 0.6 µm, regular: 14.4 ± 0.3 µm, long: 23.6 ± 1.1 µm, amplitude: 200 µm, frequency: 20 Hz, n = 13 scan trials), short dummy produced smaller deviations whereas long dummy produced higher deviations than the regular dummy [one-way analysis of variance (ANOVA): P < 0.001, n = 13 scan trials, post hoc Bonferroni pairwise comparisons: regular -short: P < 0.001; regularlong: P < 0.001, Fig. 9].
Taken together, axial positioning accuracy of the piezo-focussing actuator is limited by objective acceleration, mass and geometry and should be determined for every objective type and scan configuration. Fig. 9. Maximal absolute deviation of all four objective dummies at 20 Hz scan frequency and 200 µm scan amplitude sinusoidal motion. Each symbol represents a single scan trial. Maximal absolute deviation is dependent on objective mass and length (ANOVA: P < 0.001, n = 13 scan trials, post hoc Bonferroni pairwise comparisons: regular -none: P < 0.001; regular -short: P < 0.001; regular -long: P < 0.001). *** P < 0.001.

Discussion
Hitherto existing approaches using reference objects do not allow a quantification of the absolute three-dimensional focal volume position in line-scan or discontinuous-scan modes of two-photon laser scanning microscopes (2PLSM). In the present study, we validated the accuracy of lateral position feedback signals using a stage micrometer in combination with a reflection measurement approach. In addition, a laser triangulation sensor was used to quantify axial positioning accuracy. The probed 2PLSM displayed high lateral and acceleration-dependent axial positioning accuracy.

Three-dimensional fluorescent reference objects
A three-dimensional, fluorescent reference object with a biunique position pattern would be an ideal standard to validate the positioning accuracy of individual scan pattern. If subresolution beads (e.g.: 0.2 µm diameter) would be used as fluorescent targets, as this was frequently done for determining position dependent point spread functions [3,5,9,14,16,18,19], position deviations larger than the bead size could not be detected. Furthermore, if the targets are identical, their position is not biunique. To circumvent these constraints of a threedimensional measurement, we determined the positioning accuracy for each spatial axis separately. Of note, cross-talk between the three axes cannot be detected by this strategy. Nevertheless, we identified deviations along the z-axis which also might influence the lateral positioning accuracy.

Origin of hardware lag
Time lags can occur in any positioning device, produced by sequential steps of signal transmission, processing and filtering and should be identified before further analysis. Especially using fast scans near hardware limitations, correct timing is essential, which has been demonstrated by the lag corrected analysis of the positioning accuracy of the x-and yaxis. Here, the absolute difference in time was only ~6 µs for both feedback signals, but without the correction virtual deviations from the reference positions of up to 10 µm could be observed (0.999-quartile of position deviations x-axis without lag correction: 9.86 µm, y-axis: 9.97 µm). The source of this time lag is not known, but might be related to the closed-loop circuit of the galvanometer control device or its optical position detection itself. Whereas the standard deviation of calculated lateral time lags were in the range of the sampling interval (<1 µs), it was three orders of magnitude higher for axial time lags (0.6 ms). Moreover, axial time lags were higher using smaller command signal amplitudes. The lag was in the range of 10 ms for reference and feedback signals, respectively. Each time lag represents the combination of a delayed signal transmission and the inertia dependent step response of the piezo actuator. Since one would expect higher response times for higher steps, the observed effect of the command signal amplitude cannot be explained. As both the feedback and the reference signal displayed the same dependency, a highly reliable additional delay of the feedback signal could be identified (0.5 ± 0.0 ms). This was high compared to the x-and yaxis, but is in line with the manufacturer's data, since the feedback (output) signal is low-pass filtered (1st order, passive, R = 10 kΩ, C = 10 nF) for noise reduction.

Positioning accuracy
No deviations greater than the defined threshold of ±2.5 µm of the lateral feedback signals were detected. As the resolution of the measurement is limited (see 4.4), we do not interpret putative trends below the specified deviation threshold.
Mass inertia dependent instabilities of z-axis positioning were quantified as a difference between feedback and reference signal. The capacitance-based position measurement of the piezo actuator is located close to the basis of the actuator, which could explain a possible insensitivity to distal lever arm effects. The measured deviations of the regular dummy are in line with manufacturer's specifications for a maximal dynamic tilt angle of 500 µrad at 200 µm amplitude and 20 Hz frequency using the regular objective dummy (~17 µm with a lever arm of 34 mm, Fig. 8(A)). We cannot exclude superposition of different sources of errors resulting in the observed position deviations. Interestingly, higher position deviations occurred in scans using a long or a minimal load. In this case, additional instabilities (e.g.: ringing) might be introduced. To circumvent the constraints of a one side mounted actuator, ring actuators could be used instead at the expense of reducing applicable range of axial positioning. Alternatively, non-mechanical z-axis focussing devices are available, but introduce additional aberration [8][9][10]14].
In the present study we intended to validate position feedback signals by means of external references. In reality, the underlying assumption that these external references provide ground-truth data might be violated, for instance, due to the presence of slowfrequency mechanical drift of the reference itself (stage micrometer or triangulation sensor). To minimize such adverse effects, we restricted the external validations to comparatively short time intervals.
On the basis of the determined positioning accuracies, three-dimensional two-photon laser-scanning along a spiral trajectory is a valid and valuable technique for measuring neuronal network activity in vivo. However, our data revealed that for certain trajectories the achieved positioning accuracy would not suffice the requirements of somatic calcium imaging (here defined as deviations greater than ±2.5 µm). A common problem of in vivo recordings are motion artefacts, for instance, due to heart beat, respiration and gross body movements, especially when recording from lightly anesthetized or awake animals [20]. Deviations resulting from motion artefacts will add to position deviations as detailed above. Therefore, efforts should be undertaken to minimize additional drifts of the specimen (see for example [21,22]). A commonly used approach for reducing the impact of slow mechanical drift comprises repeated manual re-alignments which typically require brief interruptions of a recording session.

Technical aspects of reflection measurement
We estimated the maximal error of the reflection measurement to be ±2.4 µm. The following errors were included: 1) ±1.1 µm (calibrated) due to analog-to-digital conversion of the feedback signal (corresponds to ±8.8 mV of the data acquisition interface with a resolution of 2.4 mV in a range of ±5 V), 2) ±1.0 µm induced by peak detection error of the PMT signal (assuming a peak detection inaccuracy of ±1 sample and a minimum number of samples per 10-µm tick interval of 10), 3) ±0.1 µm due to horizontal misalignment of the stage micrometer, 4) tick mark precision of ±0.2 µm.
A further constraint of the presented reflection measurement is related to the fact that only discrete positions can be analyzed. Highest accelerations occur at positions at which the galvanometer changes its motion direction. In fact, the deviations of those positions cannot be measured using the described technique because the detection of tick marks requires a minimum change in position. Hence, scans of different amplitudes and frequencies were used to scan the same reference positions at different accelerations. The fact that this technique uses a commercial stage micrometer renders it applicable to a wide range of microscopes. This may also be valid for the calibration of positioning systems without feedback signals, such as acousto-optical deflectors [14,15].

Technical aspects of laser triangulation
The introduced method supports a contact free position measurement for 2PLSM systems using a mechanical focusing device. As laser triangulation is based on the detection of a diffuse reflection on a target, the latter should support high light scattering, while maintaining a plain surface. In our experiments we found that sandblasted brass, bronze or aluminum represents a good compromise. Therefore, the objective dummies were made of these materials and were sandblasted on the target surface (bottom). To overcome high noise levels due to laser speckle, raw data were averaged. We estimated the maximal error of the measurement to be ±2.3 µm. The following errors were included: 1) ±0.4 µm (calibrated) due to analog-to-digital conversion of the feedback signal (corresponds to ±9.0 mV of the data acquisition interface with a resolution of 4.9 mV in a range of ±10 V, taking noise reduction via averaging into account), 2) ±1.8 µm (calibrated) due to analog-to-digital conversion of the reference signal (corresponds to ±9.0 mV of the data acquisition interface with a resolution of 4.9 mV in a range of ±10 V, taking noise reduction via averaging into account), 3) resolution limit of the triangulation device of ±0.1 µm.

Applicability of the method
The proposed method for quantification of lateral positioning accuracy is mainly applicable to line-scanning approaches that lack regular image formation (e.g. spiral or arbitrary linescanning). In contrast, for morphological investigations, laser-scanning microscopy typically follows a raster-scanning approach producing two-dimensional images. In this case, analysis of position feedback signals is largely dispensable since absolute position information can be derived from imaging of two-dimensional fluorescent or reflective stage micrometers used as external references. Therefore, in the case of raster-scanning, position information can be directly obtained on the basis of the PMT signal which, in the present study, was used to calibrate position feedback signals. The precision of quantification depends on several parameters including: 1) sampling bandwidth and frequency of the PMT signal, 2) sampling frequency and bit depth of analog-to-digital conversion of the position feedback signal, 3) width of tick marks (preferably below the optical resolution of the microscope) and 4) tick mark distance (determining the number of discrete positions that can be analyzed).
The proposed method for quantification of axial positioning accuracy is supposed to be applicable to microscopes which employ mechanical objective movements for focusing. Accordingly, the method may also be useful for three-dimensional imaging techniques combining x-y raster-scanning with z-movements of the objective (e.g. z-stack, tilted-frame scanning [23]). In our analyses, the main component of the measurement error is related to the bit depth of the analog-to-digital conversion (12-bit) of the feedback and reference signal, respectively (see above). Hence, a major reduction of the maximum error may be achieved by using an analog-to-digital converter with a higher bit depth (e.g. 16 or 32 bit) which renders the method suitable for applications that require higher spatial precision. In addition, speckle noise could be further reduced by averaging, if high temporal resolution is not a requirement of the application.

Important practical aspects for assessing positioning accuracy
When establishing the proposed method for quantification of lateral and axial positioning accuracy, special attention should be paid to the following critical steps: 1) Selection of an adequate stage micrometer, triangulation sensor and triangulation target (we recommend an objective dummy with a plain, but scattering target area); 2) Proper alignment of the stage micrometer (i.e. parallel to the axis examined) and triangulation sensor (i.e. along the axis of objective motion) -a micromanipulator in combination with a pitch and yaw platform should provide sufficient flexibility and stability; 3) Determination of hardware lags (note that time lags may depend on scan amplitude and should therefore be tested for the respective scan configuration); 4) Calibration of position feedback signals from galvanometer-mirrors and the piezo actuator (slow scans with low accelerations should be used); 5) Measurement of positioning accuracy of the desired scan configuration by correlating position feedback signals to reference signals.

Concluding remarks
We showed that axial positioning accuracy depends on objective acceleration, mass and geometry. This may limit not only the volume of interest, but also restricts the applicability of certain types of objectives. Care should be taken when using scan trajectories with positioning deviations along the z-axis beyond the tolerable threshold, as tilt of the lever arm also influences the lateral position. This effect is neither detectable by the feedback signals of the galvanometric scan mirrors nor can it be calibrated by the demonstrated laser triangulation. Therefore, only scan trajectories with sub-threshold axial deviations should be used in threedimensional scanning.