The Mathematics of the N-Localizer for Stereotactic Neurosurgery

The N-localizer enjoys widespread use in image-guided stereotactic neurosurgery and radiosurgery. This paper derives the mathematical equations that are used with the N-localizer and provides analogies and explanations in order to promote an intuitive understanding of the mathematical principles. Categories: Medical Physics, Radiation Oncology, Neurosurgery


Introduction
The mathematical treatment of the N-localizer has been discussed previously [1].The Nlocalizer comprises a diagonal rod that extends from the top of one vertical rod to the bottom of another vertical rod (Figure 1).This N-shaped structure produces two circles and one ellipse in sectional images that are obtained via medical imaging technologies, such as computed tomography or magnetic resonance imaging [1][2].In the scan image, each of the two vertical rods creates a fiducial circle and the diagonal rod creates a fiducial ellipse.The ellipse moves away from one circle and towards the other circle as the position of the scan section moves upward with respect to the N-localizer.
It is convenient to ignore the thickness of the scan section and to represent the scan section as an infinitely thin plane.This central plane lies midway between the top and bottom halves of the section, analogous to the way that a slice of cheese is sandwiched between two slices of bread.
It is also convenient to ignore the diameter of each of the three rods and to represent each rod by its long axis.The intersection of the long axis of each rod with the central plane of the scan section defines a point at the centroid of the circle or ellipse that is created by the rod (Figure 1).The relative spacing between the three centroids permits precise localization of the central plane of the scan section relative to the N-localizer.The distance between the centroids of circle and ellipse and the distance between the centroids of circles and are used to calculate the ratio .This ratio represents the fraction of the diagonal rod that extends from the top of vertical rod to the point of intersection of the long axis of rod with the central plane of the scan section.The fraction is a dimensionless number due to the fact that the units of measurement of and are eliminated in the division of by .For this reason, the distances and may be measured in any units that are convenient, e.g., millimeters, pixels, etc., so long as the same units are used to measure both and .used to calculate the ratio .This ratio represents the fraction of diagonal rod that extends from the top of rod to the point of intersection of rod with the scan section.These geometric relationships are valid, even if the scan section is not perpendicular to the vertical rods, as can be demonstrated using similar triangles [2].
The fraction is used to calculate the coordinates of the point of intersection between the long axis of rod and the central plane of the scan section.In Figure 2, the points and represent the beginning and end, respectively, of the vector that extends from the top of rod to the bottom of rod .This vector coincides with the long axis of rod .The coordinates of the initial point and the coordinates of the end point are known from the physical dimensions of the N-localizer.Hence, linear interpolation may be used to blend the and coordinates of points and in order to calculate the coordinates of the point of intersection between the long axis of rod and the central plane of the scan section The vector form of Equation 1shows explicitly the , and coordinates of the respective points , and Either Equation 1 or 2 may be used to calculate the coordinates of the point of intersection between the long axis of rod and the central plane of the scan section.The point , which lies on the long axis of rod in the three-dimensional coordinate system of the N-localizer, corresponds to an analogous point , which lies at the centroid of ellipse in the two-dimensional coordinate system of the scan image.Hence, there is a one-to-one correspondence between a point from the N-localizer and a point from the scan image.

