# A Rectangular Toroidal Current-Based Approach for Lung Biopsy Needle Tracking
## 2 Materials and Methods  
### Rectangular Toroidal Needle Tracking System  
In medical puncture procedures, physicians rely on CT imaging data to perform high-precision three-dimensional reconstruction, accurately restoring the patient's internal anatomical structures, including organs, major blood vessels, and trachea. Based on the reconstructed model, doctors can precisely plan the puncture path, ensuring that the target tissue is reached while avoiding critical blood vessels and airways, thereby reducing the risk of intraoperative complications. Traditionally, puncture procedures depend largely on the surgeon's experience and guidance from two-dimensional imaging, which can result in significant errors and risks. However, with the aid of electromagnetic tracking technology, physicians can monitor the real-time spatial position and orientation of the biopsy needle and compare it with the preplanned trajectory, allowing for adjustments during the procedure. This technology employs an external electromagnetic field generator and integrates magnetic sensors at the needle tip to track the needle's movement in three-dimensional space in a non-contact manner. This enables surgeons to dynamically adjust the insertion angle and depth, significantly enhancing precision, as Figure 1 shows. This approach, which integrates CT-based reconstruction, trajectory planning, and electromagnetic tracking for guidance, not only enhances the safety and success rate of puncture procedures but also minimizes the likelihood of severe medical incidents caused by accidental puncture of critical structures. As medical imaging processing and electromagnetic navigation technologies continue to advance, this method is expected to play a greater role in precision medicine, providing more reliable technical support for minimally invasive surgeries and interventional treatments. According to the Biot-Savart law \(d\overset{\rightarrow}{B}=\frac{\mu_{0}}{4\pi}\frac{Id\overset{\rightarrow}{I \overset{\rightarrow}{X}}\overset{\rightarrow}{B}}\), by establishing a coordinate system at the location of the current element and measuring the magnetic induction at a point in space, the relative position of that point with respect to the current element can be determined. The choice of a rectangular toroidal current distribution in this study is driven by both practical and theoretical considerations. From a practical standpoint, this geometry facilitates efficient implementation using printed circuit board (PCB) technology, allowing for precise coil configuration and uniform magnetic field generation within a confined three-dimensional space. Theoretically, the rectangular toroidal distribution enables a simplified application of the Biot-Savart law, ensuring accurate magnetic field calculations and reliable positioning of the biopsy needle. While alternative coil geometries, such as circular coils and solenoids, were considered, they were ultimately excluded. Circular  
Figure 1: Medical puncture positioning diagram. coils tend to generate less uniform magnetic fields and require more complex modeling approaches to achieve the same level of spatial accuracy. Solenoids, although providing a uniform magnetic field along the center axis, present challenges in terms of boundary effects and are less suitable for compact, PCB-based implementations. Consequently, the rectangular toroidal configuration offers an optimal balance of uniformity, computational efficiency, and practical implementation. The circular current model complicates the integration process when calculating the toroidal integral model. In contrast, the calculation of the magnetic field is significantly simpler when using the long straight wire current model. The strength of the magnetic field is directional and vectorial. Since the magnetic field is vectorial, when calculating the rectangular current-based magnetic field, only the magnetic fields generated by the currents in the four sides of the rectangle need to be added vectorially.