Neural Tract Avoidance Path-Planning Optimization: Robotic Neurosurgery

: Background: We propose a three-dimensional path-planning method to generate optimized surgical trajectories for steering flexible needles along curved paths while avoiding critical tracts in the context of surgical glioma resection. Methods: Our approach is based on an application of the rapidly exploring random tree algorithm for multi-trajectory generation and optimization, with a cost function that evaluates different entry points and uses the information of MRI images as segmented binary maps to compute a safety trajectory. As a novelty, an avoidance module of the critical neuronal tracts defined by the neurosurgeon is included in the optimization process. The proposed strategy was simulated in real-case 3D environments to reach a glioma and bypass the tracts of the forceps minor from the corpus callosum. Results: A formalism is presented that allows for the evaluation of different entry points and trajectories and the avoidance of selected critical tracts for the definition of new neurosurgical approaches. This methodology can be used for different clinical cases, allowing the constraints to be extended to the trajectory generator. We present a clinical case of glioma at the base of the skull and access it from the upper area while avoiding the minor forceps tracts. Conclusions: This path-planning method offers alternative curved paths with which to reach targets using flexible tools. The method potentially leads to safer paths, as it permits the definition of groups of critical tracts to be avoided and the use of segmented binary maps from the MRI images to generate new surgical approaches.


Introduction
Procedures involving surgical access to the brain pose a high level of difficulty, both in planning and execution.Various procedures entail the need to ingress to deep brain regions, such as biopsy for the detection of pathologies such as cancer [1] or the insertion of electro-stimulators for the treatment of conditions such as Parkinson's disease, dystonia, and some psychiatric disorders [2,3].Brain access is typically achieved through the use of a needle or probe.Currently, only rigid straight needles are used to reach deep locations in the brain, which limits the possibilities between the entry point and destination to a straight line.However, there have been studies in the literature that present new methods for intracerebral navigation using beveled-tip flexible needles, which spin at a controlled rate to reach targets in deep regions of the brain [4][5][6].
With the rise of computer-assisted technology, various studies suggest tools to aid in the automatic trajectory planning of neurosurgery procedures, enhancing safety in insertion, ensuring avoidance of delineated high-risk regions, and saving planning time.These algorithms rely on information obtained from preoperative images, typically from magnetic resonance imaging and computed tomography [7][8][9].Nevertheless, clinically available path-planning methods only focus on rigid needles.The introduction of manual nonrigid trajectories presents additional challenges to the planning and navigation procedures, as those may affect more tissue due to longer paths.However, curved needle navigation would allow for avoidance of high-risk regions, increasing safety at the cost of less intuitive planning and execution, in addition to the need to consider more constraints, thus posing a bigger challenge to neurosurgeons.
Robotic neurosurgery could help with these challenges, and it can also take benefits from the use of these new instruments, with the ability to perform curved trajectories to achieve a surgical goal.However, the difficulty of calculating these trajectories is significantly greater than straight trajectories, which primarily involve evaluating the entry point's position, entry angle, and segment length.In the context of nonrigid tools, additional parameters must be considered, such as the inherent curvature limitations (bend limits) of the tool and the possibility of avoiding critical anatomical structures.
When discussing methodologies for nonrigid needle path-planning, the literature presents a variety of studies.Some investigations focus on helping neurosurgeons determine the optimal approaches to deep brain stimulation (DBS) [10,11] and assisting electrode implantation [12] and electrochemotherapy treatment planning and navigation [13]; another approach has focused on resection interventions [14] and biopsy procedures [15], as well as the automatic calculation of entry points in minimally invasive surgery (MIS) [16].
Regarding the methodological approach, Markov models are investigated as an alternative for motion planning in the presence of motion uncertainty [17].Other authors use rapidly exploring random tree (RRT) algorithms.Patil et al. [15] suggested a distance metric for the incremental growth of RRT algorithms to improve planning performance, and Hong et al. [11] proposed an RRT-based planning method that considers flexible and anatomical needle restrictions.Multi-objective optimization (MOP) has also been explored; Xue et al. [18] exposed a population evolutionary algorithm to solve three different objectives to acquire precise and effective solutions, and Peikert et al. [19] implemented a follow-the-leader, flexible path-planning method using patient-specific image data.Other methods, such as the A* path-finding algorithm [20] or automatic path planning using the GA3C reinforcement learning algorithm [21], have been published; in addition, modern studies have combined methods to address the problem, such as the bi-directional tree proposed in [22], which handles partially observable Markov decision processes (POMDPs) in a continuous state, aiming to improve the calculation of efficiency, and [23], in which they use the Dijkstra A* algorithms and their variants to find optimal trajectories with risk scores based on segmentations carried out by surgeons.Most of these works rely on the Pareto optimization method to find (among the multiple trajectories) the optimal path based on multiple constraints [16].
Our approach is based on the application of a modified version of the rapidly exploring random tree algorithm for multi-trajectory generation and optimization, with a cost function that evaluates the different entry points and uses the information of the MRI images as segmented binary maps.As a novelty, an avoidance module for the critical neuronal tracts defined by the neurosurgeon is included in the optimization process.
The structure of the paper is as follows: the "Materials and Methods" section presents details of the algorithm used.First, the modeling of geometric constraints is presented, and the software tools used are detailed.This section describes the implemented cost function and specifies the different terms and weights assigned.Special emphasis is placed on the term distance from functional structures, such as neuronal tracts, that are not typically considered when using only MRI T1w images, which is a novelty compared to the works cited above.As a first example of the proposed methodology, a clinical case of a glioma in the parietal lobe region is presented.The approaches resulting from the application of the algorithm are shown in the "Results and Discussion" section.Finally, the "Conclusions" section outline the improvements that should be included in order to be able to analyze more complicated approaches.

