Coordinate Systems for Navigating Stereotactic Space: How Not to Get Lost

All stereotactic neurosurgical procedures utilize coordinate systems to allow navigation through the brain to a target. During the surgical planning, indirect and direct targeting determines the planned target point and trajectory. This targeting allows a surgeon to precisely reach points along the trajectory while minimizing risks to critical structures. Oftentimes, once a target point and a trajectory are determined, a frame-based coordinate system is used for the actual procedure. Considerations include the use of various coordinate spaces such as the anatomical (\begin{document}{X}\end{document}), the frame (\begin{document}{X'}\end{document}), the head-stage (\begin{document}{X''}\end{document}), and an atlas. Therefore, the relationships between these coordinate systems are integral to the planning and implementation of the neurosurgical procedure. Although coordinate transformations are handled in planning via stereotactic software, critical understanding of the mathematics is required as it has implications during surgery. Further, intraoperative applications of these coordinate conversions, such as for surgical navigation from the head-stage, are not readily available in real-time. Herein, we discuss how to navigate these coordinate systems and provide implementations of the techniques with samples.


Introduction
In 1908, Sir Victor Horsley (1857-1916), a neurosurgeon, and Robert Clarke (1850-1926), a physiologist, ignited the field of stereotactic neurosurgery by introducing a frame to navigate the structures of the Macacus rhesus cerebellum methodically using "electrolytic" lesions [1,2]. By 1947, Ernest Spiegel (1895Spiegel ( -1985, a neurologist, and Henry Wycis , a neurosurgeon, applied these frame techniques for human use in the treatment of pain, epilepsy, mental disorders, movement disorders, and tumors [3][4][5]. While at that time the devices were primitive, the idea was revolutionary as it was built on mathematics applied to an apparatus designed to navigate regions of the brain. In 1978, the next big leap forward was an invention by Russell Brown that precisely mapped computed tomography (CT) imaging with a stereotactic frame using an N-localizer [6][7][8]. This creation, which later merged with image fusion and magnetic resonance imaging (MRI), allowed precise stereotactic targeting in neurosurgery.
Historically, coordinate systems are a key element in the practice of stereotactic neurosurgery. These systems are utilized during the surgical procedures; therefore, a robust understanding is critical for those using them. For this reason, we hope to re-introduce some important concepts previously published and expand upon them further as a complete solution for the surgical technique.

Technical Report Background transformations
Various Cartesian coordinate systems in Euclidean space are utilized in stereotactic neurosurgery. The affine conversion of one coordinate system to another is often computed from one coordinate set to the other coordinate set using matrices that specifies information on rotation , scaling , and translation (Equation 1). These conversion matrices can be solved using three or more points using various methods [9][10][11]. The components of and consists of and , respectively. The rotational matrix consists of nine components , while the scaling and translation components have three (Equations 2). It should also be noted that the matrix components can also be treated as individual functions in a non-linear fashion. For example, scaling factors can be functions ( , or ) used to compensate for distortions of the brain relative to an atlas.
The constitution of the component matrices (Equation 2), which allow conversion from one coordinate to another, depends on the space for which the mathematical operation is being performed. Some of these coordinate spaces include an anatomical space , a frame-based space , and a head-stage space ( Figure 1). Frequently, an atlas is used in reference to the anatomical space. The general scheme of Equation 1 can be applied in the transformations of these coordinate spaces for which each operation is discussed in detail ( Figure 1, Right Pane, A-D) in subsequent sections. Of note, the x-axis is generally considered the left-right (LAT) direction, the y-axis is the back-front (AP) direction, and finally the z-axis the down-up (VERT) direction, which is right-anterior-superior (RAS) convention; however, some conventions flip the x-y axes making the x-axis AP and y-axis LAT. Lastly, anatomical space is built off of reference points in the brain, such as the anterior commissure (AC), posterior commissure (PC), and a midline point (Midline), whereas frame-based space is generated using an N-localizer [6][7][8]. We also discuss head-stage to anatomical transformation in frameless stereotaxy in addition to computation of coordinates along a fixed trajectory, both of which are generally in anatomical space.

Anatomy-Frame Transformation (A)
A method of rigid coordinate transformation in stereotactic neurosurgery without the need for scaling because the systems are all in units of millimeters (mm), using three points has been previously published, but is worth reviewing [12][13][14][15]. In this 3-point transformation (3PT), one can think of the problem in matrix form where represents an unknown rotational matrix from frame-to-anatomic systems, represents the anatomic coordinate space, is the frame coordinate space, and represents a translation (Equation 3). The unknowns are , which represent the unknown elements of the rotational matrix, and , which represents a translation (Equation 4). Likewise, the reverse coordinate transformation is possible (Equations 5, 6), where (-1) represents the matrix inverse. Now we identify the components in more detail. First, we consider the stereotactic space relative to the middle of the anterior commissure (AC, ) and posterior commissure (PC, ), which we refer to as but is alternatively termed as the mid-commissural coordinate system. At this point, the space is 0 in the antero-posterior (AP), 0 in the lateral (LAT), and 0 in the vertical (VERT) ( = {0,0,0}). This same point, however, exists in stereotactic frame-space . The point in frame-space will generally never be {0,0,0}, but rather some other values, by virtue of frame-based coordinates design or misalignment of the two systems during frame placement.
To facilitate subsequent transformation, it is now useful to obtain three points of reference in frame-based space. Generally, these points consist of the AC ( ) , PC ( ), and a midpoint ( ) above or below a line connecting AC to PC, but not along that line; for instance, the falx cerebri or a midline ventricular structure are good locations to obtain . Using and , we can now compute the by taking their simple average (Equation 7).
To complete the conversion, we must now determine the components of the rotational matrix . In space, the basis unit vector is defined as (1,0,0), (0,1,0), and (0,0,1), which are , , respectively. In frame-based space, two vectors, and , are created by using the three points, , , and , which will allow us to compute the unit vectors , , (Equations 8,9).
Using the two vectors and , we can next convert these into unit vectors and , by dividing them by their own magnitude (Equations 10, 11).
The unit vector is equivalent to . The result of the cross-product of gives , when divided by the resulting magnitude. Finally, the result of the cross-product gives , when divided by the resulting magnitude. These cross-products follow the right-hand rule convention and if the midpoint ( ) is below the AC-PC line, then the cross-product for would be . Next, the dot-products of the unit vectors between the coordinate systems give us the components of the matrix (Equation 12).

Head-Stage-Frame Transformation (B)
Whereas the target is defined by a point, the trajectory through the brain to a target is defined by a direction and a probe-insertion depth. In frame-based stereotaxis, the surgical space has a coordinate basis related to the surgical head-stage for which the trajectory angles and the electrode/probe depth need to be calculated. This important coordinate system is directly utilized by the surgeon in real-time after the anatomic and frame-based systems are set. We consider here isocentric frame-based systems, which allow rotations around a target (targetcentered), but maintain the same radial distance to target. In most frame systems, there is an arc angle , a ring angle , an "XY Stage", and a depth. The target and frame angles are usually predetermined in planning software, but may be slightly adjusted in real-time to accommodate brain structures, the burr hole, and physiology while the depth is determined manually using fine vernier scales or digitally using microdrives. Generally, the transformation matrix comprises two angles, where is an angle about the x-axis (Equation 13) and is the angle about the y-axis (Equation 14). In some systems, it may be possible to have a rotational matrix about the z-axis , which can also be used for electrode rotation (Equation 15). is therefore a combined rotational matrix corresponding to a rotation of about the AP axis, and a rotation of about the LAT axis, and no rotations about the VERT axis (Equation 16). A combination of all three rotational angles into a single matrix may also be utilized in some systems (Equation 17). Using this transformation, a movement in the direction of AP, LAT, or VERT on the head-stage is then converted to a new target frame-based point using the current frame-based point and , which has combined rotation angles in the frame-based system (Equation 18). The conversion from to is the same as previously mentioned. Finally, to obtain , one can utilize the current frame-based point , a desired new target frame-based point , , and rearrange the terms of Equation 18 (Equation 19). Because is a combined Euler rotational matrix, it is equivalent to the transpose of .
It should be noted here that different frame systems have different displacement and angular components. For example, in CRW (Radionics CRW Stereotactic System, Integra LifeSciences Corporation, Plainsboro, New Jersey), LAT to the right is (+), AP towards anterior is (+), and VERT upwards is (+). In Leksell G (Elekta, Stockholm, Sweden), however, LAT to the right is (-), AP anterior is (+), and VERT upwards is (-) ( Table 1). It is notable that angular data can also be used in anatomic space and one can also convert to a spherical coordinate system. Further, many of the angles in the systems may be offset from , such as the ring angle in CRW. Also, in CRW, when the is to the right, the angle is positive, but when it is to the left, it is negative; when is anterior, the angle is positive, but when it is posterior, it is negative. Another issue is the apparatus assembly, which would flip these angles. Therefore, numerical data for angles in each system require a modification prior to use. Lastly, some frame systems are not targetcentered ("isocentric") and other considerations are required.

Head-Stage-Anatomy Transformation in Frame-Based Stereotaxy (C)
Multiplying the matrix by the matrix produces the matrix that transforms coordinates from the head-stage to (Equation 20). The complete transformation from a movement on the head-stage to a new anatomic point utilizes the current

Head-Stage-Anatomy Transformation in Frameless Stereotaxy
In some systems, frameless stereotaxy is utilized. In these instances, there is a single anatomical coordinate system, . However, the head-stages may have calibrated displacements in addition to the optical tracking systems. As some of the systems use all three angles, a combined anatomical rotational matrix can be utilized, which incorporates a coronal angle , a sagittal angle , and an axial angle , which are different than the framebased angles previously mentioned (Equation 17). The complete transformation from a movement on the head-stage to a new anatomic point , utilizes the current point , the , and (Equation 23). Finally, to move to a desired target point , the head-stage movements can be computed (Equation 24).

Calculation of Points Along a Single Fixed Trajectory
While the above sections provide insight into full computations from head-stage to anatomy, it may be useful to compute points along a single fixed trajectory. For this method, two points are required, an entry and a target . Also required, the third element is the displacement along the trajectory, which can be treated as a fraction of the vector to . This fraction is easily derived in stereotactic neurosurgery from the millimeter distances on vernier scales or computerized microdrives from entry to target as the current scalar distance for the numerator, while the denominator is the Euclidean distance from to (Equation 25). Finally, a new position can be computed (Equation 26).

Implementation
The following implementation of the discussed mathematics were computed in a Stereotactic Calculator (STACC) and other tools using custom software available at https://app.box.com/s/4zxysoc3bltxvvt4cwcplpbkntoi9cll. A complete plan was utilized from iPlan Stereotaxy 3.0 (Brainlab, Inc., Feldkirchen, Germany) with all the essential coordinates from and CRW ( Table 2). In this computation, several points are gathered in CRW and space in order to perform the conversions. A comparison between the coordinate conversion using 3PT versus using 5-points was made. The 5-point conversion utilized a least-squares computation between five pairs of coordinates [9]. Comparing the result with the iPlan target values demonstrates a very slight improvement in the Euclidean error rates when using the 5-point technique as compared to the 3PT. This is likely due to a decimal point round-off error as provided by the planning station.   Next, we analyzed the matrix used to compute the conversion between and CRW. The resultant matrices in the forward and reverse match between 3PT and 5-point methods ( Table 3). Further, we analyzed the orthonormality of each 1 x 3 vector component, with the expectation that the quantity would be 1. Orthogonality compares the vector components between the first and second rows, the second and third rows, and the first and third rows. In an orthogonal system, one would expect the result to be 0. In Table 1, we can see that we have good normality and orthogonality with all the matrices.

Analysis of the 3 x 3 vector component of each matrix by orthonormality and
orthogonality are close to 1 and 0, respectively, which would be expected in this affine system.
The added value of all of these computations is the ability to move forward and backwards between all the coordinate systems. One of the most valuable conversions during surgery may be the desire to move from a current point to a planned point. These adjustments on the surgical head-stage need to be computed. In our sample we presume the target point (AP, LAT, VERT) coordinates to be (-3, -11.5, -3), but the current position based on intraoperative imaging is (-4.4, -10.3, -4.2). In order to move the electrode point to the target, one would need to move (0.53, -0.71, 2.02) on the head-stage ( Table 4). This information is informative as one may also realize that the radial error is 0.89 mm and the Euclidean error is 2.2 mm. Therefore, the largest displacement error is along the trajectory depth.

AP LAT VERT
CRW Planned Position -0.   It may also be important to analyze how 2 mm adjustments on the head-stage effect the coordinates. Here, we take the target position and make various changes on the head-stage. Each new position is seen as well as their changes to the original position in each dimension. Oftentimes, 2 mm adjustments are made by the surgeon on the head-stage, which are presented in the AP, LAT, and VERT dimension ( Table 5). Finally, a new target coordinate is selected and the necessary head-stage operation to reach that coordinate from the original target is computed.

Anatomy-Atlas Navigation (D)
An important aid is obtained by mapping a point to an atlas. While simple navigation of a single slice on an atlas is straightforward, we discuss the more general task of navigating all the atlas slices relative to a point. Treating the electrode position as a point ( ) and the plane as a slice from an atlas, one can then calculate the closest plane using a Point-to-Plane computation.
E → This is done by picking three points in the plane, , , and . Two vectors are then created and . The normal of the plane is then , where has three components, , , and can then be solved for each plane equation of the atlas sections (Equation 27). The distance from point to the plane is computed, which gives the closest atlas slice (Equation 28). Then the closest point in the plane to can be computed by first solving for the unknown parameter using a known point in the plane, such as (Equation 29). Then using , we can then solve for the final values (Equations 30-32). The next task is mapping to the screen coordinates. This can be accomplished using 3 pairs of coordinates of the atlas in 3D-2D (three dimensional -two dimensional) using similar mathematics previously published by Brown, where a conversion matrix is solved and then is applied to the inverse matrix to identify the screen coordinates and (Equations 33, 34) [16]. In some instances, the determinant of can be zero when using an atlas section with zeros in a dimension, making the matrix not invertible for Equation 34; in this instance, one can alternatively utilize a 2D or alternative approach. The screen coordinates are then placed on the Morel atlas (Figure 2) [17]. Finally, one can use the matrix to compute any point from any screen coordinates and (Equation 35). Notably, this same technique can be utilized with CT or MRI slices.
If a trajectory is known one can alternatively utilize a line-plane intersection to identify the point in a given atlas section. First, we consider the atlas section of interest, which represents a plane (Equation 27). Then the trajectory can be represented as parametric line equations (Equations 37-39). The point in the plane can then be computed with a line-plane intersection solution (Equations 40-42). Finally, the point in the atlas plane can then be mapped to the screen coordinates using Equations 33 and 34.  (37) All Coordinates are given as {AP, LAT, VERT} 3D = Three Dimensional Morel Atlas: please refer to reference [17].
Because we can now map points along a trajectory, it may be useful to compute 3D (threedimensional) kinesthetic points, which are points acquired by along a depth during intraoperative neurophysiological mapping. Then, using stereotactic intraoperative localization (STiL), these kinesthetic points can be mapped directly to an X-ray image, which can be valuable for deep brain stimulation (DBS) programming (Figures 3, 4) [18]. These same kinesthetics can also be mapped to the atlas. Here, we have compiled 2137 individual kinesthetic points matched to the closest point on the atlas slices for the ventral intermediate nucleus of the thalamus (VIM), the globus pallidus interna (GPi), and the subthalamic nucleus (STN) ( Figure 5). In VIM, one can observe that arm and leg kinesthetics appear to separate, but in GPi and STN they are largely overlapping.  Another approach may normalize an atlas coordinates to anatomical coordinates, or vice versa. Using the above 3PT method, information that can be used is the distance from AC to PC, which is often known in a stereotactic atlas as well. Note that for the 453-patient sample in our series, the average AC-PC distance was 25.016 mm +/-1.42 mm. While this normalization is only in the AP axis, further sampling of comparable points on the patient MRI and the atlas may theoretically render an improved conversion matrix. While many complex atlas-to-brain normalizations exist, this method is simpler but yet effective for basal ganglia targeting. Normalization in this single AP axis provides significant improvement in registration of the Montreal Neurological Institute (MNI) atlas without any added complexity ( Figure 6) [19]. Kinesthetic points can then be placed directly into these images (Figure 7).

Discussion
Stereotactic operations in neurosurgery have become commonplace in many institutions for the treatment of movement disorders, epilepsy, and psychiatric disease. Essential to these operations is the mathematics related to Cartesian coordinate systems in Euclidean space. Stereotactic planning software generally computes target information for the surgeon, but is often insufficient for guiding decisions during the procedure. Therefore, keen understanding of coordinate systems is critical to enable the neurosurgeon to guide an electrode to the desired location. Clearly, precise targeting can affect patient outcomes [20]. For this reason, we have consolidated a complete, usable, and effective framework that navigates the various coordinate systems with examples. These methods can be implemented during surgical procedures or basic science laboratories.
Herein, we have described coordinate transformations utilized for anatomical space, framebased space, surgical head-stage space, and atlas space. Importantly, surgical head-stage movement as it relates to the target is required by the surgeon. Further, we have demonstrated previously the ability of using simple biplanar X-ray to achieve real-time sub-millimeter localization of the position of an electrode [18]. Combining these techniques can allow a surgeon to make real-time decisions on electrode position, compute the location where important neurophysiological data are obtained, and assimilate this information into longitudinal data. These techniques may be especially important in some centers in view of the increased occurrence of asleep DBS, the reduction of intraoperative neurophysiological assessments, and the attendant omission of stimulation mapping. Since these asleep surgeries are guided purely by anatomical planning, the assurance of positioning, the comparison to prior data, and the ability to microposition (<2 mm) electrodes at the level of the head-stage may optimize the outcome. Moreover, in standard awake DBS, these techniques can also be utilized and guided by intraoperative mapping. Implementation of these principles to stereotactic neurosurgery may enhance our understanding of the normal and the pathological brain as well as the treatment of various diseases.

Conclusions
Stereotactic neurosurgery frequently involves numerous coordinate systems. An understanding of these coordinate systems may be important for real-time surgical decisions and precise targeting. In frame-based stereotaxis, converting coordinates between different systems is important but beyond the initial stereotactic plan, these techniques are often not provided by the stereotactic planning software. Therefore, we provide a common framework with which these important techniques can be understood and implemented.

Additional Information Disclosures
Human subjects: All authors have confirmed that this study did not involve human participants or tissue. Animal subjects: All authors have confirmed that this study did not involve animal subjects or tissue. Conflicts of interest: In compliance with the ICMJE uniform disclosure form, all authors declare the following: Payment/services info: All authors have declared that no financial support was received from any organization for the submitted work. Financial relationships: Armando Bouza declare(s) Owner of company from MNPS. 50% owner of MNPS Stereotactic Software. Other relationships: All authors have declared that there are no other relationships or activities that could appear to have influenced the submitted work.