Keywords

1 Introduction

The deep brain stimulation (DBS), targeting the basal ganglia is a symptomatic treatment technique, applied routinely to late-stage Parkinson’s disease (PD) and other movement disorders, such as dystonia or essential tremor. In case of the PD, chronic electrical stimulation is most commonly applied to the subthalamic nucleus (STN), which is small (ca 10 mm along its longest axis) and located in subcortical structures, which makes it a challenging target to implant an electrode into. Moreover, brain shift, electrode bending and other influences during the surgery introduce additional inaccuracies into the process.

As highly accurate electrode placement within the nucleus is crucial for achieving a good clinical outcome, most centers use manually evaluated microelectrode recordings (MER) for additional electrophysiological verification of optimal target position. Over more than a decade, successful efforts have been made to provide automatic MER classification to ease the process using various signal-derived features and machine-learning models(e.g. [1, 2]).

In this paper, we extend on the work of Lujan et al. [3], who suggested fitting of a 3D atlas to manually-labeled MER locations. Using a probabilistic framework, which we described previously in [4], we develop a model that allows fully automatic fitting of a surface STN atlas directly to raw MER data, without the need for manual annotation.

2 Methods

The proposed model is based on finding a maximum likelihood fit of a surface STN model to neuronal background activity, assuming different probability distribution of neuronal activity level inside and outside the STN. The aim is then to find transformation of the STN atlas, which maximizes the likelihood of STN position with respect to the measured MER data. We use the surface atlas by Krauth et al. [5] but any STN atlas can be used in general. The model is described in more detail below, further technical details can be found in the thesis [6].

To extract an estimate of the neuronal background activity level from raw MER signal, we used the normalized root-mean-square (NRMS) measure proposed in [1], which sets the mean RMS value of the first five recording positions of each trajectory equal to one. This approach compensates for variability in electrode impedance.

2.1 The 3D Atlas Transformation Procedure

We define the 3D transformation used in this study as a matrix operation with 9 degrees of freedom (DOF), allowing translations \( t_{x} ,t_{y} \) and \( t_{z} \), scaling \( s_{x} ,s_{y} \) and \( s_{z} \) along the \( x,y \) and \( z \) axis respectively and also rotation around the three axes, given by the angles \( \gamma_{x} ,\gamma_{y} \) and \( \gamma_{z} \).

The transformation is given by the vector \( \varvec{r} \) and can be completely characterized as:

$$ \varvec{r} = [t_{x} ,t_{y} ,t_{z} ,s_{x} ,s_{y} ,s_{z} ,\gamma_{x} ,\gamma_{y} ,\gamma_{z} ]. $$
(1)

2.2 Model Structure

The model assumes two states with different NRMS levels: (i) Inside the STN (IN) and (ii) outside the STN (OUT). The probability distribution of the NRMS values in each state is modeled by the log-normal distribution in what we call the emission probabilities. Additionally, we incorporate smooth transition between states around the boundary, modeled by logistic (sigmoid) function, which we call the sigmoid membership function. This provides smooth gradient for more convenient optimization, as well as a more realistic representation of the electrophysiological boundary of the STN, which is fuzzy especially at the lateral end (see Fig. 2). The emission probabilities, as well as parameters of the sigmoid membership functions are estimated during model training phase on data from the training set and form the parameter vector \( \varvec{\varTheta} \).

The atlas fitting is then done during the evaluation phase, typically on unseen test data. The aim is to find a transformation vector \( \varvec{r}^{ * } \) which maximizes the likelihood of producing a set of observations (i.e. NRMS values) \( \varvec{x} = \{ x_{1} , \ldots ,x_{N} \} \) recorded at locations \( \varvec{L} = \{ \varvec{l}_{1} , \ldots ,\varvec{l}_{\varvec{N}} \} \), where \( \varvec{l}_{\varvec{i}} \) are the 3D recording site coordinates corresponding to observation \( x_{i} \). The transformation using the parameters \( \varvec{r} \) is then applied to the STN atlas vertices \( \varvec{v} \) at the initial position. All parameters from the vector \( \varvec{\varTheta} \) are held fixed during the whole evaluation phase.

