The Mathematics of Three or More N-Localizers for Stereotactic Neurosurgery

The mathematics that were originally developed for the N-localizer apply to three N-localizers that produce three sets of fiducials in a tomographic image. Some applications of the N-localizer use four N-localizers; however, the mathematics that apply to three N-localizers do not apply to four N-localizers. One solution to this problem is to ignore one of the four N-localizers in order that the mathematics that apply to three N-localizers may be used. This article presents a novel solution that applies to three or more N-localizers without the requirement that any N-localizer be ignored. This solution provides a transformation matrix that transforms coordinates from the two-dimensional coordinate system of a tomographic image into the three-dimensional coordinate system of the stereotactic frame. In addition, this solution provides a statistical measure of the accuracy of the transformation that may be influenced by conditions, such as nonlinear distortion of the tomographic image. Categories: Medical Physics, Radiation Oncology, Neurosurgery


Introduction
Following its invention at the University of Utah in 1978 [1,2], the N-localizer (Figure 1) was presented at neurosurgery conferences in America and Europe [1,3].Beginning in 1979, it was adopted by six different stereotactic frames to enable image-guided surgery and radiosurgery in conjunction with computed tomography (CT), magnetic resonance (MR), and positron emission tomography (PET) .Regarding these six stereotactic frames, the Riechert-Mundinger frame that was adapted to CT at Duke University [9,16] and the Pfizer frame that was constructed in collaboration with the Univeristy of Pittsburgh [5,10,27] were used at only those institutions.The Kelly-Goerss [8,12] frame was the first to be adapted to PET [32].The Brown-Roberts-Wells (BRW) [4,7,13,15], Leksell [6,14,18], and Cosman-Roberts-Wells (CRW) [26,29] frames achieved widespread use throughout the world.

FIGURE 1: Three N-localizers attached to a stereotactic frame
This stereotactic frame was constructed by the author in August 1978 in order to test the concept of the N-localizer.It was presented to the Western Neurological Society and the American Academy of Neurological Surgery in October 1978 [1] and at the 12th INSERM Symposium on Stereotactic Irradiations in July 1979 [3].Three N-localizers are attached to this frame and are merged end-to-end such that only seven rods are required for image guidance.
Recent review articles discuss the origin and mathematics of the N-localizer [42][43][44][45].The mathematics are summarized in the remainder of this Introduction in preparation for the presentation of new developments in the Materials & Methods section of this article.The reader who is already familiar with the mathematics of the N-localizer may choose to skip directly to the Materials & Methods section.
The N-localizer comprises a diagonal rod that extends from the top of one vertical rod to the bottom of another vertical rod (Figure 2).In the tomographic image, the cross section of each of the two vertical rods creates a fiducial circle and the cross section of the diagonal rod creates a fiducial ellipse.The ellipse moves away from one circle and towards the other circle as the position of the tomographic section moves downward with respect to the N-localizer.The relative spacing between these three fiducials permits precise localization of the tomographic section relative to the N-localizer.The distance between the centers of circle and ellipse and the distance between the centers of circles and are used to calculate the ratio .This ratio represents the fraction of diagonal rod that extends from the top of vertical rod to the point of intersection of rod with the tomographic section.

FIGURE 2: Intersection of the tomographic section with the Nlocalizer
Side view of the N-localizer.The tomographic section intersects rods , and .
Tomographic image.The intersection of the tomographic section with rods , and creates fiducial circles and and fiducial ellipse in the tomographic image.The distance between the centers of circle and ellipse and the distance between the centers of circles and are 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 tomographic section.These geometric relationships are valid even if the vertical rods are not normal to the tomographic section, as can be demonstrated using similar triangles [1].
The fraction is used to calculate the coordinates of the point of intersection between rod and the tomographic section (Figure 3).In this figure, 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 beginning 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 points and to obtain the coordinates of the point of intersection between the long axis of rod and the tomographic section The vector form of Equation 1shows explicitly the coordinates of points , and Equation 1 or 2 may be used to calculate the coordinates of the point of intersection between the long axis of rod and the tomographic section.The point , which lies on the long axis of rod in the three-dimensional coordinate system of the Nlocalizer, corresponds to the analogous point , which lies at the center of ellipse in the two-dimensional coordinate system of the tomographic image.Hence, there is a one-to-one correspondence between a point from the N-localizer and a point from the tomographic image.