Materials and Methods
An overview of the algorithm is presented in Figure 1.In our proposal, the information provided by the MRI-T1w images and the information from the MRI-DWI images are used together so that the geometry of the neuronal tracts is introduced into the trajectory optimization criterion.

General Workflow
First, the surgeon provides the relevant information in the form of geometric constraints-atlas-based segmentation binary volumetric datasets segmented by regionsand selects an initial zone where possible entry points will be located.By using the DWI images and the procedure explained in Section 2.3, the surgeon defines the tracts to be preserved in an occupancy map format.The occupancy map dataset includes the vectorordered information of the Cartesian co-ordinates of the tracts so that they can be used within Euclidean distance calculation algorithms.Section 2.3 details how these properly formatted structures are obtained through using ExploreDTI v4.7.9 [24] software.In the next step of the algorithm, the entry angles for each one of the entry points are calculated in Slicer3D ® v5.6.0 software by using the geometrical information of the T1W images and the atlas-based segmentation.The entry angle is computed to calculate the normal vector for the surface at each of the points.The segmentation of the cranial bone obtained from the initial MRI images is used for this purpose.By starting at each of the entry points, the rapidly exploring random tree (RRT) algorithm is applied to generate trajectories that reach the target, and each of these trajectories is evaluated with the proposed cost function.The proposed algorithm is implemented in Matlab, to which the corresponding information of the calculated entry angles, tract occupancy map, and the start and destination points are fed.
The selected path-planning methodology is the RRT algorithm (see Figure 2a), which operates by incrementally growing a tree structure from an initial configuration towards a given goal within a spatial configuration space, which, in this particular case, is a threedimensional space.At each iteration, the algorithm analyzes the properties of a sample from the space and gradually extends the tree based on encountered constraints complying with the geometric restrictions of the growth interval and bending limit of the selected surgical tool.Through this incremental expansion, the objective is to reach the goal and delineate the path constructed from the performed iterations.Subsequently, the trajectories generated are evaluated, including the Cartesian information of the neural tracts selected by the surgeon from the DWI images.For the trajectory evaluation, a cost function capable of handling the information from both image sources is defined.In Figure 2b, we describe the characteristics to consider for the configuration of both the initial and goal points, as well as the spatial configuration for the proper functioning of the algorithm.The angle of entry is obtained as the angle between the projection of the straight line formed by the first trajectory segment after the entry point and the one that is normal to the surface of the skull at that point.The minimum distance is defined as the Euclidean distance between the entry point and the target point.The total distance is defined as the sum of the segments that make up the curved path.A safety radius (r c ) is established for the calculation of collisions to eliminate unsafe trajectories.Prior to planning, it is indispensable to classify the relevant information to obtain an optimal result.To do so, it is necessary to clinically define the entry area, the objective, the obstacles or regions to be avoided, and other constraints, such as the insertion angle or restricted insertion areas.The primary anatomical regions to avoid include areas with sulci, blood vessels, neural tracts, and ventricles; additionally, the ideal insertion angle should be perpendicular to the surface of the skull; however, a deviation of no greater than 30 • from the perpendicular line to the skull may be permissible.Regarding insertion areas, the facial region should be avoided, except for a potential endonasal entry.
Since the complexity of trajectory computation is proportional to the number of defined obstacles, and due to obstacle segmentation falling outside the scope of knowledge of this article, only neuronal tracts will be counted as anatomical constraints.Once the relevant clinical information is available, the map of points that define the neuronal tracts is obtained; then, the three-dimensional space used to generate trajectories from the start region to the target point is created.

