Pin-based CSG
The pin-based CSG studied in this paper is inspired by [6] and uses a sparse point-surface contact set (a selected number of strategically placed adjustable pins) to achieve a stable configuration between the device and the bone. The pin-based CSG consists of a regular grid of holes, through which pins can be inserted (see Fig. 1). To give a more precise impression of how our method should be integrated in the surgical pipeline, we give an overview for a CSG-assisted total knee replacement in Fig. 2.
Since the CSG works on the basis of sparse point-surface contact, it is of paramount importance to configure the device appropriately. First, the pin depth should be adjusted in such a way that all pins touch the bone surface when the device is in its intended position. Further, their number should stay reasonable for a clinical setting, which implies that they need to be strategically distributed. Given these constraints, our algorithm derives an optimal set of active pins csg, a CSG configuration, via a simulation and optimization procedure (see Fig. 1).
In our pilot study, we fabricated a prototype of the pin-based CSG, which consists of a square plate (width \(=\) 90 mm, height \(=\) 10 mm, depth \(=\) 90 mm) with \(11\,\times \,11\) holes (radius \(=\) 2 mm), through which pins (length \(=\) 100 mm, \(\mathrm{radius_\mathrm{tip}}=\) 2.5 mm) can be inserted and fixated, see Fig. 1. The prototype of the pin-based CSG merely serves as a tool to validate our optimization method and is not directly intended for clinical use. The pin-based CSG can contain 121 pins in total; however, it seems impractical to adjust all pins. Setting a single pin takes at least 10 s, and the manual configuration process is increasingly tedious and cumbersome with a larger number. Additionally, sometimes it is important to avoid placing pins, which would lead to unwanted contacts with certain regions of the bone, e.g., those designated inaccessible by the surgeon (see Fig. 3). We will refer to these situations as full, respectively, limited exposure.
Given the limit on the number of pins, the amount of possible distributions, and the complexity of the physical interactions between the CSG and the bone, it is challenging to configure the CSG to ensure a very low rotational and translational error after application to the bone. Using our algorithm, this configuration step can be automated, leading to a small number of strategically positioned pins, ensuring stability and accuracy.
CSG optimization
The core of our optimization method is the derivation of the CSG configuration, which we will describe in detail in this section. First, we define the CSG objective function to measure the device’s deviation from its intended location, while considering an uncertainty in the CSG placement process. We then explain how this objective function is minimized with the help of a genetic algorithm in order to optimize the configuration of the CSG. For convenience, Table 1 contains an overview of all the variables used in this section.
Table 1 Optimization variables
CSG objective function
In order to steer the optimization method toward a suitable CSG configuration, an appropriate CSG objective function is key. Ultimately, it should be an indicator of how well the device snaps into its intended position and how stable it is. Hence, the baseline of our objective function is a measurement of the alignment error (global drift and orientation deviation) when the device reached an equilibrium state on the bone. Nonetheless, as angles and translational movement are not comparable, we opt for an objective function which allows us to bound both.
Assuming for the moment only a single direction-origin pair \(d\) defining a translational movement toward the bone surface, we then define for a given CSG configuration (csg) the CSG error for \(E_\mathrm{d,\mathrm csg}\) as the maximum deviation \(M_\mathrm{d}\) over all pins. In other words, we compute \(M_\mathrm{d}\), as the maximum Euclidean distance between the intended and actual pin location (see Fig. 4). Given \(M_\mathrm{d}\), we can derive a bound on global drift and orientation deviation and vice versa. In our work, we impose a maximally acceptable drift of 1.5 mm, which implies a rotational error of \(<\)1\(^{\circ }\) (see Figs. 15, 16). The surgeon can also modify this value prior to surgery.
One important observation is that the equilibrium state of the CSG depends on the bone surface \(s\) and a surgeon would not be able to move a device perfectly along a single direction. Consequently, several docking movements \(d\), in the form of a starting position and direction, should be tested. In practice, we restrict \(d\) to a truncated cone (see Fig. 5). The directions and origins inside the truncated cone are tested; the final objective function is then \(E_\mathrm{csg}=\mathrm{max}_\mathrm{d \in cone}E_\mathrm{d,\mathrm csg}\). In practice, we use 40 directions because the maximum drift parameter changed only marginally (drift \(<\)0.05 mm) hereafter and the computational overhead of adding more directions does not pay off in this case.
To determine the CSG equilibrium state, we employ a physical simulation that predicts how the device will behave. During the simulation, we subject the CSG to external forces to mimic the real behavior of the docking process. We observed that apart from the principal pressing force along \(d\), the user will exert moments and parallel forces on the CSG in an attempt to assess its stability using the haptic feedback that it provides (if the CSG wanders under these external forces, it is not securely docked in the right position). Taking the pressing force into account is useful because the morphology of the host bone might make particular pressing directions more suitable. For instance, in the case of the distal femur, we observed that when applying the pressing force under a slight angle, the CSG behavior improves (see Fig. 6). In most cases, the CSG will reach an equilibrium state in which the CSG error can be determined. However, in some cases, the CSG will simply fall off and the physical simulation will be aborted prematurely. Here, we consider the error to be infinite, indicating that it is not useful.
The objective function also allows us to take several constraints into account. First, the truncated cone defining possible values for \(d\) can be manually modified by the surgeon to adjust the angle of approach and the cone angle. For instance, a right-handed surgeon might never place the device from the left, due to limited exposure or the way that the patella is exposed. Such adjustments can be performed via a simple interface showing the virtual bone and the cone. The cone angle range is limited to \(10^{\circ }\)–\(30^{\circ }\) in order to prevent unreasonable docking directions (e.g., from below the surface). In practice, these constraints are easily fulfilled. Additionally, we provide standard settings to add an automatic bias of a \(5^{\circ }\) inclination for left/right-handedness of the surgeons, but refrained from using it in our study to avoid such prior knowledge.
Genetic optimization
Given the sparse contact between the CSG and the bone, it is critical that the CSG configuration is tailored in such a way that it optimizes the fit and warrants stability and accuracy. For a given patient, we rely on an algorithm that uses a genetic optimization method driven by the previously defined objective function, which will be explained in this section. This solution allows us to handle the very large input parameter space (with around \(2^{11\times 11}\) possible pin configurations), in which, given the current software and hardware resources, it would be impossible to evaluate all configurations iteratively. Although we refer to our pin-based CSG, most of this optimization strategy can, with minor modifications, be applied to other types of CSGs as well e.g., for hip replacement.
Genetic algorithms are inspired by natural evolution, in which fit individuals are more likely to survive [7]. Unfit individuals are removed by a selection process. The remaining population develops into new individuals via inheritance, crossover, and mutation. By iterating the selection and evolution steps, the individuals are likely to approach the local minima of the objective function. Figure 7 gives a schematic overview of the genetic optimization algorithm used in our approach.
In our context, individuals correspond to different CSG configurations (see Fig. 2). In our case, each configuration csg consists of a set of active pins in the CSG (see Fig. 8). Initially, the CSG population consists of random active-pin distributions, which are established via a Poisson distribution to ensure a minimum distance between the pins and to avoid clumping, which leads to individuals with high alignment error that are unlikely to survive the genetic optimization. The pin insertion depth is determined automatically by moving the pins downward from the intended rest pose of the CSG until they collide with the surface of the bone.
Initially, our set consists of ten pins, which is a reasonable number to be configured manually. Introducing additional pins seems overly conservative, as in all test cases, ten led to solutions that respected the imposed accuracy constraints for practical use (\(<\)1.5 mm and \(<\)1\(^\circ \)). In fact, our algorithm always found solutions with even less pins while maintaining stability and accuracy.
To evolve the set of current individuals, we apply elitism, crossover, and mutation. Elitism keeps the best individuals (elite) in the population to maintain their good properties. For crossovers, properties of two randomly chosen individuals are exchanged (see Fig. 9). Mutation means copying elite individuals and applying a slight configuration change. Precisely, a randomly chosen active pin is moved to a new location, (see Fig. 10). In order to reduce the probability of getting stuck in a local extremum, random CSGs are added to the population with a small probability.
Finally, we introduce a special mutation step with the goal of converging toward a minimal pin set; if an individuals’ error falls below a threshold \(T\), as defined in the previous section, a second copy with one randomly removed pin is added to the population (see Fig. 10).
In theory, in an ideal case, only six pins might remain, which is the required number for a static equilibrium [13]. However, finding such a perfect configuration is particularly challenging and might not even be possible for all bone morphologies. It turns out that in practice, a minimum of eight well-distributed pins are required to reach a stable device placement (see Table 3).
The outline of our optimization strategy reads as follows:
-
1.
Generate a CSG population of \(n\) individuals;
-
2.
For each individual, evaluate the objective function, see the section “CSG objective function”;
-
3.
Sort the population based on alignment error in an ascending manner;
-
4.
\(c_\mathrm{e}\) percentage of individuals with the lowest error is propagated to the next generation without any modification (elitism);
-
5.
For each individual whose error is below the given accuracy threshold, we add a copy with one removed pin to the population;
-
6.
Complete the population to \(n\) by performing crossovers and mutations and by inserting random individuals
-
(a)
\(c_cn\) CSGs are created using crossover, where the parents are chosen proportionally to their error (individuals with low error are more likely to be chosen than individuals with high error);
-
(b)
The remaining fraction of \((1-c_c)n\) CSGs is used for mutation \((c_m n)\), and new individuals \(c_nn\)
-
7.
If the best solution has been the same over \(i\) iterations, we stop the algorithm; if it changed, we restart at step 2.
The following parameter set works well in practice: \(n\,=\,50; c_e\,=\,6\,\%; c_c=0.5; c_n\,=\,0.1; c_m\,=\,0.4; i\,=\,50;T\,=\,0.5\) mm. Slight variations do not significantly impact the quality of the outcome.
Implementation and performance
The optimization method described in this paper is implemented in C++, PythonFootnote 1 and OpenGLFootnote 2, using the open source Bullet PhysicsFootnote 3 Simulation API. Our optimization framework provides a complete interface for exploring all aspects of the optimization process, meaning that the end user can see how CSGs evolve via the genetic optimization. For all CSGs, the user can inspect the configuration and interaction with the bone from different directions. The maximum pin drift associated with the directions is temporally visualized via a disk (see Fig. 11). Furthermore, the system allows the user to make small changes to the optimized CSG, in order to investigate the impact of a change on stability.
Table 2 shows the timings of the optimization routines for various CSGs applied to the distal femur model. Although the timings in Table 2 are considerable, there is still room for improvement, as our primary focus was the development of the optimization technique itself, and not particularly its performance. Since the physical simulation is entirely independent, it is well suited for a multi-threaded environment, resulting in a roughly linear speedup in the number of cores of the system. Further, using graphics hardware for the physical simulation (e.g., for collision detection) might result in a significant speedup, as evidenced by recent graphics engines, such as Optix [18].
Table 2 List of computer-optimized CSGs and the time it took to run the genetic optimization
Experiments
The goal of our experiments is threefold. First we want to determine the accuracy and reliability of our optimization method compared to the manual method, taking into account full and limited surgical exposure. Second, we want to see whether our optimization method works with varying bone geometries. Third, we want to verify whether our pin minimization method leads to accurate and consistent results. In the next sections, we describe our experimental setup, which CSG-bone combinations were tested, and how we performed the measurements.
Setup
The experimental setup as shown in Fig. 12 comprises a prototype of the pin-based CSG, a 3D printed distal femur and a 3D point digitizer (MicroscribeFootnote 4). The bone model is scaled 1.5 times to minimize any potential errors due to the limited resolution of the fused deposition modeling printing technology (\(0.17\) mm) and errors in 3D point digitization. To evaluate the configuration of a CSG, we measured its precise location and orientation after placing it on the bone, see the “Measurement method” section.
CSG configurations
We tested the prototype of the pin-based CSG on nine 3D printed distal femora (see Fig. 13). Two are based on actual patient data, and the remaining seven are generated by an Active Shape Model (ASM) which was built from a training set of 62 distal femora as described in [2]. Shapes were extracted from the ASM by varying the first two modii of variation. We created a mean femur and six extremes of the first two modii of variation (see Table 3).
Table 3 Overview of the CSG-bone combinations that were tested
The manually configured CSGs from Table 3 were generated by nine participants (age 24–62). Participants were divided into three groups: (a) three untrained participants without special a priori knowledge of human anatomy, (b) four medical visualization students with prior anatomical knowledge, but no surgical experience (although one even has a background as a radiology assistant), and (c) two expert orthopedic surgeons (approximately 15 and 30 years of surgical experience). The concept of the pin-based CSG was explained to the participants, stressing the importance of alignment reproducibility and stability of the CSG when docked onto the bone. They were asked to create two pin configurations (based on full and limited exposure) that would optimize the placement of the CSG in its equilibrium state (the smallest translational and rotational error with respect to the planned alignment). To facilitate this task, participants were given the option to use our computer program to set active pins using a mouse and to see the corresponding CSG device in the intended equilibrium state with all active pins in contact with the bone (see Fig. 14). The experiments were performed under no time pressure; each participant could use as much time as wanted and had as many attempts as needed to setup a configuration. Up to ten pins were allowed to be placed on the device, despite the possibility to use less, all participants used all pins. The experiments started with a quick demonstration of an ad hoc configuration and a short explanation of the simple computer program to set and investigate the pin combination. Participants took between one and three minutes to create a pin configuration.
Measurement method
For each CSG in Table 3, we used a digital caliper (\(\pm 0.01\) mm) to adjust the pin depth to carefully reproduce each CSG configuration (see Fig. 12). Next, it was deployed ten times on the 3D printed distal femur. In order to measure how much the CSG deviates from the planned position and orientation, two point-paired registrations are performed by digitizing reference points (known in the virtual and the real world) on the CSG and the 3D printed distal femur using the 3D point digitizer (see Fig. 12).
While in theory, three reference points are sufficient for point-paired registration, for practical reasons and to increase accuracy, we obtained four reference points on the CSG (located at the corners of the device). Given the resulting registrations, the homogeneous matrices describing the position and orientation can be computed. From this transformation matrix, we derive the distance between the intended and the actual location, and the angle between the intended and actual orientation vectors to verify the accuracy of the alignment.