FIGURE 3: Calculation of the point of intersection between the rod B and the tomographic 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 tomographic section.
The attachment of three N-localizers to a stereotactic frame (Figure 1) permits calculation of the , and coordinates for the three respective points , and in the three-dimensional coordinate system of the stereotactic frame.These three points correspond respectively to the three analogous points , , and in the two-dimensional coordinate system of the tomographic image.In the following discussion, the symbols , , and will be used as a shorthand notation for , , and .The symbols , , and will be used as a shorthand notation for , , and .
The three points , , and lie on the long axes of the three respective diagonal rods , , and and have respective , , and coordinates in the three-dimensional coordinate system of the stereotactic frame (Figure 4).The analogous three points , , and lie at the centers of the three respective ellipses , , and and have , , and coordinates in the two-dimensional coordinate system of the tomographic image (Figure 5) and (Figure 6).Because three points determine the orientation of a plane in three-dimensional space, the three coordinates , , and together with the three coordinates , , and determine the spatial orientation of the tomographic section relative to the stereotactic frame.This spatial orientation permits calculation of the coordinates of a target point in the three-dimensional coordinate system of the stereotactic frame, given the coordinates of the analogous target point in the twodimensional coordinate system of the tomographic image.The quadrilateral represents the tomographic 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 nine rods.The centers of the six fiducial circles and the three fiducial ellipses that are created in the tomographic image by these nine rods are shown as points that lie in the tomographic section.The tomographic section intersects the long axes of the three diagonal rods at points , and that coincide with the respective centers , and of the three ellipses (Figure 6).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 the spatial orientation of a plane in three-dimensional space, the spatial orientation of the tomographic section is determined relative to the stereotactic frame.The target point lies in the tomographic section.The coordinates of this target point are calculated in the three-dimensional coordinate system of the stereotactic frame using Equation 5.  coordinates.The -coordinate 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 [44].The equations that are presented in the remainder of this article assume that a value of has been used to project the , , and coordinates.If a value of were used instead of to project the , , and coordinates, the equations that are presented in the remainder of this article would no longer apply and would require revision so that the calculations that these equations describe may produce correct results.
The transformation from the two-dimensional coordinate system of the tomographic image into the three-dimensional coordinate system of the stereotactic frame may be represented using the three and coordinate pairs and ; and ; and and in the matrix equation Equation 3 represents concisely a system of nine simultaneous linear equations that determine the spatial orientation of the tomographic section relative to the stereotactic frame.This equation transforms the , , and coordinates from the two-dimensional coordinate system of the tomographic image to create , , and coordinates in the three-dimensional coordinate system of the stereotactic frame.
An analogy provides insight into how the transformation of Equation 3 operates.Consider the tomographic image to be an elastic membrane.The transformation describes the processes of stretching the membrane in the plane of the tomographic image, rotating the membrane about an axis that is normal to the plane of the tomographic image, flipping the membrane side-toside if necessary, tilting the membrane if necessary so that it is not parallel to the base of the stereotactic frame, and lastly, lifting the membrane into place upon the scaffold of the three Nlocalizers such that the three points , , and from the tomographic image precisely coincide with the respective three points , , and from the stereotactic frame.Then any other point that lies on the membrane, for example, the target point , is transformed by the same stretching, rotating, flipping, tilting, and lifting processes that transformed the three points , , and .In this manner, the coordinates of the target point may be transformed from the two-dimensional coordinate system of the tomographic image into the three-dimensional coordinate system of the stereotactic frame to produce the coordinates of the analogous target point .The ability to transform coordinates in this manner obviates the need to rigidly fix the stereotactic frame to the tomographic scanner in order to guarantee that the tomographic section is parallel to the base of the stereotactic frame.
In Equation 3, the matrix elements , , , , , , , , and as well as the matrix elements , , , , , and are known.The matrix elements through are unknown; hence, Equation 3 may be inverted to solve for these unknown elements of the transformation matrix where the exponent "-1" indicates the inverse of the matrix that contains the elements , , , , , and .
Once the transformation matrix elements through are known, the coordinates of the target point may be transformed from the two-dimensional coordinate system of the tomographic image into the three-dimensional coordinate system of the stereotactic frame to obtain the coordinates of the analogous target point The above review of the mathematics of the N-localizer is sufficient to permit the presentation of new developments below.