Cost Function
In order to select the optimal/safest trajectory, a cost function was applied.For each section of the entry region, the algorithm iterates until the cost obtained for the trajectory is less than a defined threshold, with a maximum of 1000 iterations.The cost function proposed consists of three main terms that assess different aspects of the calculated trajectories: entry point convenience, effort, and safety.

Entry Region and Target Point
Every trajectory has a defined starting point and an endpoint.For this particular application, the neurosurgeon specifies a fixed target point to be reached and an anticipated entry region.This region is subdivided into smaller sub-regions, from which the potential insertion point will be evaluated.In order to obtain the entry points, the information from the T1w images and atlas-based segmentation is used to avoid the selection of placed points occurring near sulci, blood vessels, or other anatomical structures.Based on the calculated entry angle (α) at each point in the region, a weight is assigned, prioritizing points where an optimum angle (α m or 90 • ) is obtained.t A is the term that evaluates the convenience of the entry angle, where the minimum cost for this term would be 1 when the entry angle and the optimum angle are equal, penalizing inclined angles greater than (α):

Effort
In the implementation of the RRT algorithm, the constraints of the possible curvatures of flexible tools (bending limit) have been considered so that the tool paths generated comply with the mechanical constraints of the tool and with actual possibility.However, in the definition of the cost function, it is important to minimize the distance of the trajectory since this implies less damage to tissues.On the other hand, the information from the atlas-based segmented binary volumetric dataset makes it possible to identify the segments through which the trajectory passes.If the i-th element of the trajectory belongs to a voxel marked as a sensitive region, a unit is added to the score variable.
The cost function evaluates the effort of the flexible needle, taking into account the length of the path (L) and the minimum distance from the insertion point to the target (L m ).The score is obtained as the accumulative sum of binary voxels.Thus, the effort is assessed by t L : where b i = 1 if i ∈ binarymap and N e is the number of elements in the flexible tool.

Safety
The last term of the cost function assesses the safety (t S ) with regard to the distance (d) from every segment (j) of the needle to each obstacle (i) of the environment.The term is based on the obstacle distance cost function equation proposed by Hong in [11].When the mentioned distance is greater than a defined maximum (e d ), the cost function is not affected; meanwhile, if the distance d ij is less than the minimum distance allowed to the obstacle (r c ), the trajectory is discarded.
where N e and N o are the number of elements in the flexible needle and the obstacles in the three-dimensional space, respectively.The cost (c) for the trajectory will be the sum of each term multiplied by a weight, which depends mainly on the criterion with which to evaluate the importance of effort, w 1 , safety, w 2 , and insertion convenience, w 3 .Based on the weighting proposal in [11], where the authors prioritize safety (90%) over effort (10%), for the initial simulations, a weight of 70% is assigned to safety, followed by 20% for path length to minimize tissue damage, and finally, 10% for insertion angle convenience.However, in Section 3.2, the results of comparing the variations of the corresponding cost values are detailed.

