DETERMINING THE LOCATION AND ORIENTATION OF AN INDWELLING MEDICAL DEVICE

Abstract: A device (100) to detect the location of a plurality of magnets uses a plurality of magnetic sensors (108, 110, 112, 114), having sensor elements arranged in a known fashion. Each sensor element (108, 110, 112, 114) senses the magnetic field strength generated by each of the plurality of magnets (120, 302, 306) and provides data indicative of the direction of the magnets in a three-dimensional space. The device uses fundamental equations for electricity and magnetism that relate the measured magnetic field strength to the location and strength of the magnetic dipole for each of the plurality of magnets. The device may use an iterative process to determine the actual location and orientation of each magnet. An initial estimation of the location and orientation of each magnet results in the generation of predicted magnetic field values. The predicted magnetic field values are compared with the actual measured values provided by the magnetic sensors. Based on a difference between the predicted values and the measured values, the device estimates a new location for each of the magnets and calculates new predicted magnetic field strength values. The iteration process continues until the predicted values match the measured values within a desired degree of tolerance. At this point, the estimated location and orientation of each of the magnets matches the actual location within a predetermined degree of tolerance.

Description: DETERMINING THE LOCATION AND ORIENTATION OF AN INDWELLING MEDICAL DEVICE STATEMENT OF GOVERNMENT INTEREST This invention was made with government support under SBIR Grant No. RR10676-03 awarded by the National Center for Research Resources of the National Institutes of Health. The government has certain rights in this invention. TECHNICAL FIELD This invention is generally directed to a system and method for detecting the location of an indwelling medical device within the body of a patient and, more specifically, to a detection apparatus which senses magnetic field strength generated by a magnet associated with the indwelling medical device. BACKGROUND OF THE INVENTION There are many instances in clinical medicine where detecting the location of a medical tube within a patient is important. For example, when positioning feeding tubes through the mouth or nose of a patient, it is essential that the end of the feeding tube pass into the patient's stomach, and that it does not "curl up" and remain in the esophagus. If the end of the feeding tube is not properly positioned within the stomach, aspiration of the feeding solution into the patient's lungs may occur. In addition to feeding tubes, a variety of other medical tubes require accurate positioning within a patient's body, including dilating tubes to widen an esophageal stricture, tubes for measuring pressure waves in the stomach and esophagus of a patient who is suspected of having esophageal motor disorders, Sengstaken-Blakemore tubes in the stomach and esophagus of a patient to control bleeding from varicose veins in the esophagus, colonic decompression tubes in the colon of a patient to assist in relieving distention of the colon by gas, urologic tubes in the bladder, ureter or kidney of a patient, laser tubes inserted into the heart for transmyocardial revascularization, and vascular tubes in the heart or pulmonary arteries of a patient. Currently, the location of a medical tube within the body of a patient is routinely detected by the use of imaging equipment, such as a chest or abdominal X-ray. However, such a procedure requires transportation of the patient to an X-ray facility or, conversely, transportation of the X-ray equipment to the patient. This is both inconvenient and costly to the patient, and is particularly stressful in those instances where the patient repeatedly and inadvertently removes a medical tube, such as a feeding tube, thus requiring repeated reinsertion and X-rays. Prior attempts at detecting the location of medical tubes within a patient have met with only limited success. For example, in U.S. Patent No. 5,099,845 to Besz et al., a transmitter is located within a catheter, and an external receiver, tuned to the frequency of the transmitter, is used to detect the location of the catheter within the patient. This approach, however, requires either an external or internal power source to drive the transmitter. An external power source adds significant risk associated with shock or electrocution, and requires that electrical connections be made prior to positioning of the catheter within the patient. An internal power source, such as a battery, must be relatively small and can only provide power to the transmitter for a limited time. This precludes long-term detection of the catheter's location, and poses additional risks associated with placing a battery internally in a patient, such as the risk of battery leakage or rupture. In addition, the transmitter is relatively complex, and requires an active electronic circuit (either internal or external to the catheter), as well as the various wires and connections necessary for its proper function. Lastly, the signal produced by the transmitter is attenuated differently by different body tissues and bone. This attenuation requires adjustments in the transmitter's signal strength and frequency depending on the location of the catheter within the patient's body. A further attempt at detecting the location of medical tubes within a patient is disclosed in U.S. Patent No. 4,809,713 to Grayzel. There, an electrical cardiac-pacing catheter is held in place against the inner heart wall of a patient by the attraction between a small magnet located in the tip of the pacing catheter and a large magnet located on (e.g., sewn into) the patient's chest wall. An indexed, gimbaled, three-dimensional compass is used to determine the best location for the large magnet. The compass' operation relies upon the torque generated by the magnetic forces between the small magnet and the magnetized compass pointer in order to point the compass towards the small magnet. However, this compass will simultaneously try to orient itself to the Earth's ambient magnetic field. Because of this, the forces between the small magnet and the magnetized compass pointer at distances greater than several centimeters are not strong enough to accurately orient the compass towards the small magnet. Furthermore, although the compass aids positioning of the large magnet, positioning of the small magnet, and hence the pacing catheter, still requires the use of imaging equipment, such as X-ray or ultrasound. For the foregoing reasons, there is a need in the art for a medical tube, apparatus and method for detecting the location of the medical tube within the body of a patient which avoids the problems inherent in existing techniques. The medical tube, apparatus and method should provide for the detection of the medical tube at distances ranging from several centimeters to several decimeters, should not require the medical tube to have an internal or external power source, and should obviate the need to independently verify positioning of the medical tube with imaging equipment. SUMMARY OF THE INVENTION The present invention is embodied in the a system and method for the detection of a plurality of magnets within the patient from a measurement location on the surface of the patient. The system comprises a plurality of magnetic sensors, each of which is oriented in a known direction and generates a set of signals as a function of the static magnetic field strength and direction due to each of the plurality of magnets. A processor calculates an estimated position of each of the plurality of magnets in a three-dimensional space and calculates values related to a predicted magnetic field strength through at least a portion of the sensors based on the estimated positions of the plurality of magnets. The processor also calculates values related to an actual magnetic field strength using the set of signals from the magnetic sensors and determines values related to the location of each of the plurality of magnets based on a difference between the values related to the predicted magnetic field strength and the values related to the actual magnetic field strength. A display is provided to display the values related to the position of each of the plurality of magnets is the three-dimensional space. In one embodiment, the estimated position may be calculated using signals from selected ones of the plurality of magnetic sensors whose signals are above a predetermined threshold. Although the sensors can be configured in any position and orientation with respect to each other, calculations may be conveniently performed by orienting the sensors in an array, with sensors oriented along orthogonal axes to provide measurement capability along the orthogonal axes. The position and orientation of the indwelling medical device and associated magnet may be characterized by 5° of freedom indicating the location in three-dimensional space and the angular orientation in two planes. Each magnet may be similarly characterized by the same number of parameters. In an exemplary embodiment, the system provides a number of sensors that at least is equal to the number of parameters required to characterize the plurality of magnets. In a preferred embodiment, the system also includes additional magnetic sensors to provide compensation for the effects of the Earth's magnetic field. In another embodiment, a single indwelling medical device may have two magnets associated therewith. The associated magnets have axes of magnetization which are not aligned with each other. The processor calculates a rotation of the indwelling medical device based on values related to the positions of the first and second magnets into three-dimensional space. In another alternative embodiment, the initial position of the magnet(s) may be estimated using a neural network wherein the set of signals from at least a portion of the plurality of magnetic sensors are provided to the neural network. The neural network generates the initial estimated position based thereon. The processor may perform an iterative calculation in which the estimated position of each of the plurality of magnets may be refined based on the difference between the values related to the predicted magnetic field strength and the values related to the actual magnetic field strength. In this embodiment, a new estimated position is calculated and the process repeated wherein the processor calculates values related to a predicted magnetic field strength for at least a portion of the plurality of sensors based on the refined estimated position of the plurality of magnets and the process further calculates values related to the actual magnetic field strength using the set of signals. The iterative process may be repeated until the difference between the values related to the predicted magnetic field strength and the values related to the actual magnetic field strength are within a predetermined tolerance. BRIEF DESCRIPTION OF THE DRAWINGS Figure 1 illustrates the location of a magnet fixed to the end of a medical tube positioned within the body of a human patient using a known detection apparatus. Figure 2 illustrates the orientation of the x, y, and z magnetic sensors used in a known detection apparatus. Figure 3 is a top plan view of the detector of the present invention illustrating one possible arrangement of magnetic sensors. Figure 4 illustrates the generation of magnetic field strength vectors using the magnetic sensor configuration of Figure 3 to determine the location of a magnet. Figure 5A is a functional block diagram of an exemplary embodiment of a system constructed in accordance with the present invention to determine the location of a magnet. Figure 5B is a functional block diagram illustrating the operation of the system of Figure 5 A to display the location of a magnet in conjunction with a conventional imaging system. Figure 5C illustrates an embodiment of the system of Figure 5 A to monitor the location of the detector system. Figure 6A illustrates the use of the system of Figure 5C to select landmark locations on a patient. Figure 6B illustrates the display of the selected locations and the location of a magnet. Figure 7A is a flowchart used by the system of Figure 5A to determine the location of a magnet. Figure 7B is a flowchart illustrating the automatic calibration function of the system of Figure 5 A. Figure 8A illustrates one embodiment of the visual display used by the detector of Figure 3. Figure 8B is an alternative embodiment of the indicator used with the detector of Figure 3. Figure 8C is yet another alternative embodiment of the display used with the detector of Figure 3. Figure 8D is yet another alternative embodiment of the display of the detector of Figure 3 with a depth indicator indicating the distance of the magnet from the detector. Figure 9 is a graph illustrating the results of clinical testing of the system of Figure 5A. Figure 10 illustrates the location of multiple magnets fixed to the ends of medical tubes positioned within the body of a human patient. Figure 11 illustrates the generation of magnet field strength vectors using an arbitrary magnetic sensor configuration to determine the location of multiple magnets. Figure 12 illustrates the orientation of two magnets on a single tube to detect the rotational angle of the tube. Figure 13 illustrates a large number of magnetic sensors disposed within a predefined area to form a sensor array. DETAILED DESCRIPTION OF THE INVENTION The present invention provides a medical tube, apparatus and method for detecting the location of the medical tube within the body of a patient. As used herein, the term "medical tube" means any type of tube or device which may be inserted into a patient's body, including (but not limited to) catheters, guide wires, and medical instruments. For example, catheters include such items as feeding tubes, urinary catheters, guide wires and dilating catheters, as well as nasogastric tubes, endotracheal tubes, stomach pump tubes, wound drain tubes, rectal tubes, vascular tubes, Sengstaken-Blakemore tubes, colonic decompression tubes, pH catheters, motility catheters, and urological tubes. Guide wires are often used to guide or place dilators and other medical tubes. Medical instruments include lasers, endoscopes and colonoscopes. In short, the location of any foreign object within a patient's body is a suitable device for detection by the present invention, and is encompassed within the term "medical tube." The present invention detects the location of the medical tube by sensing the magnetic field produced by a permanent magnet associated with the medical tube. As used herein, the term "associated with" means permanently fixed, removably attached, or in close proximity with, the medical tube. In one embodiment, such as a feeding tube, the magnet is associated with the end of the medical tube. In another embodiment, such as a Sengstaken-Blakemore tube, the magnet is associated with the medical tube at a location above the gastric balloon. Preferably, the magnet is a small, cylindrical, rotatably attached, rare- Earth magnet. Suitable magnets include rare Earth magnets such as samarium cobalt and neodymium iron boron, both of which generate high field strengths per unit volume. While magnets which generate a high field strength for their size are preferred, weaker magnets such as Alnico or ceramic may also be utilized. Since the magnet is permanent, it requires no power source. Accordingly, the magnet maintains its magnetic field indefinitely, which allows long-term positioning and detection of medical tubes without the disadvantages associated with an internal or external power source. In particular, by avoiding the use of a power source, the undesirable electrical connections necessary for the use of a power source are avoided. Thus, there is no risk of electric shock to (or possible electrocution of) the patient. Furthermore, the magnet's static magnetic field passes unattenuated through body tissue and bone. This property allows the use of the present invention to detect the medical tube at any location within the patient's body. One known technique for locating a medical tube in the body of a patient is described in U.S. Patent No. 5,425,382, which is incorporated herein by reference in its entirety. Figure 1 illustrates the techniques described in U.S. Patent No. 5,425,382. A tube 10, with a permanent magnet 12 located in its tip is inserted into the patient. In the example illustrated in Figure 1, the tube 10 is a feeding tube that is inserted into the patient's nose, down the esophagus, and into the stomach. However, the system may be readily used with other types of tubes. A detection apparatus 14 is used to sense the magnet's static magnetic field strength 16 at two different distances 18 and 20 while immersed in the Earth's ambient magnetic field 22. By measuring the static magnetic field strength 16 at two different distances 18 and 20, the detection apparatus 14 determines the magnetic field gradient. As the detection apparatus 14 is moved about the patient's body, greater and lesser magnetic field gradients are indicated. The tube 10 is located by moving the detection apparatus 14 until the greatest magnitude is indicated by the detection apparatus. The detection apparatus 14 described in U.S. Patent No. 5,425,382 utilizes first and second magnetic sensors 24 and 26, respectively. As described in that patent, the magnetic sensors 24 and 26 may each comprise flux-gate toroidal sensors to detect the magnetic field gradient. An alternative magnetic field gradient detector system is described in U.S. Patent No. 5,622.169, which is incorporated herein by reference in its entirety. Figure 2 illustrates the magnetic sensor arrangement described in U.S. Patent No. 5,622,169. The magnetic sensors 24 and 26 each comprise three orthogonally arranged flux-gate toroidal sensor elements. The magnetic sensor 24 comprises magnetic sensor elements 24x, 24y, and 24z that are orthogonally arranged to measure magnetic field strength in three orthogonal directions, illustrated in Figure 2 by x, y, and z axes, respectively. Similarly, the magnetic sensor 26 comprises magnetic sensor elements 26x, 26y, and 26z to measure magnetic field strength in the x, y, and z directions, respectively. Using the sensors 24 and 26, the magnetic field gradient may be determined in the x, y, and z directions. With measurements of magnetic field gradient in three directions, the location of the magnet 12 (see Figure 1) may be readily determined using conventional vector mathematics. The mathematical sign of the magnetic gradient is indicative of the direction of the magnetic field dipole of the magnet 12. The magnet, and hence the medical tube, is detected using a known detection apparatus that contains at least two static magnetic field strength sensors configured geometrically to null detection of ambient, homogeneous magnetic fields (e.g., the Earth's field), while still detecting the magnetic field strength gradient produced by the magnet. The magnet detection apparatus illustrated in Figures 1 and 2 detects the location of the magnet based on the difference in magnetic field strength at the two sensors. However, it is possible to construct a magnetic field detection apparatus with different sensor configurations to provide additional data related to the position and orientation of the magnet. The present invention is directed to a technique for detection of a magnet using a multisensor array and a convergence algorithm that can accurately locate the position of the magnet in three dimensions. An exemplary embodiment of the invention is embodied in a detector system 100, shown in Figure 3. The detector system 100 includes a housing 102, control switches 104 such as a power switch and a reset switch, and a display 106. In an exemplary embodiment, the display 106 is a two- dimensional liquid crystal display. The display 106 may have an opaque background, or have a transparent area which allows the caregiver to view the skin below the surface of the detector system 100. As will be discussed in greater detail below, the ability to view external patient landmarks significantly aids in the placement of catheters using the detector system 100. Alternatively, the display 106 may be an external display such as a video monitor. Also mounted within the housing 102 are first, second, third, and fourth magnetic sensors 108, 110, 112, and 114, respectively. In a preferred embodiment, the static magnetic sensors 108-112 are spaced to provide maximal separation within the housing 102. In an exemplary embodiment, the magnetic sensors 108-112 are arranged in a substantially planar fashion within the housing 102 and located proximate the corners of the housing. The orientation of the magnetic sensors 108-114 is illustrated in Figure 4 where the magnetic sensors 108-114 are positioned at locations S, to S 4 , respectively, near the corners of the housing 102. Although the system 100 described in Figures 3 and 4 illustrates a rectangular configuration for the magnetic sensors 108-114, the principles of the present invention are readily applicable to any multisensor array. Accordingly, the present invention is not limited by the specific physical arrangement of the magnetic sensors. In an exemplary embodiment, each of the magnetic sensors 108- 114 comprise three independent magnetic sensing elements orthogonally arranged to provide three-dimensional measurement in the x, y, and z directions, such as illustrated in Figure 2. The sensing elements of the magnetic sensors 108-1 14 are aligned with respect to a common origin such that each magnetic sensor senses the static magnetic field in the same x, y, and z directions. This permits the detection of magnetic field strength in a three-dimensional space by each of the magnetic sensors 108-114. The arrangement of the magnetic sensors 108-114 permits the detection of a magnet in a three-dimensional space within the patient. That is, in addition to locating the magnet within the patient, the detector system 100 provides depth information. The configuration of the magnetic sensors 108-1 14 can be readily changed for specialized application. For example, a plurality of magnetic sensors may be configured in a spherical arrangement around a patient's head to detect the location of the magnet 120 in the brain. Furthermore, the magnetic sensing elements need not be orthogonally arranged. For example, the magnetic sensing elements may be configured in a planar array or other convenient configuration suited to the particular application (e.g., the spherical arrangement). The only requirement for satisfactory operation of the detector system 100 is that the detector system must have at least as many sensing elements to provide data as there are unknowns in the equations to be solved and that the location and orientation of the magnetic sensing elements be known. In the present case, it is desirable to detect the position and orientation of the magnet 120 in three dimensional space. This results in five unknown parameters, that may conveniently be considered as x, y, z, θ, and φ where x, y, and z represent coordinates of the magnet 120 in three dimensional space relative to an origin such as the center of the housing 102, θ is the angular orientation of the magnet in the YZ plane and φ is the angular orientation of the magnet in the XY plane. In addition, the contribution of the Earth's magnetic field in the x, y, and z directions is unknown. Thus, the model used by the detector system 100 has eight unknown parameters that require eight independent measurements. In an exemplary embodiment of the detector system 100 described herein, a set of twelve magnetic sensing elements is used to provide over sampling. This results in greater reliability and accuracy while maintaining the computational requirements at a reasonable level. The mathematical description provided below may be most easily understood with respect to a Cartesian coordinate system using magnetic sensing elements orthogonally arranged in the x, y, and z directions. However, it should be clearly understood that the present invention is not limited to such an arrangement. Any alignment of the magnetic sensing elements may be used with the detector system 100 so long as the location and orientation of the magnetic sensors 108-1 14 are known. Therefore, the present invention is not limited by the specific configuration of magnetic sensing elements. As illustrated in Figure 4, a magnet 120 is positioned at a location a. As is known in the art, the magnet 120 has a magnetic dipole that is represented by the vector m. The vector m represents the strength and orientation of the magnetic dipole. Under ideal conditions, the magnetic sensors 108-114 can measure the static magnetic field generated by the magnet 120 and determine the location of the magnet at location a with a single measurement. However, the presence of the Earth's magnetic field, stray magnetic fields that may be present near the vicinity of the magnet 120, internal noise from the magnet sensors 108- 114, internal noise generated by electronics associated with the magnetic sensors, such as amplifiers and the like, make it virtually impossible to perform a measurement under "ideal" conditions. To provide accurate positional information for the magnet 120 in the presence of various forms of noise, the detector system 100 uses known formulas for magnetic field strength, plus actual sensor measurements as inputs to an estimation algorithm that converges to provide an accurate reading of the location and orientation of the magnet 120. The elements used to process data from the magnetic sensor 108- 114 are illustrated in a functional block diagram of Figure 5 A where the magnetic sensors 108-114 are coupled to analog circuitry 140. The specific form of the analog circuitry 140 depends on the specific form of the magnetic sensors 108-114. For example, if the magnetic sensors 108-114 are orthogonally positioned flux-gate toroidal sensors, similar to those illustrated in Figure 2, the analog circuitry 140 may include amplifiers and integrators such as discussed in U.S. Patent Nos. 5,425,382 and 5,622,669. In another exemplary embodiment, the magnetic sensors 108-114 comprise magneto-resistive elements whose resistance varies with the strength of a magnetic field. Each magnetic sensors 108-1 14 comprises three orthogonally arranged magneto-resistive sensing elements to sense the static magnetic field in the x, y, and z directions, respectively. However, the magnetic sensors 108-114 may be any form of magnetic sensor. Several different types of magnetic sensors may be used in the practice of the present invention, including, but not limited to, Hall-effect, flux- gate, wound-core inductive, squid, magneto-resistive, nuclear precession sensors, and the like. Commercial magnetic field gradient sensors in the form of an integrated circuit can also be used with the detector system 100. Furthermore, the magnetic sensors 108-114 need not be identical types of sensors. For example, the magnetic sensors 108-112 may be one type of sensor while the magnetic sensor 114 may be a different type. The analog circuitry 140 is designed to operate with the specific form of the magnetic sensors 108-114. The specific design of the analog circuitry 140 is well within the knowledge of one of ordinary skill in the art and need not be described in greater detail herein. The output of the analog circuitry 140 is coupled to an analog-to- digital converter (ADC) 142. The ADC 142 converts the analog output signals from the analog circuitry 140 to a digital form. The operation of the ADC 142 is well known to those of ordinary skill in the art and will not be described in detail herein. The detector system 100 also includes a central processing unit (CPU) 146 and a memory 148. In an exemplary embodiment, the CPU 146 is a microprocessor, such as a Pentium™ or the like. The memory 148 may include both read-only memory and random access memory. The various components, such as the ADC 142, CPU 146, memory 148, and display 106 are coupled together by a bus system 150. As can be appreciated by those of ordinary skill in the art, the bus system 150 illustrates a typical computer bus system and may carry power and control signals in addition to data. Also illustrated in the functional block diagram of Figure 5 A is an estimation processor 152. As will be described in greater detail below, the estimation processor 152 performs an iterative comparison between an estimated position of the magnet 120 (see Figure 2) and a measured position of the magnet 120 based on data derived from the magnetic sensors 108-114. The iterative process continues until the estimated position and the measured position converge, resulting in an accurate measurement of the location a (see Figure 4) of the magnet 120. It should be noted that the estimation processor 152 is preferably implemented by computer instructions stored in the memory 148 and executed by the CPU 146. However, for the sake of clarity, the functional block diagram of Figure 5A illustrates the estimation processor 152 as an independent block since it performs an independent function. Alternatively, the estimation processor 152 can be implemented by other conventional computer components, such as a digital signal processor (not shown). The detector system 100 assumes that the magnetic sensors 108- 114 are sufficiently far from the location s of the magnet 120 that the magnet may be treated as a point dipole source. In addition, it is assumed that the spatial variation of any extraneous magnetic fields, such as the Earth's magnetic field, is small compared to the inhomogeneity produced by the presence of the point dipole source. However, under some circumstances, perturbations in the Earth's magnetic field may be caused by extraneous sources such as nearby electrical equipment, metallic building structural elements, and the like. As will be discussed in detail below, the detector system 100 can be readily calibrated to compensate for such perturbations. The equations used by the estimation processor 152 are readily derived from the fundamental laws of physics related to electricity and magnetism. A static magnetic field B produced by the magnetic dipole of a strength m, and situated at a location a, and measured at a location s is given by the following: where \\s - a\\ is a modulus value well known in matrix mathematics (e.g., \\s - α|| 2 is a square modulus). It should be noted that the values a, m, s, and B are all vector values. The term "static magnetic field" is intended to describe the magnetic field generated by the magnet 120, as opposed to a time varying electromagnetic field or an alternating magnetic field. The magnet 120 generates a fixed, constant (i.e., static) magnetic field. The strength of the magnetic field detected by the detector system 100 depends on the distance between the magnet 120 and the magnetic sensors 108-114. Those skilled in the art can appreciate that the detected magnetic field strength may vary as the magnet 120 is moved within the patient or as the detector system 100 is moved with respect to the magnet. However, relative movement between the detector system 100 and the magnet 120 is not essential. The detector system 100 can readily determine the location and orientation of the magnet 120 in three-dimensional space even when the detector system and the magnet are not moving with respect to each other. The values from the magnetic sensors 108-114 can be used in equation (1) to determine the strength of the magnetic field B at locations S,-S 4 , respectively. Changes in the magnetic field B over distance is defined as a gradient G(s) o B, which is a derivative of B with respect to s. The gradient G(s) can be represented by a 3x3 matrix derived from equation (1) and expressed in the following form: where T is a matrix transpose and / is a 3x3 identity matrix having the following form: It should be noted that equation (1) could be solved directly for the value a given the values B, m, and s. However, such a calculation can be difficult to solve and may require significant computing power. The iterative estimation process described below determines the location a and orientation of the magnet 120 by estimating the location a and comparing a predicted or estimated magnetic field that would result from the magnet 120 being located at the estimated location with the actual measured magnetic field as measured by the magnetic sensors 108-114. The iterative process varies the estimated location in a controlled manner until the predicted magnetic field closely matches the measured magnetic field. At that point, the estimated location and orientation matches the actual location a and orientation of the magnet 120. Such an iterative process can be performed very quickly by the detector system 100 without the need for extensive computational calculations required to solve for the location a directly using equation (1). The difference between the predicted magnetic field and the actual measured magnetic field is an error, or error function, that may be used to quantitatively determine the location a of the magnet 120. The error function is used in the iterative process to refine the estimated location of the magnet 120. Equation (2), indicating the gradient G(s) is used by the estimation processor 152 (see Figure 5 A) to determine the magnitude and a direction of error in the estimated location. Thus, equation (1) is used to generate predicted values and equation (2) uses the error results to determine how to alter the estimated position of the magnet 120. The magnetic field strength B is measured at each of the locations S r S 4 by the magnetic sensors 108-114, respectively. While only four magnetic sensors are illustrated in Figure 3 to Figure 5A, the measurement may be generalized to n sensors such that each of the magnetic sensors provides a measurement of B(s,) at points s„ where i ' = 1 to n. The estimation processor 152 calculates quantities A υ (measured) = B(s,) - B(S j ). This calculation provides a measure of the gradient from magnetic sensor to magnetic sensor j and also cancels out the effects of the Earth's magnetic field, which is constant (i.e., gradient = 0) at the magnetic sensor / and the magnetic sensor . The estimation processor 152 also calculates predicted values A tJ (predicted) from equation (1). The estimate for the value a is adjusted until the measured values Δ y (measured) and predicted values A υ (predicted) match as closely as possible. For example, the detector system 100 may initially assume that the location a of the magnet 120 is centered under the housing 102. Based on this estimated location, the estimation processor 152 calculates the predicted values for magnetic field strength at each of the magnetic sensors 108-1 14 that would result if the magnet 120 were actually at the estimated location. In an exemplary embodiment, the sensing elements of each of the magnetic sensors 108-1 14 provide a measure of the magnetic field B in three orthogonal directions resulting in magnetic field strength values B x „ B y „ and B., where / equals 1 to n. Similarly, the gradient G(s) is also calculated for each of the three orthogonal directions. The estimation processor 152 also uses measured magnetic field strength values from each of the magnetic sensors 108-1 14 and compares Δ (predicted) with A tJ (measured). Based on the difference between Δ y (predicted) and Δ (measured), the estimation processor 152 generates a new estimated location for the magnet 120 (see Figure 4) and iterates the prediction process until A tJ (predicted) closely matches A y (measured). The degree of match between A y (predicted) and Δ (measured) may be measured by a cost function comprising the sum of the squares of the difference between A y (predicted) and A y (measured) and then using non-linear iterative optimization algorithms to minimize the value of the cost function. The required gradients of the cost function are calculated using equation (2) above. Many different, well-known cost functions and/or optimization techniques, such as quasi-Newton, may be used by the estimation processor 152 to achieve the desired degree of match between A y (predicted) and A y (measured). The iterative measuring process performed by the estimation processor 152 can be done in a short period of time. A typical measurement cycle is performed in fractions of a second. As the tube and associated magnet 120 are moved within the patient, the position and orientation of the magnet will change. However, because the measurement cycle is very short, the change in position and orientation of the magnet will be very small during any given measurement cycle, thus facilitating real-time tracking of the magnet as the magnet is moved inside the patient or as the housing 102 is moved on the surface of the patient. As discussed above, the estimation processor performs an iterative comparison between an estimated position of the magnet and a measured position of the magnet. The initial estimated location may be derived by a number of possible techniques, such as random selection, a location under the sensor element 108-114 having the strongest initial reading, or, by way of example, the detector system 100 may initially estimate the location a of the magnet 120 is centered under the housing 102. However, it is possible to provide a more accurate initial estimation of the location a of the magnet 120 using a neural network 154, shown in Figure 5 A. It should be noted that the neural network 154 is preferably implemented by computer instructions stored in the memory 148 and executed by the CPU 146. However, for the sake of clarity, the functional block diagram of Figure 5 A illustrates the neural network 154 as an independent block since it performs an independent function. Alternatively, the neural network 154 can be implemented by other conventional computer components, such as a digital signal processor (not shown). Neural.networks, by virtue of a learning process, are capable of receiving and processing large amounts of data in order to generate solutions to problems with many variables. The operation of a neural network is generally known in the art, and thus will be described herein only with respect to the specific application. That is. the operation of the neural network 154 to generate an initial position estimate will be discussed. The neural network 154 has a learn mode and an operational mode. In the learn mode, the neural network 154 is provided with actual measurement data from the magnetic sensors 108-1 14. Since each of the magnetic sensors 108-114 have three different sensing elements, a total of 12 parameters are provided as inputs to the neural network 154. Based on the 12 parameters, the neural network 154 estimates the location and orientation of the magnet 120. The neural network 154 is then provided with data indicating the actual location and orientation of the magnet 120. This process is repeated a large number of times such that the neural network 160 "learns" to accurately estimate the location and orientation of the magnet 120 based on the 12 parameters. In the present case, the learning process described above (e.g., providing 12 parameters, estimating the location, and providing the actual location) was repeated 1,000 times. The neural network 154 learns the best estimated position for a set of 12 parameters. It should be noted that the user of the detector system 100 need not operate the neural network 154 in the learn mode. Rather, data from the learn mode process is provided along with the detector system 100. In normal operation, the neural network 154 is utilized only in the operational mode. In the operational mode, the 12 parameters from the magnetic sensors 108-1 14 are given to the neural network 154, which generates an initial estimate of the location and orientation of the magnet 120 Based on experiments performed by the inventors, the neural network 154 can provide an initial estimate of the location of the magnet 120 within approximately J2 cm. Such an accurate initial estimate reduces the number of iterations required by the estimation processor 152 to accurately determine the location a of the magnet 120. It should be noted that if the location a of the magnet 120 is sufficiently far from the detector system 100, the magnetic sensors 108-114 will provide very low signal levels. Accordingly, the neural network 154 will not generate an initial estimate until the parameters (i.e., the 12 input signals from the magnetic sensors 108-114) are above a minimum threshold and can therefore provide a reliable signal. Given an accurate initial estimate, the estimation processor 152 can perform the iteration process described above and determine the location a of the magnet 120 within D l mm. Clinical studies performed using the detector system 100 have demonstrated the satisfactory operation of the detector system 100. Those clinical studies are described below. The detector system 100 also includes a display interface 156, shown in Figure 5A, to permit the magnet image to be displayed on an external display (not shown). As those skilled in the art will appreciate, many of the components of the detector system 100, such as the CPU 146 and the memory 148 are conventional computer components. Similarly, the display interface 156 may be a conventional interface that allows the detector system image to be shown on a PC display or other monitor, such as a live image monitor 168 (see Figure 5B). One advantage of an external display is that the housing 102 may remain in a fixed position with respect to the patient. In this embodiment, the four magnetic sensors 108-1 14 may be replaced with a large number of sensors (e.g., sixteen sensors) uniformly distributed throughout the housing 102 to form an array of magnetic sensors (see Figure 13). As the magnet 120 is moved relative to the housing 102, the movement is detected by three or more of the magnetic sensors and the position of the magnet calculated and shown on the external display. In this embodiment, the user need not reposition the housing, but simply views the external display where the array of magnetic sensors can track the position of the magnet 120. Another advantage of an external video display is the ability to combine the image generated by the detector system 100 with image data generated by conventional techniques. For example, Figure 5B illustrates the operation of the detector system 100 in conjunction with a fluoroscope system 160. The fluoroscope system 160 is a conventional system that includes a fluoroscopic head 162. a fluoroscopic image processor 164. and an image storage system that includes a stored image monitor 166 and the live image monitor 168. In addition, a conventional video cassette recorder 170 can record the images generated by the fluoroscope system 160 and images generated by the detector system 100. The operation of the fluoroscope system 160 is known in the art, and will not be described in greater detail herein. The detector system 100 is fixedly attached to the fluoroscopic head 162 in a known spatial relationship. A single "snapshot " image of the patient can be obtained using the fluoroscopic system 160 and displayed, by way of example, on the live image monitor 168. As a catheter containing the magnet 120 (see Figure 4) is inserted in the patient, the detector system 100 detects the location a of the magnet 120 in the manner described above and can project the image of the magnet on the live image monitor 168 along with the snapshot image of the patient. In this manner, the user may advantageously utilize the snapshot fluoroscope image provided b the fluoroscope system 160 combined with the live image data provided by the detector system 100. For satisfactory operation of this aspect of the invention, it is necessary to have proper alignment between the fluoroscope system 160 and the detector system 100. This alignment, or "registration" may be accomplished by placing a radio-opaque marker on the chest of the patient where the radio-opaque marker is aligned with the corners of the detector system 100. When the fluoroscope system 160 generates the snapshot image, the corners of the detector system 100 are indicated on the live image monitor 168 by virtue of the radio- opaque markers. The advantage of the image overlay using the detector system 100 is that the patient is only momentarily exposed to radiation from the fluoroscope system 160. Thereafter, the snapshot image is displayed with data from the detector system 100 overlaid on top of the snapshot image. Although this process has been described with respect to the fluoroscope system 160, those skilled in the art can appreciate that the present invention is applicable to any image-guided surgical process using X-ray. magnetic resonance imaging (MRI). positron emission tomography (PET), and the like. The Earth's magnetic field is also detected by the magnetic sensors 108-114. However, assuming the Earth's magnetic field to be constant across the housing 102, the contribution of the Earth's magnetic field to the readings from the magnetic sensors 108-114 will be the same. By generating a differential signal between any two of the magnetic sensors 108-114, the effects of the Earth's magnetic field may be effectively canceled. However, as discussed above, there may be perturbations or inhomogeneity in the Earth's magnetic field caused by metallic elements, such as equipment, hospital bed rails, metal building structural elements, and the like. Because of the unpredictable nature of such interfering elements, proper operation of the detector system 100 requires calibration. The detector system 100 may be readily calibrated to compensate for localized perturbations in the Earth's magnetic field using a calibration processor 158, shown in Figure 5A. It should be noted that the calibration processor 158 is preferably implemented by computer instructions stored in the memory 148 and executed by the CPU 146. However, for the sake of clarity, the functional block diagram of Figure 5 A illustrates the calibration processor 158 as an independent block since it performs an independent function. Alternatively, the calibration processor 158 can be implemented by other conventional computer components, such as a digital signal processor (not shown). An initial calibration is performed before the magnet 120 is introduced into the patient. Thus, initial calibration occurs outside the presence of the magnetic field generated by the magnet 120. A measurement is performed using the detector system 100. Under ideal conditions, with no localized perturbations in the Earth's magnetic field, the signals generated by the magnetic sensors 108-114 will be the same. That is, each of the sensing elements oriented in the x direction will have identical readings, while each of the sensing elements oriented in the y direction will have identical readings and each of the elements oriented in the z direction will have identical readings. However, under normal operating conditions, localized perturbations in the Earth's magnetic field will exist. Under these circumstances, the signals generated by each sensor element of the magnetic sensors 108-1 14 all have some different value based on the detection of the Earth's magnetic field. The readings of any two of the magnetic sensors 108-114 may be differentially combined which, theoretically, will cancel out the Earth's magnetic field. However, due to localized perturbations in the Earth's magnetic field, there may be an offset value associated with the reading. The calibration processor 158 determines the offset values associated with each of the magnetic sensors and compensates for the offset values during the measurement cycle. That is, the offset value for each of the magnetic sensors 108-114 is subtracted from the reading generated by the ADC 142 (see Figure 5A). Thus, the differential reading between any two of the magnetic sensors 108-114 will be zero before the magnet 120 is introduced. Thereafter, as the magnet 120 is introduced, the differential readings from the magnetic sensors 108-1 14 will have nonzero values due to the static magnetic field generated by the magnet 120. If the detector system 100 is stationary, as illustrated in Figure 5B, a single calibration process is sufficient to cancel out the effects of the Earth's magnetic field, including localized perturbations caused by external objects, such as metallic equipment, building structural elements, and the like. However, in certain embodiments, it is desirable to move the detector system 100 over the surface of the patient. As the detector system 100 is moved to a new position on the patient, the localized perturbations in the Earth's magnetic field may cause a degradation in the accuracy of the detector system 100 since the effects of the localized perturbations may no longer be completely canceled. However, the calibration processor 158 allows a continuous automatic recalibration of the detector system 100, even in the presence of the magnet 120. This is illustrated in Figure 5C, where the detector system 100 is fixedly attached to a digitizing arm 180. The digitizing arm 180 is a conventional component that allows three-dimensional movement. The digitizing arm 180 may be conveniently attached to the patient bedside. In a preferred embodiment, the detector system 100 is attached to the digitizing arm and oriented such that the three dimensions of movement of the digitizing arm correspond to the x axis, y axis, and z axis, respectively, of the detector system 100. As the user moves the detector system 100, the digitizing arm accurately tracks the position of the detector system and generates data indicative of the position. The detector system 100 utilizes this position data to calculate the change in the measured magnetic field caused by the magnet 120 as the detector system 100 is moved. In this manner, the localized effects of the magnet 120 may be removed, with the resultant measurement being indicative of the localized perturbations of the Earth's magnetic field at the new position of the detector system 100. The automatic recalibration process is particularly useful in a situation, such as a peripherally inserted central catheter (PICC), which may typically be inserted in the patient's arm and threaded through the venous system into the heart. Using conventional technology, the surgeon would typically place marks on the chest of the patient to mark the expected route over which the catheter will be inserted. Without the present invention, the surgeon must blindly insert the catheter and verify its location using, by way of example, fluoroscopy. However, the detector system 100 permits the surgeon to track the placement of the PICC. In the example above, the detector system 100 may be located over the arm of the patient where the PICC will be initially inserted. Following the initial calibration (in the absence of the magnet 120) the detector system 100 is calibrated and will compensate for the effects of the Earth's magnetic field including any localized perturbations. When the magnet 120 is introduced, the detector system 100 detects and displays the location a of the magnet in the manner previously described. As the surgeon inserts the PICC (with the attached magnet 120), it may be desirable to relocate the detector system to thereby track the progress of the PICC. Using the digitizing arm 180, the surgeon relocates the detector system 100 to a new location. For example, assume that the detector system 100 is moved six inches in the y direction, three inches in the x direction, and has not moved in the z direction. Based on the new location of the detector system 100, and using the technology described above, the estimation processor 152 (see Figure 5 A) can calculate the magnetic field at the new location due to the magnet 120. Given the contribution to magnetic field at the new location that results from the magnet 120, it is possible to subtract out the effects of the magnet 120. In the absence of the magnetic field from the magnet 120, any remaining or "residual" magnetic field is assumed to be the result of the Earth's magnetic field. The residual reading is processed in the manner described above for an initial calibration to thereby rezero or recalibrate the detector system 100 to compensate for the Earth's magnetic field, including localized perturbations, at the new location. Following this recalibration process, a measurement cycle may be initiated with the resultant measurement of the magnetic field being due solely to the presence of the magnet 120. The user may manually recalibrate the detector system 100 at any point in time. However, the advantage of the technique described above is that the detector system 100 may be automatically recalibrated on a continuous basis as the detector system 100 is used. The digitizing arm 180 provides a continuous reading of the position of the detector system 100 and thus makes it possible to accurately track the location of the detector system. As the detector system 100 moves, it is constantly recalibrated to recompensate for the Earth's magnetic field. In the example above, the detector system 100 may be moved at will to follow the movement of the PICC as it is inserted into the heart without concern that external influences, such as a hospital bed rail, will cause a degradation in the accuracy of the measurement. Although the recalibration system has been described above with respect to the digitizing arm 180, it can be appreciated that other position sensing systems may also be readily utilized. For example, commercial tracking systems are manufactured by Ascension Technology and Polhemus. The system manufactured by Ascension Technology, known as the "Bird Tracker" comprises an array of sensors that measure six degrees of freedom and provide accurate measurements within one- half inch at a distance of five feet and provide rotational information within one- half degree at a distance of five feet. The sensing elements used in the Bird Tracker may be attached to the housing 102 and the position of the housing tracked using the commercial system. Similarly, the Polhemus device, known as the "3-D Tracker," provides similar location measurements without the need of the digitizing arm 180. Another application of position tracking, using, by way of example, the digitizing arm 180 permits the surgeon to provide digitized landmarks that will be shown on the display. A common surgical technique to assist in insertion of a catheter is to place landmarks on the surface of the patient that approximate the route that will be taken by the catheter. For example, with conventional technology the surgeon may place a series of x's on the patient's chest with a marker pen as landmarks to assist in insertion of electrical pacemaker leads. With the principles of the present invention, the digitizing arm 180 may be used to electronically record landmarks specified by the surgeon. This aspect of the invention is illustrated in Figure 6A, when a computer input stylus 182 or other electronic input device is mounted to the digitizing arm 180. The computer stylus 182 may be attached to the detector system 100 or attached to the digitizing arm 180 in a position corresponding to, by way of example the center of the detector system. Prior to insertion of the catheter with the magnet 120, the surgeon may utilize the digitizing arm 180 and the computer stylus 182 to electronically generate landmarks, illustrated in Figure 6A by a series of x's. It should be noted that the computer stylus 182 electronically "marks" the patient, but need not place any actual marks on the patient. In the example above, where heart pacemaking leads will be inserted, the surgeon may place a series of electronic landmarks from the neck to the heart along the route in which the pacemaker leads will be inserted. At each landmark, the digitizing arm 180 records the position marked by the surgeon. In subsequent operation, when the catheter with the magnet 120 is inserted into the patient, the digitizing arm 180 notes the location of the magnet 120 with respect to the landmarks previously marked by the surgeon. The landmarks are shown on an external display 184, shown in Figure 6B, along with the position of the magnet 120, which is indicated by an arrow. As the surgeon inserts the magnet 120. the progress is shown on the external display 184 such that the magnet 120 passes along from landmark 1 to landmark 2 to landmark 3, and so forth. With this technique, the surgeon can readily detect divergence from the expected route. For example, if the catheter and magnet 120 are inadvertently diverted into a different vein, the surgeon will readily note the divergence from the marked pathway and quickly identify the problem. The catheter and magnet 120 may be withdrawn and reinserted to follow the landmarked pathway. The general operation of the detector system 100 is illustrated in the flowchart of Figure 6 A. At a start 200 the magnet 120 (see Figure 4) has been inserted into the patient. In step 201, the system undergoes an initial calibration. In an exemplary embodiment, the initial calibration is performed before the magnet 120 is introduced. Thus, the system 100 compensates for the effects of the Earth ' s magnetic field, including localized perturbations, in the absence of any contribution from the magnet 120. Alternatively, the magnet 120 may be positioned in a known location with respect to the housing 102 such that the effects of the magnetic field caused by the magnet 120 are known and can be canceled in the manner described above with respect to the automatic recalibration process. That is, the contribution to the measured magnetic field caused by the magnet 120 in the known location can be subtracted from the measured readings with the resultant residual value being caused only by the Earth's magnetic field. Following the initial calibration, in step 202, the detector system 100 measures sensor values from the magnetic sensors 108-114. In step 204, the estimation processor 152 (see Figure 5 A) calculates an initial estimate of the location a and orientation of the magnet 120. The initial estimate includes sensor position data from step 208 and magnet calibration data from step 209. The sensor position data calculated in step 208 provides data relating the position of each of the magnetic sensors 108-1 14 relative to a selected origin. For example, one magnetic sensor (e.g., magnetic sensor 108) may be arbitrarily selected as the mathematical origin for purposes of determining the relative positions of the other magnetic sensors (e.g., magnetic sensors 1 10-114). The common origin provides a frame of reference for purposes of the mathematical calculations. As previously discussed, the magnetic sensors 108-1 14 are aligned with respect to the common origin so that each magnetic sensor measures the magnetic field in the same x, y, and z directions. As those of ordinary skill in the art can appreciate, any selected origin can be used satisfactorily with the detector system 100. The magnetic calibration data derived in step 209 is typically provided by the magnet manufacturer and includes data related to the strength of the magnetic dipole m (see Figure 4), as well as the size and shape of the magnet 120. The measured sensor values, sensor position data, and magnet calibration data are provided as inputs to the estimation processor 152 (see Figure 5A) in step 204. In an exemplary embodiment, the initial estimate of the location a is provided by the neural network 154 (see Figure 5 A) based on the measured sensor values derived in step 202. As previously discussed, the neural network 154 may require minimum values from the magnetic sensors 108-1 14 to assure a reliable initial estimate. The neural network 154 provides the initial estimate of magnet location and orientation. In step 210, the estimation processor 152 (see Figure 5 A) calculates predicted sensor values. As described above, this requires a measurement Δ (predicted) for each combination of the magnetic sensors 108-1 14 in each of the three orthogonal directions x, y, and z. In step 212, the estimation processor 152 compares the predicted sensor values (i.e., Δ /7 (predicted)) with the measured sensor values (i.e., A y - (measured)). In decision 216, the estimation processor 152 determines whether the predicted and measured sensor values match within a desired degree of tolerance. If the predicted sensor values and the measured sensor values are not a close match, the result of decision 216 is NO. In that event, the estimation processor 152 calculates a new estimate of the magnet location a and orientation in step 218. Following the calculation of a new estimated location a of the magnet 120, the estimation processor 152 returns to step 210 to calculate a new set of predicted sensor values using the new estimate of magnet location and orientation. The estimation processor 152 continues this iterative process of adjusting the estimated location a of the magnet 120 and orientation and comparing predicted sensor values with measured sensor values until a close match is achieved. When a close match between the predicted sensor values and the measured sensor values is achieved, the result of decision 216 is YES. In that event, in step 220 the detector system 100 displays the magnet location a and orientation on the display 106 (see Figures 3 A, 3B, and 4). In addition, the detector system 100 may display a confidence value indicative of a degree of confidence with which the location a and orientation of the magnet 120 have been determined. The calculation of a confidence value based on statistical data is well known in the art and need not be described in detail herein. Following the display of location and orientation data in step 220, the detector system 100 returns to step 202 and repeats the process on a new set of measured sensor values. If cost function is too high, a close match may not be achieved in decision 216. Such conditions may occur, for example, in the presence of extraneous magnetic fields. In practice, it has been determined that close matches have a cost function in the range of 1-2 while the minimum cost function for an inaccurate local minimal are orders of magnitude greater. If a close match cannot be achieved (i.e., the cost function is too great), the detector system 100 can start the measurement process anew with a new estimated location or generate an error message indicating an unacceptably high cost function. The flowchart of Figure 7B illustrates the steps performed by the calibration processor 158 if automatic recalibration is implemented within the detector system 100. In this implementation, following the completion of step 220, the system 100 may optionally move to step 224, illustrated in Figure 7B, wherein the calibration processor 158 obtains the position data from the digitizing arm 180 (see Figure 5C) indicating the present location of the detector system 100. Given the new location of the detector system 100 and the known location a of the magnet 120, the calibration processor 158 calculates the magnetic field resulting from the magnet and subtracts the effects of the magnet from the current measurements in step 226. As a result of this process, the remaining residual values measured by the magnetic sensors 108-1 14 (see Figure 5A) are due to the effects of the Earth's magnetic field, including localized perturbations. In step 228, this residual value is used to rezero the detector system 100 to compensate for the effects of the Earth's magnetic field at the new location. Following the recalibration process, the detector system 100 returns to step 202, shown in Figure 7A, to perform additional measurement cycles with the detector system 100 at the new location and recalibrated for operation at the new location. It should be noted that the automatic recalibration process illustrated in the flowchart of Figure 7A automatically and continuously recalibrates the detector system 100. However, in an alternative embodiment, the calibration processor 158 will perform the recalibration process only if the detector system 100 has been moved by a predetermined amount. This prevents the unnecessary recalibration when the detector system 100 has not been moved. The iterative estimation process is described above using the difference in magnetic strength B provided by different pairs of magnetic sensors 108-114. Alternatively, the detector system 100 can use the measured field gradient values G. In this embodiment, equation (2) may be fit to the measured values, in a manner as described above with respect to the iterative process to fit the measurements of B. With respect to the flowchart of Figure 7 A, the step 202 provides gradient values with respect to pairs of the magnetic sensors 108-1 14. For example, a magnetic gradient measurement can be calculated using the magnetic field B measured by the magnetic sensor 114 with respect to the magnetic field measured by each of the remaining magnetic sensors 108-1 12. respectively. In step 204, the estimation processor 152 determines an initial estimate of the magnet location and orientation, and, in step 210, calculates predicted sensor values using equation (2). In step 212, the measured sensor values are compared with the predicted sensor values using conventional techniques, such as the cost functions described above. The iterative process continues until the measured sensor values and the predicted sensor values match within the predetermined degree of tolerance. In yet another alternative technique, the detector system 100 utilizes the measurement data and solves equation (2) for a directly. The direct solution approach utilizes the fact that G is a symmetric matrix with positive eigenvalues. The eigenvalues and eigenvectors of the matrix G may be calculated and used algebraically to solve for the location a and m directly. This assumes that the magnitude, but not the direction, of m is known. In practice, the magnitude m is known because magnet calibration data is provided by the manufacturer. It should be noted that this technique requires an additional magnetic sensor to determine the orientation of the magnetic dipole. Mathematically, the orientation of the magnetic dipole is indicated by a + or - sign. The additional magnetic sensor, which need only measure the magnetic field strength B, is used to determine the sign of the mathematical function. In addition, combinations of these various techniques may be used by the detector system 100 to determine the location a of the magnet 120. In yet another alternative, a Kalman filter may be used with equations (1) and (2) above to track the position of the magnetic dipole m with respect to the multi-detector array formed by the magnetic sensors 108-114. As is known to those of ordinary skill in the art, Kalman filters are statistical predictive filters that use statistical signal processing and optimal estimation. Numerous textbooks, such as "Tracking And Data Association," by Y. Bar-Shalom and R.E. Fortmann, Academic Press, Boston. 1988, provide details on the theory and operation of Kalman filters. In addition to the individual techniques described above, it is possible to use any or all of these techniques in a combination, such as a sum of cost functions for each sensor type. For example, the differences between A y (predicted) and A y (measured) can be required to match within a certain tolerance. If the multiple mathematical techniques are unable to identify a solution for which all difference values meet that tolerance, then an error can be signaled to the operator using the display 106 (see Figure 5A). Assuming the errors in each sensor measurement are independent and small, the uncertainty in the estimate of the location a can be calculated using, for example, Cramer-Rao bounds. Thus, a degree of redundancy between measurement techniques can be advantageously implemented by the detector system 100. Such redundancy is highly desirable for biomedical applications. Figure 3 illustrates the operation of the detector system 100 for a specific configuration of the magnetic sensors 108-114. However, the techniques described above may be generalized to virtually any fixed configuiation of sensors. A minimum of one gradient sensor or eight magnetic field sensors is required to measure G(s) and B(s), respectively, assuming that the strength of the magnetic dipole m is known. The magnetic sensors can be configured relatively arbitrarily and thus may be readily positioned at locations within the housing 102 (see Figures 3 A and 3B) based on instrument design and/or other signal or noise considerations. The magnetic sensors 108-114 may be calibrated using the known strength of the Earth's magnetic field. In the absence of any inhomogeneous fields (i.e., away from any strong magnetic dipoles) the X sensor element of all sensors 108-1 14 can be read at the same time. Similarly, all Y sensor elements and Z sensor elements can be read at the same time. In any configuration, the sum of the squares of the average readings of the magnetic field strength for each orthogonal direction (i.e., B x , B y , and B z ) should be constant. The constant value of the Earth's magnetic field can be used to determine the appropriate calibration factors for each magnetic sensor using conventional algebraic and least squares fitting methods. An alternative calibration technique uses a small magnet of known strength placed in one or more locations relative to the magnetic sensors 108-114. Measurements are performed at each of the one or more locations to determine the appropriate calibration factors for each magnetic sensor. Other techniques, such as the use of an electromagnetic cage, Helmholtz cage, or the like, may also be used to calibrate the magnetic sensors 108-1 14. The display 106 (see Figure 3) provides graphical display of the position of the magnet 120 with respect to the housing 102. Figures 8A to 8D illustrate some of the different techniques used by the detector system 100 to indicate the location a of the magnet 120 (see Figure 4). In the embodiment illustrated in Figure 8A, the display 106 uses a circle 250 and a pair of orthogonal lines 252a and 252b to indicate the location a of the magnet 120 relative to the housing 102. The orthogonal lines 252a and 252b provide a visual indicator to the caregiver to assist in determining when the magnet 120 is centered under the detector system 100. In an alternative embodiment, illustrated in Figure 8B, a fixed indicator 254, such as orthogonal lines 254a and 254b, form cross-hairs over the center of the display 106. The circle 250, or other indicator, is used to provide a visual indication of the location a of the magnet 120 relative to the housing 102. The circle 250 is centered in the cross-hairs in the center of the display 106 when the magnet 120 is centered directly beneath the detector system 100. In yet another embodiment, shown in Figure 8C, the display 106 provides a different indicator, such as an arrow 260, to provide a visual indication of the location a of the magnet 120. The arrow 260 may also be used to indicate the orientation of the magnet 120. The depth of the magnet 120 beneath the surface of the patient can be indicated on the display 106 in a variety of fashions. For example, a portion 106a of the display 106 can provide a visual indication of the depth of the magnet 120 using a bar graph, such as illustrated in Figure 8D. However, the depth indicator portion 106a of the display 106 can also provide a numerical read-out of the depth of the magnet 106 in absolute units, such as centimeters, or in relative units. Although the internal display 106 and external display are two- dimensional display devices, it is possible to display the magnet 120 with shading and graphical features to create the appearance of a three-dimensional object. Conventional display technology used in video games and other computer applications may be readily applied to the system 100 so that the magnet 120 appears like a three-dimensional arrow to show the location and direction of the magnetic dipole or a donut to simulate the shape of the magnet with an arrow extending therefrom. Techniques used for such three-dimensional graphic representations are well known in the art and need not be described in greater detail. In addition to displaying the magnet 120 as a three-dimensional graphic image, the system 100 can display the magnet from any perspective. For example, Figure 6B illustrates the location of the magnet as viewed from the top surface of the patient, thus illustrating the location of the magnet in the X-Y plane. However, in some circumstances, it is desirable to view the magnet from a different perspective, such as the Y-Z plane. This perspective allows the user to see movement of the magnet 120 as it moves up and down (i.e., movement on the Z axis) within the patient. The user-selectable display perspective is particularly useful in applications, such as image-guided surgery, where the user must be able to visualize the movement of the indwelling medical device in any plane. For example, it is important to see directional movement in all three dimensions when inserting a cardiac catheter. There are known technologies to permit the display of the magnet 120 from any perspective. For example, Microsoft ® Windows ® includes functions that allow the user to select the display perspective using a mouse, keyboard or other input device. Thus, the detector system 100 determines the location a of the magnet 120 in a three-dimensional space and provides an easy-to-read visual indication of the location of the magnet, including a depth indication, as well as the orientation of the magnetic dipole. While the housing 102 is illustrated as a rectangular housing, with the magnetic sensors 108-1 14 distributed equidistantly within the housing 102, the rectangular shape was chosen for its ease in grasping by the caregiver. However, the housing 102 can have any shape or size. Furthermore, the display 106, while illustrated as a liquid crystal display, can be any convenient two-dimensional display, such as a dot matrix display or the like. Thus, the present invention is not limited by the specific size or shape of the housing 102 or by the specific type of display 102. In addition, the detector system 100 can operate satisfactorily with a variety of different magnetic sensors. Thus, the present invention is not limited by the specific number or type of magnetic sensors employed in the detector system 100. Clinical Studies The operation of the detector system 100 has been described for the detection of a static magnetic field associated with the magnet 120 inserted within a patient. The reliability of the detector system 100 has been tested in clinical studies, the results of which are described below. As will be described in detail below, the location of the magnet was determined using the detector system 100 and subsequently verified using conventional fluoroscopic measurements. The initial trials in the clinical studies indicated a relatively high error in the location detected by the measurement system 100. However, these errors were believed caused by inaccurate alignment of the detector system and the fluoroscopic measurement system, which was corrected prior to the later trials. Thus, the initial errors were due to the misalignment rather than inherent inaccuracies in the detector system 100. In addition, revisions in the signal processing software resulted in greater reliability in later measurements in the clinical study, as discussed below. One application of the detector system 100 is for the insertion of a catheter into the heart. Positioning a peripherally inserted central catheter (PICC) in the lower half of the superior vena cava, just above the right atrium, is a critical application for the detector system 100. Currently, practitioners perform this task "blindly" by measuring external anatomical landmarks and inserting the catheter to the measured depth. The success or failure of the insertion is unknown until a chest radiograph is obtained, which may not occur for several days. The detector system 100 was evaluated in an animal model as a possible solution to the "blind" placement. Forty-four localizations were performed using the detector system to test its accuracy compared with conventional fluoroscopy. The detector system 100 located magnetic tagged PICCs to within an average of 0.4 cm, and a range of 0.2 cm to 1.25 cm. The detector system 100 also provided valuable realtime information about the path and orientation of the PICC tip during difficult insertions. The detector system 100 has demonstrated its ability to accurately locate a magnet tagged PICC relative to an external landmark and thus aid in catheter insertion. The measurement capabilities provided by the detector system 100 have the potential to improve clinical outcomes and thus reduce healthcare cost by decreasing catheter related problems in infusion therapy and by decreasing or eliminating the need for radiographic verification of PICC placements or other medical device placements. Introduction The PICC catheter is inserted to a peripheral vein in the patients arm and threaded into the superior vena cava to a point approximately 2 cm above the right atrium. The current method for introducing PICCs is to measure the distance from the point of insertion to the right sternal third intercostal space on the patient's chest and inserting the PICC to a depth equal to this measurement. The catheters are used for patients who require long-term (two weeks to six months) intravenous access for infusions, blood sampling, or blood transfusion. Currently, PICCs may be placed in outpatient or home settings by nurses, but the catheter cannot be used for infusions or sampling until its locations have been verified by radiography, which is inconvenient, relatively expensive, and can delay therapy for days. Animal Model Domestic cross-breed swine were used as the animal model for this study. Swine are an accepted model of the human cardiovascular system, and they have a cephalic vein in their thoracic limb that offers an acceptable route to the cranial vena cava, which is analogous to the superior vena cava in humans. A necropsy study done prior to the present study has indicated that the right sternal second intercostal space is a good external landmark for locating a point 2 cm above the right atrium in the cranial vena cava. The study also demonstrated that the chest wall to dorsal cranial vena cava distance ranges from 8.5 cm to 10 cm in animals weighing approximately 30 kg. This distance is analogous to the distance in humans for the analogous procedure. This last factor is significant, as the detector system 100 has a distance limit of approximately ten centimeters for locating the smallest magnetically tagged catheter used in the study. Magnet Tagged PICCs Commercially available PICC catheters and introducers were modified by placing one or more small cylindrical (NdFeB) magnets in the catheter tips and sealing the ends of the catheters with a non-sterile, medical grade silicone adhesive. Two catheter sizes were used. The smaller size catheters (4 Fr, 65 cm length) contained three grade 40, Ni-plated 0.8 mm x 2.5 mm magnets, and the large catheters (5 Fr, 65 cm length) contained two grade 40, Ni-plated 1.0 mm x 2.5 mm magnets. The grade 40 magnets had a residual induction (Br) of approximately 12,900 Gauss (G). Magnet Field Detector Two different versions of the detector system 100 were used in the study. A bench-top feasibility system was used for 44 localizations, and a handheld prototype was used for 28 localizations. The hand-held unit included four magnetic field sensors (e.g., the magnetic sensors 108-114) mounted in a plastic case with control buttons and their associated electronics. A peripheral unit, containing processing hardware, software, and a power supply were also used with the hand-held version of the detector system 100. A single hand-held unit with three different software systems was used. Eight localizations were performed with revision 5.0 of the software, 16 localizations were performed with revision 5.1 of the software, and four localizations were performed with revision 5.2 of the software. As will be discussed below, the early revisions of the software for the hand-held prototype required significant software debugging and calibration. More reliable measurements were obtained with revision 5.2 of the software. The bench-top version of the detector system 100 comprises four magnetic field sensors (e.g., the magnetic sensors 108-114) mounted on a Plexiglas platform with their associated electronics. The bench-top version of the detector system 100 was coupled to a personal computer (PC) where software was used to calculate the position and orientation of the magnet in three dimensions and to display the information on a conventional PC monitor in the form of an image indicating the magnet tipped catheter. Matching grids were placed on the Plexiglas platform and on the PC monitor to correlate the position on the monitor with the position on the external anatomy of the subject. Clinical Procedure The study was performed on nine healthy, approximately 25 kg domestic cross-breed swine. Each subject was fully anesthetized prior to the procedure and euthanized immediately following the procedure. After the initiation of the anesthesia, each subject underwent four sequential catheterizations. The subjects were measured externally from the point of insertion to the desired external landmark after venous access was established by a cut down in the axilla. One 4 Fr magnet PICC was inserted twice via an introducer in the right cephalic vein, and one 5 Fr magnet tagged PICC was inserted twice via an introducer in the left cephalic vein. Each catheter was placed in mid-clavicular and cranial vena caval locations and the position of the magnetic tagged tip was determined by one model of the detector system 100 in each location, resulting in the total of eight localizations per animal. The location of the catheters was confirmed with fluoroscopy, and approximate accuracy of the detector system/fluoroscopic location correlation was determined by aligning the fluoroscope with the detector system 100 using a jig attached to the fluoroscope. Both versions of the detector system 100 were positioned over the subject prior to catheter insertion with a reticulated arm and leveled to within one degree relative to the fluoroscope jig using a conventional digital level. In the bench-top version of the detector system 100, an alignment rod was placed through the center of the jig and aligned over the grid on the Plexiglas platform that corresponds to the grid on the PC monitor. In the handheld prototype version of the detector system 100, a paper marker was placed over the rendering on the screen and the alignment rod aligned with the paper marker. Electronically captured fluoroscope images were analyzed with a commercial drawing program to estimate the measured error from the position determined by the detector system 100 and the center of the magnet mass as determined by fluoroscopy. This measurement is considered a conservative estimation. The image of the magnet tip was used as a reference to determine the scale of the image, and the tip may have been angled during the studies. An angled tip scales the image to a greater than actual magnification, thus increasing the measured error. This effect is believed to be minor as the magnet tips appeared to be relatively flat in each fluoroscopic image. Subjective estimates of the catheter position were made by the surgeon performing the measurements. Results The bench-top version of the detector system 100 functioned well during all localizations, but the first twelve insertions were complicated by difficulty in aligning the fluoroscope jig to the detector system 100. In the first twelve insertions, it was assumed that the alignment rod used to align the jig was straight, but it was shown that the alignment rod could be held at an angle, which affected the measured error of the localization. After the twelfth insertion, the alignment rod arrangement was altered to allow it to hang straight, and, after the sixteenth insertion, a hollow Plexiglas cylinder was added to the jig platform to keep the alignment rod straight. Following these modifications, the detector system 100 provided more consistent and accurate results. The magnet tagged PICCs were inserted with ease into the swine cranial vena cavas through the introducers provided in the insertion kits accompanying the PICCs. The detector system 100 aided investigators twice during difficult PICC insertions. In one case, the detector system 100 had indicated that the catheter had doubled back on itself in the cranial vena cava, and the catheter was withdrawn until the image indicated the orientation was correct, and the catheter was properly inserted. In a second case, it was difficult to pass the PICC from the left cephalic vein into the external jugular vein due to a sharp angle at this junction, which was subsequently verified using fluoroscopy. The surgeon used the real-time feedback from the detector system 100 to twist, insert, and withdraw the catheter until it was clear that the catheter was oriented in an anatomically appropriate direction. When the catheter tip was past the sharp angle, it was inserted with ease. It should be noted that results from the three hand-held prototype versions of the detector system 100 are not included in this report, as the software and calibration procedures varied and the localization results varied accordingly. The accuracy of the PICC tip placement was determined by measuring the distance from the actual location of the magnet tagged tip, determined by the detector system 100, to the actual location of the catheter tip determined by fluoroscopy. The 44 localizations were performed in mid- clavicular and cranial vena caval positions, and there was no significant difference between the measured error at these locations (p = 0.90). The mean measured error for 44 localizations in six animals, using the bench-top version of the detector system 100, was 0.40 cm with a standard deviation of D0.29 cm. The results of the bench-top version of the detector system are illustrated in Figure 9. The measured error ranged from 0.02 cm to 1.25 cm, but five out of six localizations with errors of greater than 0.6 cm were performed in the first twelve placements. As previously discussed, the early placements were complicated by difficulties aligning the fluoroscope jig with the detector system 100. As is readily apparent from Figure 9, the alignment difficulties were solved after localization number twelve, with the resultant decrease in measurement error. Conclusions After the first eight localizations, the surgeon was asked to determine the anatomical position of the catheter tip by fluoroscopy without any input from other observers. After the magnet tip PICC was placed using the bench-top version of the detector system 100, the surgeon confirmed that the PICC was in the desired position in every localization. The use of an external anatomical landmark in placing PICCs permits healthcare providers to insert the catheters in many different settings, from the home setting to outpatient clinics. The detector system successfully demonstrated that it could locate the tip of the tagged catheter within an average of 4 mm relative to an external landmark. The external landmarks used in this study do not correlate precisely with human landmarks, due to differences in interspecies anatomy, but the concept of placing a catheter at a prescribed landmark using the detector system 100 has been established. The detector system 100 also permitted users to overcome difficulties in catheter insertions. In several cases during the study, the operator felt resistance at some point during the insertion and used the real-time position and orientation data to position the catheter correctly. This capability proved most useful when the catheter doubled back on itself, which is easily shown using the detector system 100 because the catheter tip stopped its forward progress and rolled into a new orientation. At this point in time, the operator withdrew the catheter until the tip of the image resumed its proper orientation, and the insertion was completed. Another valuable application is the ability to watch the image of the catheter tip as the catheter negotiates sharp angles and curves in the venous system. The investigator used this aspect of the detector system 100 while passing the catheter from the left cephalic vein to the left external jugular vein. The user felt considerable resistance that correlated with the rendering appearing to "bump" into a wall. By twisting and repositioning the catheter, it was eventually passed into the jugular vein, and the investigator felt comfortable that it was positioned correctly. Without immediate, real-time feedback, the user does not know if the catheter takes a wrong turn or kinks until the procedure is over and the patient has undergone radiographic verification. Thus, the present study illustrates the ability of the detector system 100 to accurately locate the catheter tip relative to an external landmark in an animal model, and lays the groundwork for proving its clinical efficacy in placing PICCs and other medical devices. Various techniques have been described above to detect the three dimensional position and angular orientation of a single magnet. However, the principles of the present invention may be extended to the detection of multiple magnets. The system 100 can detect the position of two indwelling medical devices, such as illustrated in Figure 10, where a first PICC 300 is inserted in one arm of the patient and has a magnet 302 associated with a terminal portion thereof. A second PICC 304 is inserted through another arm of the patient and includes a magnet 306 associated with a terminal portion thereof. Those skilled in the art will recognize that Figure 10 serves only to illustrate the use of multiple tubes with multiple magnets. Any combination of known indwelling medical devices may be located using the techniques described herein. Accordingly, the present invention is not limited by the specific type of medical tube or device. As previously described, the position and orientation of a single magnet may be described in three dimensional space by five parameters, which have previously been labeled as x, y, z, θ, and φ. Similarly, the position and orientation of the magnet 306 are also characterized by the same five parameters, although corresponding parameters will likely have different values. Thus, the position and orientation of the magnets 302 and 306 may be characterized by a total of ten unknown parameters. In addition, the contribution of the Earth's magnetic field in the x, y, and z, directions is unknown. Thus, the model used by the detector system 100 for two magnets has thirteen unknowns and requires thirteen independent measurements. In an exemplary embodiment of the detector system, illustrated in Figure 11 , five magnetic sensors, located at positions S r S 5 , each having three orthogonally oriented sensing elements, provide a set of fifteen magnetic sensing elements. This is sufficient to detect the position and orientation of the magnets 302 and 306. As illustrated in Figure 11, the magnet 302 is positioned at a location a,. As is known in the art, the magnet 302 has a magnetic dipole that is represented by the vector m,. Similarly, the magnet 306 is positioned at a location a 2 and has a magnetic dipole that is represented by the vector m 2 . The vectors m, and m 2 represent the strength and orientation of the magnetic dipoles of the magnets 302 and 306, respectively. The magnetic sensors, positioned at locations S,-S 5 will detect the total magnetic field generated by both the magnet 302 and the magnet 306. Thus, the vector sensed at each of the magnetic sensors at locations S r S 5 will be the vector combination of the magnetic dipoles m, and m 2 . However, the system 100 knows the strength of the magnetic dipoles rn ; and m 2 as well as the position and orientation of each of the sensors at locations S / -S 5 . Given this information, as well as the 15 separate measurements, the system can accurately detect the location and orientation of the magnets 302 and 306. The measurement techniques, using the equations described above, can be applied to two magnets. Although the process described herein can locate two magnets, the principles of the present invention can be further extended to more magnets. In the example above, thirteen parameters characterize the Earth's magnetic field (three parameters) and the two magnets 302 and 306 (five parameters each). A third magnet (not shown) can be characterized by the same five parameters discussed above. Thus, eighteen independent sensors are needed to characterize three magnets, twenty-three sensors are required to characterize four magnets and so forth. The initial estimated location of the magnets 302 and 306 may also be determined using the neural network 154 (see Figure 5 A) or other techniques described herein. As will be described in greater detail below, the system 100 can include an array of magnetic sensors (see Figure 13). In this embodiment, the estimation processor 152 can select a subset of sensors having measured magnetic field strength values above a predetermined threshold. The initial position of the magnets may be based on the values from the magnetic sensors whose readings are above the predetermined threshold. In addition, the system 100 may perform an iterative process, as described above, to determine the location and orientation of the magnets 302 and 306. The process of optimization for minimizing the error (or cost) function for multiple magnets may be readily ascertained based on the foregoing description. For the sake of brevity, that description will not be repeated herein. If a single magnet is associated with an indwelling medical device, it is possible to determine the position and angular orientation of the magnet and thus the indwelling medical device in the manner described above. The techniques described above are adequate to detect five degrees of freedom of the magnet and the indwelling medical device associated therewith (i.e., x, y, z, θ, and φ). However, those skilled in the art will appreciate that a dipole magnet is symmetrical about its axis of magnetization. Thus, the indwelling medical device may be rotated along the axis of magnetization and the magnet will produce the same magnetic field. Thus, the system described above cannot determine the angular rotation of the indwelling medical device. In another embodiment of the invention, the magnets 302 and 306 are both associated with a single indwelling medical device. As illustrated in Figure 12, the magnets 302 and 306 are oriented such that their axes of magnetization are not aligned with each other. In the example illustrated in Figure 12, the axis of magnetization of the magnet 302 is orthogonal to the axis of magnetization of the magnet 306. Given the knowledge of the strength of the magnetic dipoles m, and m 2 , and the orientation of the axis of magnetization and the physical location of the magnet 302 with respect to the magnet 306, the system 100 can thereby detect a sixth degree of freedom of the indwelling medical device. This is illustrated in Figure 12 as a rotational displacement ω. The techniques to determine the location and orientation of the magnets 302 and 306 are identical to that described above. However, given the additional knowledge of the fixed orientation of the axes of magnetization and the physical position of the magnet 302 with respect to the magnet 306, it is possible to detect rotational displacement 10 of the indwelling medical device. For example, the indwelling medical device may be an endoscope that may be guided by the image shown on the display 106 (see Figure 5 A) or on an external display. The system 100 can advantageously calculate six degrees of freedom (x, y, z, θ, φ, and ω) of the indwelling medical device associated with the magnets 302 and 306. As previously described, a large number of magnetic sensors may be disposed to form a sensor array, as illustrated in Figure 13. The housing 102 may be sufficiently large (e.g., 9 inches x 12 inches). In this embodiment, the housing 102 may remain fixed in a stationary position on the measurement surface of the patient. As the magnet 120 (see Figure 4) or the magnets 302 and 306 (see Figure 10) are positioned in proximity with the housing 102, one or more of the sensors will detect the presence of the magnetic field. As described above, a sufficient number of magnetic sensors must detect the magnetic field and provide data in order to accurately characterize the location and orientation of the magnet. As described above, a sufficient number of magnetic sensors must detect the magnetic field and provide data in order to accurately characterize the location and orientation of the magnet. Figure 13 illustrates an array of sixteen magnetic sensors uniformly distributed within the housing at locations S r S, 6 . As previously described, each of the magnetic sensors may comprise individual magnetic sensing elements positioned in three orthogonal dimensions, which may conveniently be characterized as x, y, and z. The orientation of sensors along x, y, and z axes provides a convenient means for which to describe the magnetic sensors. However, the principles of the present invention do not require a specific orientation of any of the sensors at the locations S r S I6 nor, indeed, do the sensors need to be uniformly distributed at the locations Sj-S 16 . However, proper operation of the system 100 does require that the position and orientation of each of the magnetic sensors and magnetic sensing elements be known. As described above, a small detector array may be moved with respect to the patient so as to track the insertion of an indwelling medical device and the associated magnet. As the magnetic sensors are moved, the effects of the Earth's magnetic field may change. Thus, recalibration is required as the sensors are moved with respect to the patient. The advantage of the large array illustrated in Figure 13 is that the housing 102 need not be moved with respect to the patient. Thus, the effects of the Earth's magnetic field need only be measured and compensated for a single time. As previously described, the initial position of a magnet may be determined using the sensor array of Figure 13 using the detected magnetic field from four sensors that have the largest values or values above a predetermined threshold. For example, assume that the initial position of the magnet is unknown, that the magnetic sensors at locations S 5 , S 6 , S 9 , and S, 0 all have detected values above a predetermined threshold or have values greater than those detected by the sensors at other locations. As an initial estimate, the estimation processor 152 (see Figure 5A) may assume that the magnet 120 (see Figure 4) is located in a position equidistant from the magnetic sensors at the locations S 5 , S 6 , S 9 , and S !0 . Alternatively, the position within the boundaries defined by these locations S 5 , S 6 , S 9 , and S l0 may be weighted based on the value detected by each of the sensors at those locations. For example, the sensor at location S 6 may have the highest value of the sensors at locations S 5 , S 6 , S 9 , and S jn . Accordingly, the estimation processor 152 may calculate an initial position for the magnet 120 that is closer to the location S 6 rather than equidistant from each of the locations S 5 , S 6 , S 9 , and S ιn . Other weighting functions may also be used by the estimation processor 152. In yet another alternative embodiment, the values detected by the sensors at locations S 5 , S 6 , S 9 , and S ]0 may be provided to the neural network 154 and processed in a manner described above. Thus, the system 100 offers a variety of techniques to determine the initial estimated location of the magnet 120. Through the iterative process described above, the location and orientation of one or more magnets may readily be detected and tracked by the system 100. From the foregoing, it will be appreciated that, although specific embodiments of this invention have been described herein for purposes of illustration, various modifications may be made without deviating from the spirit and scope of the invention. Accordingly, the invention is not limited except by the appended claims.

Claims: CLAIMS What is claimed is: 1. A system for detecting a position of a plurality of magnets within a patient from a measurement location on the surface of the patient, the system comprising: a plurality of magnetic sensors, each oriented in a known direction and generating a set of signals as a function of static magnetic field strength and direction due to each of the plurality of magnets; a processor to calculate an estimated position of each of the plurality of magnets in a three-dimensional space and to calculate values related to a predicted magnetic field strength for at least a portion of the plurality of sensors based on the estimated positions of the plurality of magnets, the processor further calculating values related to an actual magnetic field strength using the set of signals and determining values related to the location of each of the plurality of magnets based on a difference between the values related to predicted magnetic field strength and the values related to the actual magnetic field strength; and a display providing a visual display of values related to the position of each of the plurality of magnets in the three-dimensional space. 2. The system of claim 1 wherein the processor calculates the estimated position using signals from selected ones of the plurality of magnetic sensors whose signals are above a predetermined threshold. 3. The system of claim 2 wherein plurality of magnetic sensors is greater than four magnetic sensors and the processor calculates the estimated position using signals from four of the magnetic sensors whose signals are above a predetermined threshold. 4. The system of claim 1, the system further including a neural network to generate the estimated position, the neural network receiving at least a portion of the set of signals and generating the estimated position based thereon. 5. The system of claim 1 wherein the processor iteratively calculates the estimated positions and the predicted magnetic field strength until the difference between the values related to predicted magnetic field strength and the values related to the actual magnetic field strength is less than a predetermined tolerance. 6. The system of claim 1 wherein the display provides the visual display of data based on a single determination of the values based on the difference between the values related to predicted magnetic field strength and the values related to the actual magnetic field strength. 7. The system of claim 1 wherein plurality of magnetic sensors comprise sixteen magnetic sensor assemblies, each magnetic sensor assembly comprising three orthogonally arranged sensors. 8. The system of claim 1 wherein the plurality of magnetic sensors are distributed in a rectangular array. 9. The system of claim 1 wherein the location of the plurality of magnets is characterized by a predetermined number of parameters and the plurality of magnetic sensors comprise a number of magnetic sensors at least equal to the predetermined number of parameters. 10. The system of claim 9 wherein at least a portion of the number of magnetic sensors are positioned in sensor modules with each sensor module comprising three orthogonally arranged magnetic sensors. 1 1. The system of claim 9 wherein the number of magnetic sensors are distributed over a predetermined rectangular area. 12. The system of claim 1 for use with first and second magnets associated with an indwelling medical device, the first and second magnets having first and second axes of magnetization, respectively, with the first and second axes of magnetization having a known orientation so as not to be aligned with respect to each other, the processor further calculating a rotation of the indwelling medical device based on the values related to the position of the first and second magnets in the three- dimensional space. 13. The system of claim 1 for use with first and second magnets associated with an indwelling medical device, the first and second magnets having first and second axes of magnetization, respectively, with the first and second axes of magnetization having a known orientation so as not to be aligned with respect to each other, the processor further calculating six degrees of freedom for the indwelling medical device based on the values related to the position of the first and second magnets in the three-dimensional space. 14. The system of claim 13 wherein the processor periodically calculates six degrees of freedom for the indwelling medical device and the display provides a tracking visual display of six degrees of freedom for the indwelling medical device. 15. The system of claim 1, further comprising a housing to support the display wherein the display is a two-dimensional display with at least a portion of the display being transparent to allow the user to view the surface of the patient beneath the transparent portion. 16. The system of claim 1, further comprising a housing to support the plurality of magnetic sensors wherein the display is an external display spaced apart from the housing and electrically coupled to the processor. 17. The system of claim 1 for use with a imaging device capable of generating an image of the internal anatomy of the patient, wherein the display displays the image of the internal anatomy of the patient combined with the values related to the position of each of the plurality of magnets in the three-dimensional space. 18. A method for detecting a position of a plurality of magnets within a patient from a measurement location on the surface of the patient, the method comprising: detecting a static magnetic field strength and direction due to each of the plurality of magnets at a plurality of magnetic sensors, each oriented in a known direction; generating a set of signals as a function of the detected static magnetic field strength and direction due to each of the plurality of magnets; calculating an estimated position of each of the plurality of magnets in a three-dimensional space; calculating expected values related to magnetic field strength for at least a portion of the plurality of sensors based on the estimated positions of the plurality of magnets; calculating actual values related to an actual magnetic field strength using the set of signals; and determining values related to the location of each of the plurality of magnets based on a difference between the expected values and the actual values. 19. The method of claim 18, further comprising displaying values related to the position of each of the plurality of magnets in the three-dimensional space. 20. The method of claim 19 wherein displaying values comprises displaying values related to the position of each of the plurality of magnets in the three-dimensional space on an external display located remote from the plurality of sensors. 21. The method of claim 18 wherein the estimated position is calculated using signals from selected ones of the plurality of magnetic sensors whose signals are above a predetermined threshold. 22. The method of claim 18 wherein the estimated position is calculated using a neural network, the neural network receiving at least a portion of the set of signals and generating the estimated position based thereon. 23. The method of claim 18 wherein the plurality of magnetic sensors are distributed in a rectangular array, the method further comprising maintaining the sensors in fixed relationship with respect to the patient, the steps of detecting the magnetic field strength, generating the set of signals, calculating the estimated positions, calculating expected values, calculating actual values, and determining values being performed while maintaining the sensors in fixed relationship with respect to the patient. 24. The method of claim 18 wherein the location of the plurality of magnets is characterized by a predetermined number of parameters and the plurality of magnetic sensors comprise a number of magnetic sensors at least equal to the predetermined number of parameters. 25. The method of claim 18 for use with first and second magnets associated with an indwelling medical device, the first and second magnets having first and second axes of magnetization, respectively, with the first and second axes of magnetization having a known orientation so as not to be aligned with respect to each other, the method further comprising calculating a rotation of the indwelling medical device based on the values related to the position of the first and second magnets in the three-dimensional space. 26. The method of claim 18 for use with first and second magnets associated with an indwelling medical device, the first and second magnets having first and second axes of magnetization, respectively, with the first and second axes of magnetization having a known orientation so as not to be aligned with respect to each other, the method further comprising calculating six degrees of freedom for the indwelling medical device based on the values related to the position of the first and second magnets in the three-dimensional space. 27. The method of claim 26 wherein the steps of detecting the magnetic field strength, generating the set of signals, calculating the estimated positions, calculating expected values, calculating actual values, and determining values are periodically performed, the method further comprising calculating six degrees of freedom for the indwelling medical device and displaying a tracking visual display of six degrees of freedom for the indwelling medical device. 28. The method of claim 18 for use with a imaging device capable of generating an image of the internal anatomy of the patient, the method further comprising displaying the image of the internal anatomy of the patient combined with values related to the position of each of the plurality of magnets in the three- dimensional space. 29. The method of claim 18, further comprising altering the estimated positions based on difference between the expected values and the actual values wherein the steps of detecting the magnetic field strength, generating the set of signals, calculating the estimated positions, calculating expected values, calculating actual values, determining values, and altering estimated positions are repeated until the difference between the expected values and the actual values is less than a predetermined threshold.

Inventors: GOLDEN ROBERT N, HAYNOR DAVID R, SANDERS GARY B, SOMOGYI CHRISTOPHER P, GOLDEN, ROBERT, N., HAYNOR, DAVID, R., SANDERS, GARY, B., SOMOGYI, CHRISTOPHER, P.
Applicants: LUCENT MEDICAL SYSTEMS INC, LUCENT MEDICAL SYSTEMS, INC.
Application year: 1999
Main classification: A61B5
IPC codes: A61B5, A61B19, A61M31, G01B7, G01V3