Technical Report
The attachment of three N-localizers to a stereotactic frame permits calculation of the , and coordinates for the three respective points of intersection , and in the three-dimensional coordinate and in the two-dimensional coordinate system of the scan image (Figure 4).Because three points determine a plane in three-dimensional space, the three coordinates , and together with the analogous three coordinates , and determine the spatial orientation of the central plane of the scan section relative to the stereotactic frame.This spatial orientation permits transformation of the coordinates of a target point from the two-dimensional coordinate system of the scan image into the three-dimensional coordinate system of the stereotactic frame to obtain the coordinates of the analogous target point .In order to facilitate calculation of the coordinates of the target point , it is convenient to project the , and coordinates of the three centroids , and onto the plane in three-dimensional space by appending a third coordinate to create , and coordinates.Thecoordinate may be set arbitrarily to any non-zero value, e.g., 1, so long as same value of is used for each of the three -coordinates.The equations that are presented in the remainder of this paper assume that a value of has been used to project the , and coordinates.If a value of were used instead of to project these coordinates, the equations that are presented in the remainder of this paper would no longer apply and would require revision so that the calculations that these equations describe may produce correct results.
The correspondence, or transformation, between the two-dimensional coordinate system of the scan image and the three-dimensional coordinate system of the stereotactic frame may be represented using the three pairs of coordinates , and in the matrix equation Equation 3 represents concisely a system of nine simultaneous linear equations that determine the spatial orientation of the central plane of the scan section relative to the stereotactic frame.This equation transforms coordinates from the two-dimensional coordinate system of the scan image into the three-dimensional coordinate system of the stereotactic frame.
Equation 3 assumes a linear relationship between the three-dimensional coordinate system of the stereotactic frame and the two-dimensional coordinate system of the scan image.Any nonlinear distortion, such as might occur in the creation of a magnetic resonance image, would invalidate this linear relationship and nullify the applicability of Equation 3.For this reason, the Brown-Roberts-Wells (BRW) stereotactic frame that was used initially in conjunction with computed tomography imaging required modification for use with magnetic resonance imaging.This modification eliminated magnetically-induced eddy currents in the stereotactic frame that contributed to non-linear distortion of the magnetic resonance image [10].
An analogy provides insight into how the transformation of Equation 3 operates.Consider the scan image to be an elastic membrane.The transformation describes the processes of stretching the membrane in the plane of the scan image, rotating the membrane about an axis that is normal to the plane of the scan image, tilting the membrane if necessary so that it is not parallel to the base of the stereotactic frame, and lifting the membrane into place upon the scaffold of the three N-localizers such that the three centroids , and from the scan image precisely coincide with the respective three points , and from the stereotactic frame.Then any point that lies on the membrane, for example, a target point , will be transformed by the same stretching, rotating, tilting and lifting processes that transformed the three centroids , and .In this manner, the coordinates of a target point may be transformed from the two-dimensional coordinate system of the scan image into the three-dimensional coordinate system of the stereotactic frame to obtain the coordinates of the analogous target point .
In order that Equation 3 may calculate the correct transformation, each of the three centroids , and from the scan image must be paired with the correct one of the three points , and from the stereotactic frame so that each of the three , and coordinates may be paired with the correct one of the three , and coordinates when these pairs of coordinates are substituted into Equation 3.There are six possible pairings, or combinations, for these points, but only one of these combinations is correct.A simple solution to this pairing problem was implemented for Brown's prototype stereotactic frame (Figure 5) as well as for the BRW stereotactic frame [4].One of the six vertical rods , , , , and was manufactured to a larger diameter than the other five vertical rods (Figure 5).This large vertical rod was labeled rod .The diagonal rod that joined this vertical rod was labeled rod .
Then, proceeding sequentially around the circumference of the stereotactic frame in the same direction as the direction from rod to rod , the remaining rods that were encountered in sequence were labeled , , , , , and .This ordering for the rods permitted unambiguous labeling of the three diagonal rods , and and thereby permitted assignment of the three respective points of intersection , and between the long axes of these rods and the central plane of the scan section.This labeling was performed only once and became part of the geometric description of the BRW stereotactic frame.The prototype stereotactic frame was used to test the concept of the N-localizer by targeting the small spheres inside the frame [1][2].The three N-localizers are placed around a hemicircumference of the base of the frame and are merged end to end such that they comprise three diagonal rods and four vertical rods.This merged arrangement of the N-localizers was also used in the early models of the BRW stereotactic frame [3][4].Later models of the BRW stereotactic frame placed three distinct N-localizers at equal intervals around the full circumference of the base of the frame such that they comprised three diagonal rods and six vertical rods (Figure 3).
The vertical rod at the right rear of the prototype stereotactic frame is larger in diameter than the other rods.This large rod facilitates unambiguous pairing of each of the centroids , and in the scan section (Figure 4) with the correct one of the points of intersection , , and between the long axes of the three diagonal rods and the central plane of the scan section (Figure 3).A computer search can automatically label the fiducial marks in the scan image using somewhat the same algorithm that has been described above.First, the computer finds the nine fiducial marks by searching the scan image for circular or elliptical shapes that are surrounded by air density.Each mark is characterized by (1) the coordinates of its centroid; (2) its shape, i.e., circular or elliptical; and (3) its size, i.e., the number of pixels that it subtends.Then the largest circle is identified by both its circular shape and its size; this circle is labeled .Then the Pythagorean distances between the centroid of circle and the eight remaining centroids are calculated to identify the closest mark to circle ; this mark is labeled ellipse .Then, excluding circle , the Pythagorean distances between ellipse and the seven remaining centroids are calculated to identify the closest mark to ellipse ; this mark is labeled circle .
Then, excluding circle and ellipse , the Pythagorean distances between circle and the six remaining centroids are calculated to identify the closest mark to circle ; this mark is labeled circle .This process of calculating the Pythagorean distances between the last mark identified and the remaining unidentified marks continues until all nine of the fiducial marks have been identified in the order , , , , , , , and .The computer can check the validity of the labels using the fact that each of the three sets of marks , and must contain three collinear marks.
This collinearity requirement is obvious from inspection of Figure 1B, which suggests that the centroid of each of the three ellipses , and is guaranteed to lie on a line that connects the centroid of the respective circle , or to the centroid of the respective circle , or .
Independent of whether assignment of the fiducial marks occurs manually or automatically, the large rod facilitates unambiguous pairing of each of the three ellipses , and with the correct one of the three diagonal rods , and , and thereby permits unambiguous pairing of each of the three centroids , and with the correct one of the three points , and .Hence, each of the three , and coordinates may be paired with the correct one of the three , and coordinates, thus allowing Equation 3 to calculate the correct transformation from the twodimensional coordinate system of the scan image into the three-dimensional coordinate system of the stereotactic frame.
Equation 3 may be rewritten in more compact form as In Equation 4, represents the matrix of , and coordinates from the coordinate system of the stereotactic frame.represents the matrix of , and coordinates from the coordinate system of the scan image.represents the matrix of elements through that defines the transformation from the two-dimensional coordinate system of the scan image into the threedimensional coordinate system of the stereotactic frame.
represents the postmultiplication of by and relies on the fact that multiplication of one matrix by another matrix is a defined algebraic operation.However, the multiplication of matrices is not commutative, so should be described as either post-multiplication of by or premultiplication of by .
The elements of and are known, but the elements of are unknown.It is possible to invert Equation 4to obtain the elements of In this equation, represents the inverse of matrix .Division of one matrix by another matrix is not a defined algebraic operation, so multiplication of one matrix by the inverse of another matrix is used in place of division.Hence, pre-multiplication of by is equivalent to dividing by .The inverse of is guaranteed to exist so long as the , and coordinates of the centroids of the three ellipses , and are not collinear and their -coordinates are non-zero.
Once the elements of matrix have been calculated via Equation 5, it is possible to transform the coordinates of a target point from the two-dimensional coordinate system of the scan image into the three dimensional coordinate system of the stereotactic frame to obtain the coordinates of the analogous target point .In order to accomplish this transformation, the coordinates of are used to form the vector that is post-multiplied by matrix to obtain the vector that contains the coordinates of Moreover, it is possible to use the inverse of matrix to perform a similar transformation in the reverse direction.This reverse transformation transforms the coordinates of a point from the three-dimensional coordinate system of the stereotactic frame into the two-dimensional coordinate system of the scan image to obtain the coordinates of the analogous point .In order to accomplish this reverse transformation, the coordinates of are used to form the vector that is post-multiplied by matrix to obtain the vector that contains the coordinates of Equation 8 yields coordinates for instead of coordinates.
The -coordinate equals 1 if and only if the point lies in the central plane of the scan section that corresponds to the plane in three-dimensional space; similarly, appears in the two-dimensional scan image if and only if .In the case that does not lie in the central plane of the scan section, so does not appear in the scan image.
One case where does not appear in the scan image occurs when the point and a second point define the intended trajectory of a surgical probe but neither nor lies in the central plane of an intermediate scan section (Figure 7).In this case, and so neither nor appears in the intermediate scan image.
However, in this case, the neurosurgeon may wish to know where the intended probe trajectory intersects the intermediate scan section.In order to provide this information, the points and are used to define the vector from to .This vector is then used to calculate the coordinates of a third point for which (Figure 7).Because , appears in the intermediate scan image; hence, a mark may be superimposed on that scan image at the coordinates to indicate where the intended probe trajectory intersects the intermediate scan section [1].

