1. 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.
2. 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.
2.1. General Workflow
First, the surgeon provides the relevant information in the form of geometric constraints—atlas-based segmentation binary volumetric datasets segmented by regions—and 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 vector-ordered 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 three-dimensional 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
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 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.
2.2. 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.
2.2.1. 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 (
or
) is obtained.
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
:
2.2.2. 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 variable.
The cost function evaluates the effort of the flexible needle, taking into account the length of the path
and the minimum distance from the insertion point to the target
. The
is obtained as the accumulative sum of binary voxels. Thus, the effort is assessed by
:
where
if
and
is the number of elements in the flexible tool.
2.2.3. Safety
The last term of the cost function assesses the safety (
) with regard to the distance
from every segment
of the needle to each obstacle
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
, the cost function is not affected; meanwhile, if the distance
is less than the minimum distance allowed to the obstacle
, the trajectory is discarded.
where
and
are the number of elements in the flexible needle and the obstacles in the three-dimensional space, respectively.
The cost
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,
, safety,
, and insertion convenience,
. Based on the weighting proposal in [
11], where the authors prioritize safety (
) over effort (
), for the initial simulations, a weight of
is assigned to safety, followed by
for path length to minimize tissue damage, and finally,
for insertion angle convenience. However, in
Section 3.2, the results of comparing the variations of the corresponding cost values are detailed.
2.3. 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.
2.4. 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
th element in the path, a straight line is drawn after calculating the unit direction vector, and the point of intersection to the radius
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.
4. 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.