Emission probabilities The emission probabilities represent how likely a background activity (NRMS) level \( x_{i} \) is to be observed in the respective state. The emission probabilities are modeled using the log-normal distribution, whose parameters \( \{ \hat{\mu }_{OUT} ,\hat{\sigma }_{OUT} ,\hat{\mu }_{IN} ,\hat{\sigma }_{IN} \} \) are estimated during the training phase using standard maximum-likelihood estimation. Example of trained emission probabilities can be found in Fig. 1.

Fig. 1
figure 1

Fitted emission probabilities: histograms of observed NRMS values inside (red area) and outside (blue area) the STN, with fitted log-normal probability density functions (dashed curves) and their parameters (vertical lines) (Color figure online)

In the evaluation phase, the emission probability \( p(x_{i} \left| s \right.,\varvec{\varTheta}) \) of observing NRMS value \( x_{i} \) in a state \( s \) given model parameters \( \varvec{\varTheta} \) is calculated using formula for probability density function of the log-normal distribution.

Membership probabilities The transition between states is modeled by the membership sigmoid function \( S \), which also represents the fuzzy electrophysiological boundary of the STN, as observed on real data (see Fig. 2). As the slope of the transition is steeper at the proximal boundary (where the electrode enters the STN) the training NRMS data aligned with respect to the STN entry, combined with mirrored data aligned with respect to the STN exit are used to fit a single sigmoid function \( S \), defined by two parameters: shift \( \beta_{0} \) and slope \( \beta_{1} \).

Fig. 2
figure 2

The membership logistic sigmoid function \( S \) (red) fitted to measured NRMS data around the STN entry (blue circles) and exit (green circles, depth-flipped/negative) data. The fitted sigmoid \( S \) can be compared to separate entry and exit sigmoid \( S_{en} \) and \( S_{ex} \), fitted on STN entry or exit data separately (Color figure online)

In the evaluation phase, the sigmoid transition function depends only on the distance from the model surface, rotated using vector \( \varvec{r} \) and is computed according to:

$$ S(\varvec{d}_{\varvec{i}} \left|\varvec{\varTheta}\right.) = \left( {1 + \exp - (\beta^{0} + \beta^{1} (d_{i} ))} \right)^{ - 1} , $$
(2)

where \( d_{i} \) is the euclidean distance between the MER measurement location \( \varvec{l}_{\varvec{i}} \) and the nearest point on the surface of the STN model. Additionally, the distance \( d_{i} \) is multiplied by −1 if the location \( \varvec{l}_{\varvec{i}} \) lies outside of the model and by +1 when inside.

The membership probabilities for trained model parameters \( \varvec{\varTheta} \) and anatomical model transformed by the vector \( \varvec{r} \) are then computed according to:

$$ p(\varvec{l}_{\varvec{i}} \in IN\left| {\varvec{r},\varvec{\varTheta}} \right.) = S(l_{i} \left| {\varvec{r},\varvec{\varTheta}} \right.) $$
(3)

for the state IN and:

$$ p(\varvec{l}_{\varvec{i}} \in OUT\left| {\varvec{r},\varvec{\varTheta}} \right.) = 1 - p(\varvec{l}_{\varvec{i}} \in IN\left| {\varvec{r},\varvec{\varTheta}} \right.) $$
(4)

for the state OUT.

The trained model is fully characterized by the parameter vector.

\( \varvec{\varTheta}= \{ \hat{\mu }_{OUT} ,\hat{\sigma }_{OUT} ,\hat{\mu }_{IN} ,\hat{\sigma }_{IN} ,\beta^{0} ,\beta^{1} \} \), comprising parameters of the emission probability densities and those of the sigmoid function.

Likelihood function and MLE estimation The aim of optimization in the evaluation phase is to find transformation vector \( \varvec{r}^{ * } \), which maximizes the likelihood given the observed data:

$$ \varvec{r}^{ * } = \mathop {arg\hbox{max} }\limits_{\varvec{r}} \mathcal{L}(\varvec{r}\left| {\{ \varvec{x},\varvec{L}\} } \right.,\varvec{\varTheta}) = \mathop {arg\hbox{max} }\limits_{\varvec{r}} p(\{ \varvec{x},\varvec{L}\} \left| {\varvec{r},\varvec{\varTheta}} \right.) $$
(5)