Materials And Methods
Some applications of the N-localizer have used four N-localizers to produce four sets of fiducials in a CT image [5,9,16,19,32,40].Four sets of fiducials are visible in the CT image of Figure 7.The transformation from the two-dimensional coordinate system of this tomographic image into the three-dimensional coordinate system of the stereotactic frame may be represented as An important distinction between Equations 3 and 6 is that Equation 3 may be inverted via Equation 4 to solve for the transformation matrix elements through , whereas Equation 6 may not be inverted to obtain these transformation matrix elements because Equation 6 includes non-square matrices [44].
One solution to this problem is to ignore one of the four sets of fiducials and to use the remaining three sets of fiducials for Equation 4. This solution raises a question concerning which set of fiducials to ignore.One approach to ignoring a set of fiducials is to attempt to minimize errors by choosing the three fiducial points that form a triangle that encloses the target point [5].For example, in Figure 5 the target point lies within the triangle so fiducial would be ignored for application of Equation 4.Although this approach aims to minimize errors, it requires that important data, i.e., one set of fiducials, be ignored.
It is possible to minimize error via the method of least squares [46] without ignoring any of the fiducials.The least-squares approach applies to three or more sets of fiducials.The equations that are required for least-squares minimization are obtained by first expanding the matrix multiplication of Equation 6and expressing the result for the matrix elements , and where the subscript designates the matrix row.In the presence of error, Equation 7 may be modified to express the errors in , and , respectively, as , and In order to minimize these errors via the method of least squares, the values of , and squared to obtain the error functions , and The following discussion illustrates minimization of the error function ; minimization of the error functions and is performed in an analogous manner.At the minimum of a function, all of the derivatives are equal to zero.Evaluating the derivatives , and and setting the resulting expressions for these derivatives to zero yields Simplifying and rearranging the above equations for the derivatives yields a system of three simultaneous linear equations of the three unknowns , and where is the number of sets of fiducials; in the case of Equation 6, .These simultaneous linear equations may be solved using Cramer's rule [47] to yield the matrix elements , and that minimize the error function as follows.Each of the elements , and that are found in the first column of the transformation matrix and that minimize may be calculated as the ratio of two determinants wherein the denominator determinant contains the sums from Equation 11and wherein the numerator determinant for the calculation of , and , respectively, is obtained by replacing the first, second and third columns of Equation 12with Similarly, each of the elements , and that are found in the second column of the transformation matrix and that minimize may be calculated as the ratio of two determinants wherein the denominator determinant is shown in Equation 12and wherein the numerator determinant for the calculation of , and , respectively, is obtained by replacing the first, second and third columns of Equation 12with Finally, each of the elements , and that are found in the third column of the transformation matrix and that minimize may be calculated as the ratio of two determinants wherein the denominator determinant is shown in Equation 12and wherein the numerator determinant for the calculation of , and , respectively, is obtained by replacing the first, second and third columns of Equation 12with In this manner, the nine elements of the transformation matrix may be obtained such that these matrix elements minimize the error functions , and .
Once the elements of the transformation matrix have been calculated as discussed above, the transformation matrix may be used as shown in Equation 5to transform the coordinates of the target point from the two-dimensional coordinate system of the tomographic image into the three-dimensional coordinate system of the stereotactic frame to obtain the coordinates of the analogous target point .
The accuracy of the calculation of the transformation matrix elements, and hence the accuracy of the transformation of the coordinates, is indicated by the correlation coefficient that is a measure of how well the coordinates fit a plane equation This correlation coefficient may be obtained by first calculating the three linear correlation coefficients , and in the manner that is shown below for [48] then combining these linear correlation coefficients to obtain a coefficient of multiple correlation [49]

Results
Figure 7 is a CT image wherein four N-localizers have produced four sets of fiducials.A cursor was centered over the cross hairs for each of the eight fiducials and for the target point in order to read the coordinates of the fiducials and the target point.These coordinates are shown in Table 1.7 The coordinates of the fiducials and the target point were measured by centering a cursor over the cross hairs in the CT image of Figure 7.The position of the reference origin of the CT image and the units of measurement of and (millimeters, pixels, etc.) are irrelevant, so long as the same reference origin and units of measurement are used to measure each and .Also, independent of whether the -coordinates are measured in the horizontal direction and the -coordinates are measured in the vertical direction, or , Equation 5will calculate the same coordinates for the analogous target point [44].

