Abstract
Traditional non-rigid registration algorithms are incapable of accurately registering intra-operative with pre-operative images whenever tissue has been resected or retracted. In this work we present methods for detecting and handling retraction and resection. The registration framework is based on the bijective Demons algorithm using an anisotropic diffusion smoother. Retraction is detected at areas of the deformation field with high internal strain and the estimated retraction boundary is integrated as a diffusion boundary in the smoother to allow discontinuities to develop across the resection boundary. Resection is detected by a level set method evolving in the space where image intensities disagree. The estimated resection is integrated into the smoother as a diffusion sink to restrict image forces originating inside the resection from being diffused to surrounding areas. In addition, the deformation field is continuous across the diffusion sink boundary which allow us to move the boundary of the diffusion sink without changing values in the deformation field (no interpolation or extrapolation is needed). We present preliminary results on both synthetic and clinical data which clearly shows the added value of explicitly modeling these processes in a registration framework.
1 Introduction
The most common approach to image guided neurosurgery is the integration of pre-operative anatomical and functional images, as well as planned retraction and resection boundaries, with a neurosurgical navigation system which guides the surgeon during surgery. However, considerable brain-shifts due to various factors such as gravity, edema, tumor mass effect and cerebrospinal fluid leakage have been reported after the craniotomy and opening of the dura[1]. This decreases the intra-operative accuracy of these navigation systems significantly. Secondly, as a result of resection and retraction, additional morphological changes occur which render the pre-operative images obsolete with respect to the real intra-operative anatomy. The introduction of intra-operative MR scanners has provided the surgeon with anatomically correct images intra-operatively which facilitates a more aggressive resection. Unfortunately, intra-operative MR scanners are not typically capable of providing accurate functional information during a procedure. Hence, mapping the pre-operative image data to reflect intra-operative anatomy will increase the accuracy of the neurosurgical navigation system and hopefully improve the outcome of the neurosurgical procedure. Numerous nonrigid registration algorithms have been proposed to handle brain shifts. However, there are only a limited number of methods proposed to handle retraction and resection. Retraction and resection pose two different challenges – retraction requires the algorithm to facilitate development of discontinuities in the deformation field along the retraction boundary while resection necessitates the algorithm to handle data which is present in the pre-operative image but missing in the intra-operative image.
In [2] Periaswamy et al proposed a registration framework which handles missing data by applying the expectation maximization method to iteratively estimate the missing data and the registration parameters. However, their missing data model does not constrain the localization of the missing data in any way. For modeling of resection one can assume that data is not sporadically missing throughout the image, but confined to a single area. Miga et al proposed in [3] to use a bio-mechanical model to handle resection and retraction. They applied no automatic means of detecting the missing data due to resection or the retracted areas; they manually delineated the resected area and used a calibrated microscope to determine the position of the retractor during surgery. Bio-mechanical models are frequently simulated with finite element methods (FEM) which require a tessellation of the image domain. FEM based methods with automatic detection of retraction and resection require retessellation during the registration procedure which is a non-trivial and time consuming process and thus may not be very practical for intra-operative registration.
The demons algorithm[4] has over the last decade proven to be a fast, accurate and robust monomodal non-rigid registration algorithm[5]. It can be viewed as a two-stage energy minimization technique[6]. First it finds an unconstrained dense deformation field which matches the images whereupon it regularizes the deformation field to an elastic or fluid deformation by smoothing it with a Gaussian low-pass filter. In his original paper, Thirion pointed out that Gaussian smoothing can be interpreted as a diffusion process. In [7] Perona and Malik proposed a smoothing filter modeled by a non-linear anisotropic diffusion process where diffusion can be restricted across boundaries. We will show how the flexibility of this diffusion based smoother can be exploited to handle resection and retraction. In particular, we will model resection by what we have termed a diffusion sink and retraction with a diffusion boundary. Some of the ideas we have applied in our work are influenced by developments in the vision literature on handling occlusions and discontinuities in the estimation of optical flow[8].
2 Methods
2.1 Registration
Demons Registration
We wish to register two monomodal images, a pre-operative image P(x), x ∈ ΩP with an intra-operative image I(x), x ∈ ΩI where ΩP and ΩI are the pre-operative and intra-operative image domains respectively. By posing the registration as a diffusion process, the demons algorithm[4] is effective at finding the deformation UIP(x) = x + uIP(x), where uIP is a displacement field, which puts P into agreement with I. It is a two-step iterative method where the first step consist of finding an unconstrained velocity field with an optical flow computation followed by a smoothing step to regularize the deformation. The velocity field is computed by
| (1) |
where ○ denotes composition. The regularization step, consisting of the application of a smoothing filter S can either be applied to the updated deformation field to achieve an elastic deformation , or directly to the update which will result in a fluid deformation:
| (2) |
In the traditional Demons algorithm, the smoother S is typically a Gaussian low-pass filter. This two-stage process proceeds until a convergence criterion is reached. The fluid version of the demons algorithm was applied for this work because of its ability to handle large deformations. In the following, whenever it is clear from the context, we will drop the dependence on x.
Bijective Demons
Because of the asymmetry in Eq. (1), there is no guarantee the final deformation field will be bijective. That is, if we compute UIP and UPI then there is no guarantee that UIP ○ UPI = IdΩI or UPI ○ UIP = IdΩP where IdΩi denotes the identity over the domain Ωi. A general way of enforcing bijectivity of a deformation field is to put the constraint |J| > 0 on the Jacobian matrix of the deformation field. However, it is computationally intensive to enforce this constraint[9]. Thirion[4] suggested a simpler solution where , and the residual are all calculated at each iteration. By subtracting half the residual from both deformation fields one can constrain them to be bijective: and .
Not only does this enforce bijectivity, it also provides us with the inverse deformation fields and for little extra computational cost. We will model retraction by allowing discontinuities to develop at certain areas of the deformation fields in such a way that rPI will be close to zero while rIP will have large residuals around the area of the discontinuity (see Fig. 1). Hence, we can guarantee that UIP ○ UPI = IdΩI, but conversely we will have UPI ○ UIP ≠ IdΩP around this area.
Fig. 1.
Whenever an area in ΩP is found where the strain in the deformation field exceeds a certain threshold, this point is added as boundary in the smoother to enable a discontinuity to develop in ΩP. This can be seen in the left figure. At the same time, the corresponding boundary is placed in ΩI which is shown in the right figure. Notice that the residual rIP will be very large at the areas of retraction, something which can be effectively used to approximate the width of the retracted area.
Directional Diffusion as a Smoothing Process
Mathematically the diffusion process can be formulated as , where C controls the diffusion strength. Let us discretize this equation in 1D:
| (3) |
| (4) |
At each point we calculate directional differences (East and West). We generalize the traditional diffusion model in Eq. (4) by introducing a separate conductance function for each direction:
| (5) |
To ease readability we rewrite Eq. (5) as . By using upwind differencing on the left hand side the update equation becomes q(x, t + 1) = q(x, t) + μ(ΛE(x, t) − ΛW(x, t)), where . It becomes evident from Eq. (5) that a directional difference eastwards is analogous to diffusion in the opposite direction. We will operate with a separate conductance map for each diffusion direction. For the 2D case we will have CE, CW, CN and CS (due to space constraints we will refer to them collectively as CE∣W∣N∣S) which provides flexibility in restricting diffusion. One can for instance allow diffusion in one direction while restricting diffusion in the opposite direction which will prove useful for modeling a diffusion sink. The conductance term can be modeled in different ways[7]. We model the conductance in a certain direction at point x through the relation CE∣W∣N∣S(x) = 1 − BE∣W∣N∣S(x), where BE∣W∣N∣S are binary directional boundary maps specifying whether a diffusion boundary should occur at position x. Update Eq. (2) can thereby be rewritten as
| (6) |
where η defines the number of diffusion iterations.
Diffusion Boundary
To accommodate for the development of discontinuities along a retraction path, the tear due to retraction will be modeled as a diffusion boundary. Let us define a label map
| (7) |
for p on the lattice , m = 1…M − 1, n = 1…N − 1 in ΩP. To restrict diffusion across the tear and thereby allow a discontinuity to develop, values in Φ are incorporated into the directional boundary maps as follows:
| (8) |
| (9) |
Diffusion Sink
Another diffusion restriction which will prove useful for modeling resection is what we have termed a diffusion sink. A diffusion sink is basically an area ΩRI ∈ ΩI (resected area) where diffusion is allowed into the area and not out of it. This diffusion sink provides us with a number of nice properties 1) the deformation field will be continuous across the boundary of ΩRI denoted by ∂ΩRI, 2) even though a pixel is initially labeled as resected it might change label to non-resected later in the registration procedure. Because the deformation field is continuous across ∂ΩRI we can move the boundary of the diffusion sink without changing values in the deformation field (no interpolation from the deformations on ∂ΩRI to the areas which changed label from resected to non-resected) and 3) unwanted demon forces occurring within ΩRI will not affect areas outside. Let us define a label map, Ψ, on the lattice (mΔx, nΔy), m = 1…M, n = 1…N which takes on values 1 at locations assumed to be resected and 0 at locations outside the resection. A diffusion sink can then be incorporated in the anisotropic diffusion by using the following directional boundaries for the x-direction:
| (10) |
| (11) |
and the boundaries, BN and BS, for the y-direction are derived similarly. Figure 2 provides examples of applying diffusion boundaries and a diffusion sink to a smoothing problem.
Fig. 2.
The left plot shows three different compartments, each having a mean value of y = 6, 2, 10 with uniform noise added to it. One approach for modeling diffusion here would be to add diffusion boundaries between the compartments. The middle plot includes the results from running this through the diffusion filter (η = 100, μ = 0.2). Notice that values have effectively been confined to their respective compartments which has resulted in discontinuities at the boundaries. We will use this concept for modeling retraction. Another approach is to model the middle compartment as a diffusion sink which allows diffusion into the compartment but not out of it. The right figure shows results from running the diffusion filter on this case. Notice the continuous values across the boundaries between the compartments and that none of the information from the middle compartment has diffused into the two neighboring compartments.
2.2 Modeling Retraction
Tearing of tissue has been modeled in surgical simulators where tissue tears whenever the strain/stress of the deformation applied to the tissue exceeds a certain threshold[10]. We apply a similar model – around the area of retraction, where there are discontinuities in the movement of tissue, our assumption is that a considerable strain will build up in the deformation field as the registration algorithm proceeds to match the images (see Fig. 1). The general idea is to let the registration proceed until a location in ΩP is found where the strain exceeds a certain threshold. From this location the tear is propagated along the direction normal to the direction of maximal strain until the strain drops below the threshold. The algorithm proceeds by iterating between registering the images and estimating the tear.
Detecting Tearing of Deformation Field
For in-plane problems the strain tensor can be expressed as
| (12) |
At an area of retraction in ΩP, deformation vectors on different sides of the retraction in UPI will point towards each other. Hence, the minimum eigenvalue and the corresponding eigenvector, λ(x) and υ(x), of the strain tensor in ΩP determines the direction and magnitude of maximum strain. At each iteration of the registration procedure we compute the minimum eigenvalue λ(p) and the corresponding eigenvector υ(p) of the strain at interpixel locations , m = 1…M − 1 and n = 1…N − 1. Should the minimum eigenvalue over the whole image, λmin = minp∈ΩP(λ(p)) be less than the strain threshold τ, p and the corresponding displacement uPI(p) are added to the lists ιp and ιd respectively. The data in these lists will be used to transfer the estimated tear to ΩI. From this point of maximum strain, the tear is propagated along the two directions, n and −n, normal to the direction of maximum strain υ to a new point p′. If λ(p′) < τ the lists ιp and ιd are updated and the next step will be in the corresponding new direction n′. When a point is reached where λ ≥ τ the tear tracking process stops.
If we expect negligible deformations around the tear due to brain shift (for instance when registering images taken after craniotomy with images acquired after resection/retraction) this estimation of the tear will be quite reliable. Whenever there is a considerable brainshift as well, the tear estimation is more likely to be stuck in a local minimum or diverge from the real tear. To add some robustness to the detection of the tear and to reduce the importance of choosing a suitable τ we incorporate some a-priori information in the retraction estimation. A line originating from the tumor center tc in the pre-operative image is fitted to the points in ιp weighted by the amount of strain (minimum eigenvalue) at this point. Assuming we have a model of the tumor in ΩP and may know the length of the retractor, the part of the line which is represented by the retractor can easily be estimated.
Because the tearing is calculated in ΩP, it is also necessary to estimate the tear in ΩI to enable calculations of UIP using the bijective demons algorithm. We estimate the corresponding tear in ΩI by fitting a line going through uPI(tc) + tc to the points ιp(k) + ιd(k), k = 1… K, where K denotes the number of points along the tear. The part of the lines which are estimated to be representing the retraction is embedded in the boundary map Φ and transferred into directional boundaries by applying Eqs. (8)-(9). The algorithm then proceeds by alternating between registering the images and estimating the tear.
Determining the Retracted Area
Once a tear has been detected and added as a diffusion boundary, discontinuities will occur in both UPI and UIP. As the residuals, rPI, in the bijective demons algorithm are computed in the pre-operative image domain, we will not see large residuals around the area of the tear (see Fig. 1). However, if the residual is computed in ΩI, large residuals will appear in the area where tissue has been retracted. A simple thresholding scheme provides a good approximation of the area of retraction in the intra operative image.
| (13) |
2.3 Modeling Resection
We wish to register a pre-operative image, P, with an intra-operative image, I, under the assumption that an area (volume in 3D) of tissue, ΩRP ⊂ ΩP is present in P but is missing in I. The corresponding resected area in I will be denoted by ΩRI ⊂ ΩI. One can make a few assumptions about the areas ΩRI and ΩRP : 1) we will in general have large intensity disagreements (I(x) − (P ○ UIP)(x)), x ∈ ΩRI in the area of resected tissue, 2) large image gradients, ∇I, will be present along ∂ΩRI, the boundary of the resected tissue, 3) there might be some smaller image gradients inside ΩRI due to blood or other fluids in the resected cavity, 4) image gradients in and around ΩRP can be substantial due to a contrast enhanced tumor. These assumptions lead to unwanted forces being generated in and around ΩRI and ΩRP which will most likely lead the algorithm to converge to an incorrect result. Large image intensity disagreements are expected to be present inside the resected area which enables us to capture this area using a level set approach evolving in the space of image intensity disagreements. We incorporate ΩRI and ΩRP as diffusion sinks in the bijective demons approach. The general idea is to alternate between performing the registration under the constraint of the diffusion sinks and approximating the area of resected tissue with a level set formulation.
Determining the Resected Area
We are interested in propagating a front η(t) ⊂ ΩI in time along its normal direction n until it embeds ΩRI. In the level set formulation [11] this is achieved by embedding the front, η, as a zero level set of a time varying higher dimensional function
| (14) |
where the function dist computes the signed distance d from x to the front η. If x is inside the front then d < 0 and if x is outside the front, d > 0. Let us define the label map
| (15) |
where labels all pixels within the front as 1 (resected) and all pixels outside the front as 0 (non-resected) at time t. We will denote the area where by . The level set function evolves according to the partial differential equation
| (16) |
On the right hand side we have two terms. The first term moves the front proportional to its curvature while the second term moves the front in the normal direction with a speed and direction determined by a. To maintain the property of ϕ being a distance function, it is necessary to reinitialize the levelset function using Eq. (14) at regular time intervals. We are interested in being the best possible approximation of the resected area, ΩRI, at every step of the algorithm. To achieve this we model the normal velocity of the front as
| (17) |
The middle term makes the interface expand fast where there is a large intensity disagreement, the exponential will effectively stop the propagation of the front at large gradients (such as at ∂ΩRI). Due to the exponential, the evolution of the front will stop right before reaching ∂ΩRI hence will consistently underestimate the real resection. We use as the estimate of ΩRI. After the levelset evolution converges for the first time we will most likely have . As the algorithm progresses, more and more of will find its corresponding area in the pre-operative image and result in a good image intensity agreement.
This requires the front to shrink in this area to relabel it as non-resected which is modeled by ρ. The first term becomes zero in the area of retraction where we want the front to contract. It is important to balance the magnitude of ρ versus the magnitude of the intensity difference term such that a large intensity disagreement results in a positive a, while a good agreement results in a negative a.
Registration Constrained by a Diffusion Sink
In the classical demons method, the computed forces are diffused over the whole image domain. Whenever unwanted or incorrect image forces occur due to for instance resection, they will be propagated throughout the image by the Gaussian filter which will result in an incorrect deformation field. To prevent the forces occurring on and within ∂ΩRI from being diffused into the non-resected areas we use an over-estimation of the resected area, , as a diffusion sink in the smoothing component of the registration.
Because of the dual nature of the bijective demons method, the label map also needs to be defined in ΩP:
| (18) |
The directional diffusion boundaries in both image domains are computed by Eqs. (10)-(11).
2.4 Algorithm
To capture large deformations and speed up the algorithm, the registration method was integrated in a 3-level multi-resolution pyramid with a subsampling factor of 2. Modeling of retraction and resection was only applied on the lowest level of the pyramid while the two higher levels were used to get a good initial non-rigid deformation field. The algorithm applied to the lowest level of the pyramid can be summarized as follows:
Initialize the levelset function with Eq. (14) and the initial front η(0).
-
while Σx(I(x) − P ○ UIP(x))2 > SSD Threshold do
end while
3 Results
In this section we present preliminary results from applying the algorithm on 2D image data. All images used to generate results had a resolution of 256×256 with pixel intensities in the interval [0, 1]. The level set parameters, b = 0.2, ρ = 0.1 and σ = 0.01, diffusion filter parameters, μ = 0.2, and η = 170 and strain threshold, τ = −0.4, were applied for all experiments.
3.1 Experiments on Synthetic Data
To facilitate quantitative evaluation of how the algorithm handles both resection and retraction an artificial data set with a known deformation field was generated. The deformation field UIP was generated by defining the displacements occurring on ∂ΩRI and ∂ΩTI, where ΩTI is the area of tearing in ΩI, and then applying the smoothing filter with diffusion boundaries preventing diffusion into ΩRI and ΩTI. A displacement of magnitude 4 in the direction of the retracted area was defined on ∂ΩTI while the displacement on ∂ΩRI was set to 3 in the direction normal to the boundary. In addition, a displacement of about 6 pixels due to brain shift was also simulated. Fig. 3 shows both the resulting dataset as well as the qualitative results of the registration. We computed the dice coefficient between the estimated labelmaps ΨP, ΨI and ΓI and the real labelmaps used to generate the synthetic dataset which resulted in the values 0.93, 0.94 and 0.91 respectively.
Fig. 3.