Where \( p \) is the joint probability of observation sequence \( \varvec{x} \) at locations \( \varvec{L} \), given trained model parameters \( \varvec{\varTheta} \) and transformation vector \( \varvec{r} \). When decomposed, the probability of being in state \( s \) (i.e. \( IN \) or \( \left. {OUT} \right) \) and observing a NRMS value \( x_{i} \) at position \( \varvec{l}_{\varvec{i}} \) is computed as a product of the emission and membership probability functions according to the Bayes’ theorem:

$$ p(\{ x_{i} ,\varvec{l}_{\varvec{i}} \in \varvec{s}\} \left| {\varvec{r},\varvec{\varTheta}} \right.) = p(x_{i} \left| {\varvec{l}_{\varvec{i}} } \right. \in \varvec{s},\varvec{r},\varvec{\varTheta}) \cdot p(\varvec{l}_{\varvec{i}} \in \varvec{s}\left| {\varvec{r},\varvec{\varTheta}} \right.) $$
(6)

The joint probability for a single observation is then computed as a marginalization over both states:

$$ \begin{aligned} p(\{ x_{i} ,\varvec{l}_{\varvec{i}} \} \left| {\varvec{r},\varvec{\varTheta}} \right.) & = p(\{ x_{i} ,\varvec{l}_{\varvec{i}} \} \left| {\varvec{r},\varvec{\varTheta}} \right.)= \\ & = p(\{ x_{i} ,\varvec{l}_{\varvec{i}} \in IN\} \left| {\varvec{r},\varvec{\varTheta}} \right.) \\ & \quad + \,p(\{ x_{i} ,\varvec{l}_{\varvec{i}} \in OUT\} \left| {\varvec{r},\varvec{\varTheta}} \right.) \\ \end{aligned} $$
(7)

To compute the joint probability of the whole observation sequence \( \varvec{x} = \{ x_{1} , \ldots ,x_{N} \} ,\varvec{L} = \{ \varvec{l}_{{\mathbf{1}}} , \ldots ,\varvec{l}_{\varvec{N}} \} \), we naïvely assume conditional independence given model parameters and compute the joint probability as:

$$ p(\{ \varvec{x},\varvec{L}\} \left| {\varvec{r},\varvec{\varTheta}} \right.) = \prod\limits_{i = 1}^{N} p (\{ x_{i} ,\varvec{l}_{\varvec{i}} \} \left| {\varvec{r},\varvec{\varTheta}} \right.) $$
(8)

For numerical stability, we use the equivalent task and minimize the negative log-likelihood instead:

$$ \varvec{r}^{ * } = \mathop {arg\hbox{min} }\limits_{\varvec{r}} \sum\limits_{i = 1}^{N} { - \ln (p(\{ x_{i} ,\varvec{l}_{\varvec{i}} \} \left| {\varvec{r},\varvec{\varTheta}} \right.))} , $$
(9)

where \( \varvec{r}^{ * } \) is the MLE estimate of optimal transformation parameters, given the model parameters and the observation sequence. The minimization is performed using general purpose constrained optimization (the active set algorithm as implemented in MathWorks Matlab \( {\texttt{fmincon}} \) function). To prevent the model from diverging from clinically reasonable scaling and rotation, we set the maximum shift to \( \pm 5\, {\text{mm}} \) in any direction, maximum scaling \( \pm 25\% \) in each direction and rotation maximum \( \pm 15^{ \circ } \) around each axis, hence the model abbreviation \( nrmsCon \), used below.

2.3 Reference Methods

In order to evaluate performance of the proposed method, we implemented three reference methods, based solely on anatomical landmarks, identified manually by neurologists in the pre-operative MRI images:

  1. 1.

    target—the method consists in finding a translation \( [t_{x} ,t_{y} ,t_{z} ] \), which shifts central point of the atlas model to the planned target point without any scaling or rotation. This method is also used as the initalization for NRMS-based fitting, as it requires no additional information apart from planned target coordinates, which is the result of standard pre-surgical planning procedure.

  2. 2.

    acpc—this method represents a simple atlas fitting approach, based on two significant brain landmarks: the anterior commisure (AC) and the posterior commisure (PC). The method analytically finds a full 9-DOF transformation which maps the vector given by AC and PC points in the atlas to the vector given by AC-PC points, identified in patient’s MRI scans.

  3. 3.

    allpoints—additionally to the AC-PC points, this method uses 12 landmarks on the STN boundaries, defined previously in the supplement of [7]. The method than finds a full 9-DOF transformation to minimize the least-square distance between the characteristic points on the atlas and in manually annotated patient MRI data.