Derivation of equation 3
Equation 3 transforms coordinates from the two-dimensional coordinate of the scan image into the three-dimensional coordinate system of the stereotactic frame to produce coordinates.Prior to use in Equation 3, the coordinates are projected onto the plane in three-dimensional space by appending a third coordinate to create coordinates.

Equation 3 is derived as follows:
Transformation of coordinates from one three-dimensional coordinate system into another three-dimensional coordinate system may be accomplished via matrix multiplication that operates in a four-dimensional space [5].However, in order that this four-dimensional space may be used to transform the two-dimensional coordinates into three-dimensional coordinates, it is necessary to create three-dimensional coordinates by projecting the coordinates onto the plane in three-dimensional space by appending a third coordinate .hen it is necessary to create four-dimensional coordinates by projecting the coordinates onto the hyperplane in four-dimensional space by appending a fourth, homogenous [6] coordinate .The coordinates may be transformed to obtain coordinates using a four by four transformation matrix that contains the matrix elements through In Equation 13, the third row of the transformation matrix includes elements , and and the fourth row includes elements , and .This non-standard numbering convention for these matrix elements is convenient to the remainder of this derivation of Equation 3. Also, the matrix elements in the fourth column of this transformation matrix have the values of 0, 0, 0 and 1 because Equation 13 expresses a transformation that comprises only scale, rotate and translate operations [6].These operations accomplish the stretching, rotating, tilting and lifting processes that were described in association with Equation 3.
Equation 13 may be rewritten in more compact form as In Equation 14, represents the matrix of , and coordinates.represents the matrix of , and coordinates.represents the transformation matrix of elements through that defines the transformation from the two-dimensional coordinate system of the scan image into the three-dimensional coordinate system of the stereotactic frame.
A comparison of Equations 3 and 13 reveals that both equations produce identical results for the , and coordinates.The third column of and the third row of do not affect the , and coordinates.
The fourth column of affects only the fourth column of but does not affect the , and coordinates.Hence, these columns and this row may be removed from , and without affecting the result of Equation 13.Their removal yields Equation 3, thus completing the derivation of this equation.
There is a significant difference between Equations 3 and 13.None of the matrices in Equation 13have an inverse because neither nor is a square matrix.In contrast, the matrices , and in Equation 3potentially have inverses because these matrices are square matrices.Equations 5, 7 and 8 require that these matrices have inverses.Hence, in order to express the transformation from the two-dimensional coordinate system of the scan image into the three-dimensional coordinate system of the stereotactic frame and vice versa, Equation 3 must be used instead of Equation 13.