[a b c d; e f g]: The top row shows [a] the pre-operative image, [b] the synthetically deformed image and [c]- [d] the estimated x- and y-components of the deformation field. [e] shows the deformed pre-operative image (with the estimated ΨI and ΓI zeroed out), [f] the difference image in ΩI and [g] the pre-operative image with the estimated resected area highlighted.
3.2 Experiments on Clinical Data
The algorithm was also tested on a set of clinical T1 MRI data acquired from a neurosurgical procedure where retraction was necessary to perform the resection. First the pre-operative and intra-operative datasets were rigidly registered. Two corresponding slices were extracted along the retraction line and a manual skull stripping procedure was performed. The two slices can be seen in Fig. 4 together with the qualitative results which were achieved.
Fig. 4.

[a b c d; e f g]: In [a] we have pre-operative image, [b] the intra-operative image, [c]- [d] the estimated x- and y- components of the deformation field UIP, [e] the deformed pre-operative image P ○ UIP after masking out the estimated resected and retracted areas, [f] the difference image |I − P ○ UIP| after masking out the estimated retracted and resected areas and [g] the pre-operative image with the estimated resected area highlighted. From these qualitative results we can see that the algorithm provides fairly good estimates of both the retracted and resected areas.
4 Discussion
In this paper we have proposed a registration framework which can handle retraction and resection. The main contributions are the detection of tearing of the deformation field due to retraction, and detection of missing tissue due to resection as well as how to model these in the demons algorithm. We have shown the framework's applicability on both synthetic and clinical image data.
A few parameters need to be specified for the algorithm to work properly. Two parameters are exposed by the smoother, but none of them are directly data-dependent. The number of diffusion iterations mimics the standard deviation of the Gaussian filter applied in the traditional Demons method. To achieve more smoothing one needs to increase the number of diffusion iterations, or equivalently increase the standard deviation of the Gaussian smoothing filter. To achieve a stable solution of the diffusion equation the step length should be μ < 0.25. Both the detection of retraction and resection exposes data-dependent parameters. In the case of retraction, the algorithm is quite sensitive to the specific value of τ. If it is too low, no retraction line is detected but if it is set too high a too long retraction line is detected. However, with the inclusion of the a-priori information regarding the tumor center and the length of the retractor the algorithm is considerably less sensitive to the specific value of τ. In the specification of the normal velocity of the front for the level set formulation, one has to specify the parameter ρ. This parameter defines what intensity difference is acceptable and has to be balanced according to the magnitude of the intensity differences which can occur.
Our current implementation of the framework is limited to 2D, but we see no big obstacles in extending it to 3D. Because of the current dimensionality constraint we had to extract two corresponding slices from two 3D data sets to construct the clinical data. We acknowledge that there might be out of plane deformations which we have not accounted for in the slice extraction process.
Using a Matlab implementation and a Dual Core 2.16 GHz processor, about 20 min of computational time was required to run 100 iterations on each level. Solving the anisotropic diffusion equation is by far the slowest part of the algorithm, but considerable speedups can be achieved by parallelizing the computations by utilizing GPGPU methods or multi-core processors.
Acknowledgments
This work was supported by NIH grants U41RR019703 and P41RR13218.
References
- 1.Hartkens T, Hill DLG, Castellano-Smith AD, Hawkes DJ, Maurer CR, Martin AJ, Hall WA, Liu H, Truwit CL. Measurement and analysis of brain deformation during neurosurgery. IEEE Transactions on Medical Imaging. 2003;22(1):82–92. doi: 10.1109/TMI.2002.806596. [DOI] [PubMed] [Google Scholar]
- 2.Periaswamy S, Farid H. Medical image registration with partial data. Medical Image Analysis. 2006;10:452–464. doi: 10.1016/j.media.2005.03.006. [DOI] [PubMed] [Google Scholar]
- 3.Miga MI, Roberts DW, Kennedy FE, Platenik LA, Hartov A, Lunn KE, Paulsen KD. Modeling of retraction and resection for intraoperative updating of images. Neurosurgery. 2001;1(1):75–85. doi: 10.1097/00006123-200107000-00012. [DOI] [PubMed] [Google Scholar]
- 4.Thirion JP. Image matching as a diffusion process: an analogy with Maxwell's demons. Medical Image Analysis. 1998;2(3):243–260. doi: 10.1016/s1361-8415(98)80022-4. [DOI] [PubMed] [Google Scholar]
- 5.Hellier P, Barillot C, Corouge I, Gibaud B, Le Goualher G, Collins DL, Evans A, Malandain G, Ayache N, Christensen GE, Johnson HJ. Retrospective evaluation of intersubject brain registration. IEEE Trans Med Imaging. 2003;22(9):1120–1130. doi: 10.1109/TMI.2003.816961. [DOI] [PubMed] [Google Scholar]
- 6.Cachier P, Bardinet E, Dormont D, Pennec X, Ayache N. Iconic feature based nonrigid registration: the pasha algorithm. Comput Vis Image Underst. 2003;89(2-3):272–298. [Google Scholar]
- 7.Perona P, Malik J. Scale-space and edge detection using anisotropic diffusion. IEEE Trans Pattern Anal Mach Intell. 1990;12(7):629–639. [Google Scholar]
- 8.Alvarez L, Deriche R, Papadopoulo T, Sánchez J. Symmetrical dense optical flow estimation with occlusions detection. Int J Comput Vision. 2007;75(3):371–385. [Google Scholar]
- 9.Noblet V, Heinrich C, Heitz F, Armspach JP. 3-D deformable image registration: a topology preservation scheme based on hierarchical deformation models and interval analysis optimization. IEEE Transactions on Image Processing. 2005;14(5):553–566. doi: 10.1109/tip.2005.846026. [DOI] [PubMed] [Google Scholar]
- 10.Müller M, McMillan L, Dorsey J, Jagnow R. Proceedings of the Eurographic workshop on Computer animation and simulation. Springer; New York: 2001. Real-time simulation of deformation and fracture of stiff materials; pp. 113–124. [Google Scholar]
- 11.Osher SJ, Fedkiw RP. Level Set Methods and Dynamic Implicit Surfaces. Springer; Heidelberg: 2002. [Google Scholar]