2.4 Data Collection and Preprocessing

The MER signals were recorded intra-operatively from five parallel electrode trajectories, spaced 2 mm apart in a “ben-gun” configuration around the central electrode. The sampling frequency was 24 kHz, signals were filtered by a bandpass filter in the range 500–5000 Hz upon recording and stored for offline processing. At each of the recording positions, spaced apart by 0.5 mm, a typically ten seconds of MER signal were recorded using each electrode. In order to eliminate artifact-bearing segments of the signals, we used our automatic artifact classifier, presented previously in [8]. Manual intra-operative expert annotation of the MER signals has been stored, labeling each signal as coming either from inside or outside the STN.

2.5 Performance Evaluation

In order to estimate the out of sample performance of the proposed method and due to the relatively small sample size (in terms of whole patient sets), we employed the leave one subject out (LOSO) procedure. In each iteration we kept one subject’s data (maximum two 5-electrode trajectories for bi-laterally implanted patients) for model fitting and evaluation, while all other data were used to obtain the parameters \( \varvec{\varTheta} \).

To evaluate quality of the model fit, we used the machine-learning based approach used also in [3]: the MER recording sites, expert-labeled as STN, were expected to be encapsulated inside the fitted atlas (true positives), while other recordings were expected to lie outside. The accuracy, sensitivity, specificity and Youden J-index \( \left( {J = sensitivity + specificity - 1} \right) \) were computed.

3 Results and Discussion

3.1 Collected Data

The dataset contained data from 27 explorations in 15 PD patients with complete 3D information and additional 8 explorations from 4 patients with measured and annotated MER signals but without information on spatial recording locations. The latter small set was included for estimation of model parameters \( \left(\varvec{\varTheta}\right) \) but was excluded from validation. Each exploration consisted of 5 electrode trajectories with 25.9 recording positions on average. In total, the data included 35 explorations from 19 patients, leading to 175 electrode trajectories and 4538 recorded MER signals.

3.2 Performance Evaluation

Classification performance (i.e. the proportion of correctly included/excluded recording sites) was evaluated for each of the fitting methods on the 27 exploration trajectories, the results are shown in the Fig. 3 and Table 1. As seen from the results, it is apparent that the presented nrmsCon method provided substantially better fit to the measured MER sites than any of the other methods. The results further show, that the main difference is driven especially by the higher sensitivity, i.e. the proportion of correctly included STN points inside the model. This is even more clearly seen from the tabulated values of the Youden J statistic, where the proposed method surpasses the reference methods by a factor of two. It has to be considered that the dataset is highly imbalanced dataset with only 27% of signals coming from the STN.

Fig. 3
figure 3

Comparison of classification performance across methods (correctly included/excluded recorded NRMS points): the proposed electrophysiology-based method nrmsCon (yellow) showed higher STN identification accuracy than the reference MRI-based methods (Color figure online)

Table 1 Overall 3D STN model fitting crossvalidation results on the 27 validation trajectories for all methods

To provide additional insight into the results, we evaluated the fitted values of the transformation parameters individually. Results of the proposed nrmsCon method showed similar distribution to the landmark-based allPoints method, except for a relatively large ca \( 2\,{\text{mm}} \) shift in the \( y \) direction. According to previous studies [9], this is the main direction of the brain shift occuring during surgery and this preliminary evaluation thus provides promising results for intra-operative brain-shift compensation. An example visualization of atlas fit can be found in Fig. 4.

Fig. 4
figure 4

Examples of model fit using the a allPoints method based on characteristic MRI points in patient pre-operative scans (red x) and on the atlas (blue o) and b the proposed nrmsCon method based solely on electrophysiology on a single five-electrode trajectory. The final model position after fitting is shown in purple, the initial position(target method) is shown in grey. The width of the five microelectrode trajectory cyllinders denotes the NRMS value, while colors denote manual labels: STN in yellow, non-STN in grey. MER positions inside the resulting model are denoted by black points, planned target by red o (Color figure online)

4 Conclusion

We proposed a probabilistic model for automatic direct fitting of a STN atlas to multi-electrode explorative DBS MER data. The presented results indicate that the proposed MER-based system may potentially bring increased accuracy in intra-operative MER localization and thus contribute to higher efficacy in DBS research and potentially also in therapy.