Derivation of the distance w-1
Equation 9 calculates the interpolant or extrapolant in the coordinate system of the scan image.This interpolant or extrapolant is calculated in terms of the perpendicular distance from a point to the plane of the scan image.The distance is derived as follows: In the three-dimensional coordinate system of the stereotactic frame, the equation for the central plane of the scan section is given by the following equation that involves a determinant [7] Expanding this determinant using the cofactors [8] of the elements , , and 1 in the first row of the determinant yields where , , and represent the determinants in Equation 16.The determinants , and may be expanded using the cofactors of the elements in their third columns as follows The normalized perpendicular distance from a point , which has coordinates , to the central plane of the scan section may be calculated as [7] This equation for the normalized perpendicular distance will be compared to the equation for the distance that is derived below.
In order to calculate the distance , the coordinates of the point that corresponds to the point are obtained by transforming the coordinates of via Equations 7 and 8 then by substituting the definitions of the matrices , and from Equation 3Substituting the inverse of the matrix , which is defined as its adjoint [9] divided by its determinant, into Equation 20 yields interpolant or extrapolant according to Equation 9.
Although it is not necessary to normalize the distance for use in Equation 9, it may be desirable to normalize this distance for other reasons.Normalization may be accomplished by dividing the expression for from Equation 25 by because the equation that results is identical to Equation 19Equations 21, 22 and 23 suggest that the normalization may be accomplished using the elements from the third column of the inverse matrix that is used to transform the coordinates of to obtain the coordinates of .These matrix elements may be used for the normalization because where , and are suggested by Equation 23 and defined by Equation 18.

Conclusions
The N-localizer is a simple yet powerful tool for image-guided stereotactic neurosurgery and radiosurgery.The N-localizer enables the transformation of coordinates from the twodimensional coordinate system of the computed tomography or magnetic resonance image into the three-dimensional coordinate system of the stereotactic frame to obtain coordinates.The matrix that accomplishes this transformation may be inverted; the resulting inverse matrix enables the transformation of coordinates from the the threedimensional coordinate system of the stereotactic frame into the two-dimensional coordinate system of the computed tomography or magnetic resonance image to obtain coordinates.
The mathematical equations that express these two transformations may be derived using the principles of analytic geometry and linear algebra.