FIGURE 7: CT image with four sets of fiducials
In order to calculate a transformation matrix from the data in Table 1, the coordinates of the points at each end of the four diagonal rods , , , and must be known in the three-dimensional coordinate system of the stereotactic frame so that the points of intersection between the long axes of these rods and the tomographic section may be calculated using Equation 1 or 2. The author does not have access to the stereotactic frame that is visible in the CT image of Figure 7, so the coordinates of these eight points are not known.However, for the purposes of this article, a sufficient model of this stereotactic frame is a cube whose edges are 30 cm long and wherein the vertical rods , , , and form the vertical edges of the cube.Then the beginning point of diagonal rod is assigned from the point at the top of vertical rod and the end point of diagonal rod is assigned from the point at the bottom of vertical rod .The beginning and end points of diagonal rods , , and are assigned in a similar manner.
Based on the above assumptions regarding the physical dimensions of the stereotactic frame and using the coordinates from Table In order to assess the effect of ignoring one set of fiducials upon the accuracy of the transformation, a different transformation matrix was calculated via Equation 4 using the coordinates from Table 1 for each of the four combinations of fiducials , , , and .Then these four different transformation matrices were used to transform the coordinates of the target point that are shown in Table 1 into coordinates for the four different target points that are shown in Table 2. Also, the Pythagorean distance , i.e., the transformation error, between each of these four target points and the target point was calculated.The mean transformation error is mm and the standard deviation is mm.7 The coordinates in centimeters for the target point were calculated using all four fiducials , , and from Figure 7. Also, the coordinates in centimeters for the four different target points were calculated using all four combinations of three fiducials.The Pythagorean distance from to each is indicated in millimeters.
Figure 8 is a MR image wherein four N-localizers have produced four sets of fiducials.A cursor was centered over the cross hairs for each of the 12 fiducials and for the target point in order to read the coordinates of the fiducials and the target point.These coordinates are shown in Table 3. (see text for explanation).Adapted from [19].8 The coordinates of the fiducials and the target point were measured by centering a cursor over the cross hairs in the CT image of Figure 8.
In a similar manner to the treatment of the data from Table 1, the coordinates from Table 3 were used to calculate a transformation matrix using all four fiducials , , , and by solving Equation 6 via Equations 12-15.Then this transformation matrix was used to transform the coordinates of the target point that are shown in Table 3 into the coordinates for the analogous target point that are shown in Table 4.The correlation coefficient was calculated to indicate the accuracy of the transformation.
In order to assess the effect of ignoring one set of fiducials upon the accuracy of the transformation, a different transformation matrix was calculated via Equation 4 using the coordinates from Table 3 for each of the four combinations of fiducials , , , and .Then these four different transformation matrices were used to transform the coordinates of the target point that are shown in   8 The coordinates in centimeters for the target point were calculated using all four fiducials , , and from Figure 8. Also, the coordinates in centimeters for the four different target points were calculated using all four combinations of three fiducials.The Pythagorean distance from to each is indicated in millimeters.

Discussion
For the CT image of Figure 7, the correlation coefficient and the mean transformation error of mm indicate that only a small amount of error is present in the CT image.A possible source of this error is the fact that the coordinates of the centers of the fiducials were recorded manually using a cursor and hence these coordinates are accurate to only the nearest pixel.In practice, this source of error is greatly reduced by computer software that calculates the center of each fiducial at sub-pixel precision instead of relying on a human to identify the center of the fiducial manually.
The attempt to minimize the transformation error by ignoring one set of fiducials [5] does diminish the error, as can be seen from Figure 7 and Table 2. Assuming that , which was calculated using all four sets of fiducials, is the most accurate target point, it is evident that the Pythagorean distance from to increases as the position of relative to the triangle that is formed by the three that are used for application of Equation 4 progresses from well inside triangle to marginally inside triangle to marginally outside triangle to well outside triangle .Figure 8 and Table 4 show a similar trend of increasing Pythagorean distance from to as the position of progresses from well inside triangle to marginally inside triangle to marginally outside triangle to well outside triangle .Because the Pythagorean distance represents the transformation error, these trends demonstrate that the transformation error may be minimized to some extent by choosing the three fiducials that form a triangle that encloses the target point .However, choosing three of the four fiducials ignores one set of fiducials and hence requires that important data be discarded, whereas least-squares minimization uses all four fiducials and thus discards no data.
For the MR image of Figure 8, the correlation coefficient and the mean transformation error of mm indicate that substantially more error is present in the MR image of Figure 8 than in the CT image of Figure 7.A likely source of this error is nonlinear distortion of the MR image that may be caused by metallic elements of the stereotactic frame, inhomogeneity and temporal fluctuation of the magnetic field, and metallic equipment near the MR scanner [18,19,21,28,33].
In view of the N-localizer's requirement for linearity, the susceptibility of MR to nonlinear distortion can potentially degrade the accuracy of MR-guided stereotactic surgery [44].In the absence of nonlinear distortion, the centers of the two circles and and the ellipse are expected to be collinear, as shown in Figure 6 [44].Hence, it has been suggested that the linearity of an MR image may be checked by calculating a correlation coefficient for each of the four sets of fiducials using the coordinates of the centers of the three fiducials , , and as shown in Equation 17 [21].However, this test for linearity is sensitive to nonlinear distortion only if the distortion causes the center of fiducial to move perpendicularly to the line that connects the centers of fiducials and .This test for linearity is insensitive to the case where the distortion causes the center of fiducial to move along the line that connects the centers of fiducials and because in this case the value of the correlation coefficient does not change.
On the other hand, the correlation coefficient is sensitive to any displacement of the centers of fiducials relative to the centers of fiducials and .Moreover, the correlation coefficient is sensitive to the displacement of the center of any fiducial relative to the center of any other fiducial.Such a displacement alters the calculation of the coordinates of one or more of the four via Equations 1 and 2, and those altered coordinates affect the correlation coefficient .
Table 5 shows that the four correlation coefficients are insensitive to the nonlinear distortion that is present in the MR image of Figure 8.The correlation coefficients that are calculated for each of the four sets of fiducials are substantially larger than the correlation coefficient that is calculated using the four fiducials , , and .This disparity between and the four suggests that the distortion in the MR image of Figure 8 either causes the centers of the four fiducials to move along the lines that connect the centers of fiducials and , or causes the four sets of fiducials to move relative to one another in a manner that does not affect the collinear relationship within each set of fiducials .8 The correlation coefficients that are calculated from the coordinates of the fiducials in the MR image of Figure 8 indicate that the correlation coefficients are insensitive to nonlinear distortion of this MR image, whereas the correlation coefficient is sensitive to that distortion.
Four or more N-localizers require the use of Equations 12-15 instead of Equation 4 to calculate the transformation matrix.For three N-localizers, either Equation 4or Equations 12-15 may be used to calculate the transformation matrix; equally accurate results are obtained via either approach.The correlation coefficient is a valid statistical measure of the accuracy of the transformation for only four or more N-localizers.For three N-localizers, this correlation coefficient equals because three points determine the orientation of a plane in threedimensional space.