Definition of Obstacles
As indicated before, the regions to be avoided are defined by the information obtained from preoperative magnetic resonance imaging, specifically DWI tractography images.The risk zones are defined according to the criteria established by the neurosurgeon performing the intervention, as well as the tracts to be avoided based on the procedure being undertaken and the specific brain region targeted for intervention.Subsequently, a region of interest (ROI) is delineated by the surgeon on one of the image planes.The definition of the tracts to be preserved is carried out manually using graphic tools known to the surgeon for the definition of the region of interest and by prioritizing those functional structures in each clinical case.It is important to note that information on the tracts is obtained in a Cartesian co-ordinate vector format and with the same reference system used in the binary volumetric datasets or in the entry and target points, which allows for the fusion of both datasets.
Figure 3a depicts a region of interest delineated over the forceps minor on the sagittal plane.By using ExploreDTI [24] software, information regarding the localization of tracts traversing transversely through the drawn ROI is extracted, as demonstrated in Figure 3b.

Collision Detection
In order to detect a collision, it is important not only to evaluate each point that composes the trajectory but also to assess the segment in between points.A three-dimensional collision calculation algorithm was implemented in the simulation, adding the depth-axis and using the geometrical distance; when given the co-ordinates of the j-th and j + 1th element in the path, a straight line is drawn after calculating the unit direction vector, and the point of intersection to the radius (r c ) around the i-th obstacle is found.Figure 4 shows the intersection points (blue) found by the collision detection algorithm in a section of a trajectory and a single obstacle in a 3D space.
During each iteration, in order to determine possible trajectories, the algorithm assesses the proximity to the obstacles.Paths that intersect the defined safety radius are discarded.For instance, Figure 2a displays five possible trajectories generated in a 2D space, with some being discarded due to intersecting with obstacles.

Results and Discussion
In order to evaluate the performance of the proposed algorithm, the medial region of the parietal lobe has been selected as the target area, where a lesion compatible with a high-grade glioma is evident in the images, and a proposed entry area through the superior frontal gyrus has been suggested by an expert neurosurgeon.One of the main white matter tracts to be avoided in this region is the forceps minor, which is a portion of the fibers of the corpus callosum that connect the medial aspect of both frontal lobes through the genu of the corpus callosum.
In addition to establishing the region of interest for computing the critical tracts in this clinical case and the target point, the neurosurgeon should define the potential entry area.With the assistance of the software Slicer3D ® v4.7.9, possible entry points are identified along the indicated region, followed by determining the tangent plane to the skull at each point for the calculation of α, as seen in Figure 5, using Equation ( 1).

Path-Planning Simulation
Following the indication of relevant anatomical information by the neurosurgeon, including the entry region, obstacles to avoid, sulci, blood vessels, and tract information, the algorithm is executed to obtain the optimal trajectory to reach the destination point.In Figure 6, the optimal trajectory obtained from an algorithm execution with only 100 iterations is visualized.With the aim of minimizing tissue damage during the procedure, a straight trajectory is selected from the entry region to the area surrounding obstacles.The RRT algorithm is then executed to complete the trajectory to the target point while avoiding obstacles.The obtained trajectories are then compared with the paths generated using the RRT algorithm from the entry point to the goal (see Figure 7).Subsequently, all trajectories are evaluated by the cost function (safety, effort, and entry angle) to select the optimal path.The provided solution features a straight trajectory that reaches approximately halfway to the destination point, after which a modification in direction is made to avoid proximity to the tracts identified in the forceps minor, ensuring that the least amount of tissue possible is affected while avoiding obstacles.
Figure 7 shows the algorithm's execution for the evaluation of the different entry points.In order to obtain this Figure, the RRT algorithm was applied from the entry point to the end point, resulting in trajectories that minimized the score obtained from the binary volumetric dataset, which is consistent with a more restrictive execution of the algorithm in terms of security, but this includes surgical tools with navigation capabilities that currently do not exist.Figure 7 also shows the trajectory selected as a result (blue).

Cost Parameters Variation
A preliminary study of the robustness of the solution in terms of the number of iterations and the computational cost was carried out.In all conducted trials, the algorithm finds a solution to the planning problem posed, using as few as 100 iterations.It is noteworthy that the cost of the optimal trajectory obtained varies depending on the weights assigned to each parameter of the cost function.Decreasing the percentage assigned to security (from 80% to 60%), as shown in Figure 8a, highlights the difference in the cost value obtained within the same dataset, where the selected optimal trajectories may or may not vary according to the adjustment of these weights.On the other hand, the obtained results do not significantly vary based on the number of iterations employed in the search for the optimal trajectory.While increasing the number of iterations leads to a greater number of outliers, the values of the median, upper quartile, and lower quartile remain fairly constant, as illustrated in Figure 8b for the case of weights assigned corresponding to 60% in security, 20% effort, and 20% entry angle convenience.