FIGURE 1 :
FIGURE 1: Intersection of the scan section with the N-localizer Side view of the N-localizer.The scan section intersects rods , and .Scan image.The intersection of the scan section with rods , and creates fiducial circles and and fiducial ellipse in the scan image.The distance between the centroids of circle and ellipse and the distance between the centroids of circles and are

FIGURE 2 :
FIGURE 2: Calculation of the point of intersection between the rod and the central plane of the scan section The long axis of rod is represented by a vector that extends from point at the top of rod to point at the bottom of rod .The coordinates of point and the coordinates of point are known from the physical dimensions of the Nlocalizer.Hence, the ratio may be used to blend the and coordinates of points and via linear interpolation as indicated by Equations 1 and 2. This interpolation calculates the coordinates of the point of intersection between the long axis of rod and the central plane of the scan section.

FIGURE 3 :
FIGURE 3: Representation of the central plane of the scan section in the three-dimensional coordinate system of the stereotactic frame The quadrilateral represents the central plane of the scan section.The large oval depicts the base of the stereotactic frame.The vertical and diagonal lines that are attached to the large oval represent the long axes of the nine rods.The six fiducial circles and the three fiducial ellipses that are created in the scan image by these rods are shown lying in the central plane.The centroids of these circles and ellipses are represented by dots that also lie in the central plane.The central plane intersects the long axes of the three diagonal rods at points , , and that coincidewith the respective centroids , and of the three ellipses (Figure4).The , and coordinates of the respective points of intersection , , and are calculated in the three-dimensional coordinate system of the stereotactic frame using Equations 1 and 2. Because these three points determine a plane in three-dimensional space, the spatial orientation of the central plane is determined relative to the stereotactic frame.A target point lies in the two-dimensional coordinate system of the central plane.The coordinates of the analogous target point must be calculated in the three-

FIGURE 4 :Figure 3
FIGURE 4: Representation of the two-dimensional coordinate system of the scan image Three N-localizers create three sets of fiducial marks , and .Each set contains two circles and one ellipse.For each set, the short doubleended arrows indicate the distance between the centroids of circle and ellipse and the long double-ended arrows indicate the distance between the centroids of circles and .The centroids , and of the three ellipses coincide with the respective points of intersection , , and of the long axes of the three diagonal rods with the central plane of the scan section (Figure 3).The , and coordinates of the centroids , and correspond respectively to the , and coordinates of the points of intersection , , and .A target point has coordinates in the two-dimensional coordinate system of the scan image.The coordinates of the analogous target point must be calculated in the threedimensional coordinate system of the stereotactic frame.The large circle facilitates pairing of each of the , and coordinates with the correct one of the , and coordinates as required by Equation 3 (see

FIGURE 5 :
FIGURE 5: Three N-localizers are attached to the prototype stereotactic frame

2013 4 .
Brown et al.Cureus 5(10): e142.DOI 10.7759/cureus.142In a similar manner, the large rod permits unambiguous labeling of the three ellipses , and in each scan image.This large rod creates circle that is larger in diameter than the other five circles in the scan image.A comparison of Figure 4 to Figure 6 demonstrates that circle allows immediate recognition of the fact that the positions of the nine fiducial marks in Figure 6 are rotated clockwise by approximately 90 degrees relative to their positions in Figure If the large circlewere not present, it would be impossible to determine which three of the nine fiducial marks were created by a particular one of the three N-localizers.However, the presence of the large circle allows manual assignment of the fiducial marks as follows.The closest fiducial mark to circle is labeled ellipse .Then, proceeding sequentially around the circumference of the scan image in the same direction as the direction from circle to ellipse , the fiducial marks that are encountered in sequence are labeled , for the fiducial marks permits unambiguous labeling of the three ellipses , and in the scan image and thereby permits assignment of the three respective centroids , and to these ellipses.

FIGURE 6 :
FIGURE 6: Cranial computed tomography (CT) scan image of a patient surrounded by three Nlocalizers A cranial computed tomography (CT) scan image of a patient to whom three N-localizers are fastened demonstrates the nine fiducial marks that are created by three N-localizers.A search for the positions of these nine fiducial marks may be conducted either automatically by computer or manually to label the marks in the order , , , , , , , and (see text for details).The cursor designates a target point .

Extrapolation beyond the vector from to in order to obtain the point that appears in the scan image
2013 Brown et al.Cureus 5(10): e142.DOI 10.7759/cureus.142