Conclusions
This article presents a novel method for calculating the transformation matrix that transforms coordinates from the two-dimensional coordinate system of a tomographic image into the three-dimensional coordinate system of the stereotactic frame.This method applies to three or more N-localizers; when applied to more than three N-localizers, it provides a statistical measure of the accuracy of the transformation in terms of a correlation coefficient.Because nonlinearity of a tomographic image, such as may occur in an MR image, degrades the accuracy of the transformation, this correlation coefficient may indicate whether a particular MR image is sufficiently free of nonlinear distortion to qualify for MR-guidance of a stereotactic procedure.

FIGURE 4 :
FIGURE 4: Representation of the tomographic section in the three-dimensional coordinate system of the stereotactic frame

FIGURE 5 :
FIGURE 5: CT image with three sets of fiducials CT image of a patient to whom a BRW CT localizer frame (Integra Radionics Inc., Burlington, MA) is attached.The cross sections of three N-localizers create three sets of fiducials , and in the CT image.The large vertical rod allows it to be unambiguously distinguished from the other vertical rods and provides a visual cue that Figure 6 is rotated approximately 90 degrees counterclockwise relative to Figure 5 [7, 44].The practice of including one large vertical rod in a CT localizer frame was extended to MR by placing an aluminum rod inside one of the hollow rods that are filled with petroleum jelly in an MR localizer frame [21].

FIGURE 6 :Figure 4
FIGURE 6: Representation of the two-dimensional coordinate system of the tomographic image The cross sections of three N-localizers create three sets of fiducials , and in a tomographic image.Each set contains two circles and one ellipse that are collinear.For each set, the short double-ended arrows indicate the distance between the centers of circle and ellipse and the long double-ended arrows indicate the distance between the centers of circles and .The centers , and of the three ellipses coincide with the respective points of intersection , and of the long axes of the three diagonal rods with the tomographic section (Figure 4).The , and coordinates of the centers , 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 are calculated in the three-dimensional coordinate system of the stereotactic frame using Equation 5.

Four N-localizers
create four sets of fiducials , , and in the CT image.The N-localizers are merged end-toend such that , , and .The black cross hairs indicate the centers of the fiducials and the white cross hairs indicate the target point that lies inside the triangle (see text for explanation).Adapted from [5].

FIGURE 8 :
FIGURE 8: MR image with four sets of fiducials MR image of a patient to whom a first-generation BRW MR localizer frame (Radionics Inc., Burlington, MA) is attached.Four N-localizers create four sets of fiducials , , and in the MR image.The black cross hairs indicate the centers of the fiducials and the target point that lies inside the triangle

Table 2 .
The correlation coefficient was calculated to indicate the accuracy of the transformation.