Conclusions
This article introduces an alternative for trajectory planning towards a target using flexible surgical instrumentation, providing assistance to ensure safe solutions that minimize tissue damage.Additionally, it considers factors such as entry angle convenience and neural tracts as the primary obstacles to be avoided.Furthermore, a novel methodology is proposed to identify the key characteristics to consider when calculating the cost function, such as assessing the feasibility of the entry angle.After receiving segmentation information from the neurosurgeon, an analysis is conducted to obtain the optimal trajectory to reach the target point.The segmentation of the information pertaining to the tracts of the forceps minor is performed, as indicated by the neurosurgeon as the priority region to avoid when reaching a lesion in the parietal lobe region.
As a result, a planning algorithm based on RRT is proposed, considering both the anatomical constraints of the clinical case and the mechanical aspects inherent to the instrumentation to be used, offering a solution to the problem, particularly in reaching a lesion located in the medial region of the parietal lobe, with an entry zone in the superior frontal gyrus, where multiple potential entry points have been detected.Additionally, both a collision detection algorithm and a cost function are implemented to determine the feasibility of the proposed trajectories.
Based on this computed cost information obtained for datasets with varying numbers of iterations, the results suggest that potential solutions can be obtained with as few as 100 iterations, and the difference in the calculated cost will be determined by the importance given to each independent factor affecting the trajectory.Furthermore, it is worth highlighting the fact that the cost results are obtained based on the variation of the assigned weight values to each cost function parameter; this allows for better visualization of the behaviors of said values, considering that, typically, the assignment of importance is given according to the surgeon's criteria.This study allows for a quantitative visualization of how this affects the correct selection of parameters.
The present work shows an alternative for offline planning intended to be used prior to surgical intervention.Given the iterative nature of the solution proposal, it suggests continuing the work with an adaptation that can be used online for intra-operative replanning and, likewise, delving into control alternatives for said implementation.
The extension of this work will also focus on incorporating information from various anatomical regions in the brain to classify them based on the avoidance trajectory considered.This would enable the assignment of corresponding weights linked to different types of obstacles.By completing the cost function, much safer trajectories can be obtained using more comprehensive information.Additionally, future work will prioritize carrying out a proof-of-concept study and evaluating the performance of the presented algorithm against the existing proposals in the literature.

Figure 1 .
Figure 1.Flow chart of the proposed framework.

Figure 2 .
Figure 2. (a) Paths generated by the RRT algorithm in 2D.After being evaluated with the cost function, the shortest path (distance) (dashed red line) and the path with the lowest cost (blue line) are highlighted.(b) Spatial configuration constraints for RRT path-planning, where i corresponds to the number of obstacles in the space, j is the number of elements in the trajectory, rc is the radius around each obstacle, α is the entry angle measured from the tangent line on the skull, and d is the distance to each element, j.

Figure 3 .
Figure 3. Visualization of the ExploreDTI software: (a) Delimitation (blue) of the region of interest (ROI) in the transverse section of the forceps minor on the sagittal plane.(b) Three-dimensional visualization of the tracts intersecting the specified section.

Figure 4 .
Figure 4.The result of the three-dimensional collision detection algorithm, where the intersection points (blue) around the obstacle are indicated.

Figure 5 .
Figure 5. Volumetric view of the entry point and angle information obtained in Slicer3D: (a) Threedimensional view.(b) Sagittal plane.

Figure 6 .Figure 7 .
Figure 6.Path-planning results for the RRT algorithm at 100 iterations.Optimal trajectory (blue) calculated from the cost function detailed in Section 2.2, and the shortest path (dashed magenta) and straight line between start and goal (red): (a) Three-dimensional visualization.(b) Coronal plane.(c) Sagittal plane.

Figure 8 .
Figure 8. Results of the cost function computation in relation to the number of iterations: (a) Optimal trajectory cost value for each iteration and cost group.(b) Distribution of calculated cost values for weights of 60% security, 20% effort, and 20% entry angle.