Next Article in Journal
Anti-Bedsore Heel Disc for Nasotracheal Tube Stabilization during Mandibular Asymmetry Surgery and Stable Bone Osteosynthesis—Surgeon and Anesthesiologist Surgical Comfort
Previous Article in Journal
Using Aspect-Level Sentiments for Calling App Recommendation with Hybrid Deep-Learning Models
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:

Contour Propagation for Radiotherapy Treatment Planning Using Nonrigid Registration and Parameter Optimization: Case Studies in Liver and Breast Cancer

Mathematics and Applications Research Group, Universidad EAFIT, Medellin 050022, Colombia
Mathematical Modeling Research Group, Universidad EAFIT, Medellin 050022, Colombia
Department of Radiation Therapy, Clínica El Rosario, Medellin 050012, Colombia
Research Group Radiotherapy Optimization, German Cancer Research Center, 69120 Heidelberg, Germany
Author to whom correspondence should be addressed.
Appl. Sci. 2022, 12(17), 8523;
Submission received: 25 June 2022 / Revised: 23 July 2022 / Accepted: 25 July 2022 / Published: 26 August 2022


Radiotherapy treatments are carried out using computerized axial tomography. In radiation therapy planning, the radiation oncologist must do a manual segmentation of volumes of interest to delineate the organs that should be irradiated. This way of carrying out the process generates long execution times and introduces a subjective component. In this study, a contour-propagation algorithm is formulated to automate the segmentation, based on elastic registration or nonrigid demon registration. A heuristic algorithm to find the parameters that optimize the registration is also proposed. The parameters found along with the contour-propagation algorithm are able to estimate contours of scans with Dice similarity coefficients (DSC) greater than 0.92 and maintain stability with B-spline registration, which takes in the parameters found as input. The study allows for validating the results using the correlation coefficient (CC) to compare the similarity between the voxels’ gray-scale intensity of the estimated tomography and the original tomography, obtaining values greater than 0.96 . These values were validated under medical criteria and applied to liver and breast CT scans, indicating good performance for radiation therapy planning.

1. Introduction

Computerized tomography (CT) is a diagnostic imaging modality used for radiotherapy treatment planning. During this process, the radiation oncologist manually defines each organ that will be taken into account in later phases, as well as the region to be irradiated. The delineation of the volume of interest (VOI) is known as segmentation. This is done by defining the contour of each VOI in each tomographic scan. The task, when executed manually, requires long execution times. It is estimated that high-quality service requires: one radiation oncologist for every 250 new patients a year, one medical physicist for every 400 new patients a year, two technologists for every 25 patients treated per unit of treatment per day, and two technologists for the initial phases of treatment planning (simulation) for every 500 new patients per year. On the other hand, there is a considerable subjective component in defining these volumes. Automatization of radiotherapy treatment planning allows not only an increase in efficiency of the procedure but also a possible reduction of error associated with poor contouring. Currently, there are two promising proposals for automated contouring. The first is based on a multi-class classification perspective, where newer versions use convolutional neural networks. The second uses nonrigid registration algorithms as its main tool. Under this last perspective, the user has a library of contoured patients which are used to establish a bijective transformation between the images, which can also be used to transform the contours.
Among the nonrigid registration methods we have, on one hand, registrations based on image characteristics such as lines, curves, or points, in which the transformation is based on spline [1] with the characteristics as a basis, making it very efficient in magnetic resonance imaging (MRI) [2,3] or in case studies with multimodal imaging [4]. Because the method is based on characteristics, the set of parameters that determine the transformation is a problem to be addressed, for example, with heuristic algorithms based on decision trees [5] for algorithm learning (aprendizaje del algoritmo). In CT, we look for the parameters for B-spline registration, by applying mutual information (información mutua) to heart scans [6].
On the other hand, the nonrigid registration based on intensities assumes that these parameters are constant even though their position changes with changes in the organ’s shape in the image, caused by the patient’s involuntary movement [7]. Given these conditions, this type of registration allows for describing the displacements with a displacement vector field (DVF), which describes the image deformation and tracks the propagation of the organ contours in each sequence [8].
To date, due to the diversity in the images recorded and the differences in intensity, there are no studies that determine a common method for organ contour-propagation, for example, CT scans of the breast. Each registration method must consider the type of geometric deformation between the images as well as the noise caused by the patient’s movements [9]. Furthermore, nonrigid registration cannot be generalized and the case studies have been based on Bayesian models [10].
In the search for a solution, the nonrigid registration becomes a differential approximation that includes (i) a similarity criterion, (ii) an iterative optimization process, and (iii) a smoothing process [11]; in addition, when it comes to registration between CT scans of the same area of the body it is assumed that the intensities are conserved in each sequence.
This is why the demon algorithm based on intensities is implemented in this work, which is a widely used monomodal registration process. This algorithm was proposed by Thirion [12] as a fluid diffusion process based on optical flow (OF) [13]. Then it was supplemented by showing that the transformation that models the deformation of the organs in the image is a bijective, differentiable function and a composition of DVF functions [14,15,16]. Finally, Vercauteren [17] proposed a demon-efficient algorithm. This latest version of the demon algorithm, before searching for the DVF, smoothes the image by applying a Gaussian kernel at different levels, forming a blurring pyramid that eliminates noise in the voxels’ intensity. Unlike the classic demon method, the updated domain is estimated at each iteration. The current transformation is measured by using a new rule that is updated between the exponential map of the updated domain and the previous estimate.
The transformation describes the DVF between a fixed CT scan and another moving or displaced CT scan. To analyze the efficiency of the implementation, a moving version of the CT scan is estimated from the DVF calculated with the new version of the demon algorithm, and its similarity with the original moving CT scan is measured using performance measures. However, each DVF depends on three parameters: the variance of the smoothed kernel, the number of pyramid levels in the blur, and the number of iterations to update the domain, which must be defined each time; these parameters, in particular, have not been documented for breast CT scans.
The goal of this work is to propose a contour-propagation algorithm based on demons and a heuristic algorithm based on local search, which finds the combinations of iterations, variance, and number of levels in the blur in the solution space that optimizes the performance measures: the correlation coefficient (CC) and the Dice similarity coefficients (DSC). Additionally, to show the linear relationship of the CC and DSC results. These algorithms contribute to calculating the optimal dose of radiotherapy for patients with cancer, given that a good contour avoids putting healthy organs at risk and optimizes the efficiency of the dose beam.
Elastic image registration is especially challenging for volumes of interest that are large and subject to large nonrigid deformations over time. Good examples of such structures are the liver and the breast. Depending on the case, such structures might be considered to be organs at risk (that is, they are not the volumes to be treated but the dose should be calculated and minimized in such structures) or they might be considered target volumes to be treated. In any case an accurate registration is a prerequisite for an adequate radiation dose calculation. For this reason both the liver and breast are important organs in any radiotherapy treatment performed in the thoracic region.
The paper is organized as follows: Section 2 describes the demon method and presents the respective parameters. Section 3 presents the results and analysis. Finally, the conclusions are presented in Section 4.

2. Methodology

This section introduces the image registration technique that will be used in this work. First as an optimization process with its respective objective function. Then the nonrigid registration is presented using the demon algorithm and how it optimizes on a space of nonparametric diffeomorphisms of Lie groups. Finally, a free-form registration deformation based on B-spline is presented, which presents an objective function where the regularization term is a combination of norms 1 and 2 to solve the discontinuity problem in nonrigid registration. This last registration is shown in order to present a comparison and therefore be able to measure the performance of the contour-propagation algorithm formulated in this work.

2.1. Image Registration

Given a fixed image I F and a moving image I M in a D-dimensional space, image registration is a problem that aims to find the spatial transformation T : I F I M that aligns the images I F and I M , where p T ( p ) assigns points from the image p I F to T ( p ) I M . The objective is to optimize similarity criteria S i m ( I F , I M T ) that measures the quality of the transformation. This registration process is shown in Figure 1, where T * = arg max T S i m ( I F , I M T ) .
The authors in [11] consider S i m ( I F , I M T ) based on the mean squared error (MSE), which can be calculated using Equation (1):
S i m ( I F , I M T ) = 1 2 · | I F I M T | 2 = 1 2 · | Ω p | p Ω p I F ( p ) I M ( T ( p ) ) 2
where Ω p is the overlap region between I F and I M T . To do the registration of fixed and moving images, Equation (1) needs to be optimized in a space given the spatial transformations. Given that the registration is unimodal, that is, from CT scan to CT scan, the deformation is the voxel displacement in the different scenarios. The model is given by T : p p + u ( p ) , where u is the DVF that is added to the identity transformation to obtain a nonparametric transformation [14]. Note that the goal is to find the u that describes the contour propagation in each of the scenarios. The DVF u is a 4-D vector structure for 3-D images since it includes the position of the gray-level intensity in the transformed image [18].

2.2. Demon Algorithm

The demon algorithm proposed by Thirion [12] is implemented. The method considers two images as a semipermeable membrane to the edges of the objects in one of the images; the other image is considered as a deformable grid model that can diffuse across the interfaces through effectors, which are located within the membranes. These effectors are known as demons. The forces are inspired by the OF equations [13,19] and the method toggles between the computation of the forces and the regularization with a simple Gaussian smoothing. This results in a computationally efficient algorithm.
One of the main limitations of the demon algorithm is that it does not guarantee the invertibility of the transformations, contrary to diffeomorphic image registration algorithms. The diffeomorphism conserves the object’s topology in the image and avoids introducing foldings that are often physically impossible [17]. Therefore, the proposal based on conservation of energy [20,21] adds a regularization term R e g ( T ) to Equation (1) and we obtain
E ( T ) = 1 σ i 2 · S i m ( I F , I M T ) + 1 σ T 2 · R e g ( T )
where σ i measures the image noise caused by the intensities in the image and σ T controls for the necessary regularization. In order to convert the demon algorithm into a well-posed minimization criterion [21] proposed, using Equation (2), a minimization of energy of a nonparametric spatial transformation C as an auxiliary variable and assuming a Gaussian distribution for the image intensity. Taking d i s t ( T , C ) = C T and R e g ( T ) = T 2 , and  σ x as the spatial uncertainty of the correspondences, the expression to minimize is:
E ( C , T ) = 1 σ i · ( I F I M C ) 2 + 1 σ x 2 · d i s t ( T , C ) 2 + 1 σ T 2 · R e g ( T )
Diffeomorphisms are considered a good framework when there is no additional information about the spatial transformation available because they can be composed and inverted without problems. The easiest way to adapt the demon algorithm to make it diffeomorphic is to optimize the global energy equation (Equation (3)) over a diffeomorphism space instead of the complete nonparametric spatial transformation space. Therefore, an optimization procedure on a Lie group is required [22,23].
The first step is to remember that any Lie group can be associated with a Lie algebra g whose underlying vector space is the tangent space G of the neutral element I d , which is nothing more than the identity transformation. This Lie algebra captures the local structure of G . The Lie group and Lie algebra are related through the exponential group, which is a smooth map from a neighborhood of 0 g to a neighborhood of I d G . Canonical coordinates provide local coordinate graphs for any x G in some neighborhood of T, so there exists a vector u such that x = T e x p ( u ) . It has been shown that Newton’s methods have been used to optimize Lie group problems [14]. The central idea of this method is to find, from the current transformation T, an update of u over the Lie algebra, based on the expansion of the cost function (3) and update the Lie group with the exponential function T T e x p ( u ) . In the classic demon algorithm, u is a dense displacement field, and therefore, an optimal transformation is obtained which preserves the morphology of the image and displays the displacement field u , which describes the position and velocity in the I M scenario.
The algorithm smoothes the image by applying a Gaussian filter, assuming three parameters: ρ is the number of levels in the smoothing pyramid, which is used to reduce the resolution of the image and locally reduce noise [18] and N is the number of iterations in the first level of the pyramid. For the following levels these iterations are reduced by a factor of 1 2 m , where m = 0 , 1 , , ρ 1 . Finally, σ is the smoothing level for the Gaussian distribution.

2.3. Algorithm Based on B-Spline

An alternative model is the free form deformation (FFD) based on B-spline, defined as a mapping from R 3 to R 3 of a tensor product of Bernstein polynomials with three variables [24]. The basic idea of FFDs is to deform an object by manipulating an underlying mesh of control points as seen in Figure 2. The resulting deformation controls the object’s shape and produces a smooth and continuous C 2 transformation [25,26].
To define a FFD based on B-spline, we denote the domain of the volume image as Ω = { ( x , y , z ) | 0 x < X , 0 y < Y , 0 z < Z } . Let Φ denote the mesh n x × n y × n z of control points ϕ i , j , k with uniform spacing δ .
Then the FFD can be written as a 3-D tensor product of the 1-D family of cubic B-splines
T ( x , y , z ) = l = 0 3 m = 0 3 n = 0 3 B l ( u ) · B m ( v ) · B n ( w ) · ϕ i + l , j + m , k + n
where i = x n x 1 , j = y n y 1 , z = z n z 1 , u = x n x x n x , v = y n y y n y , w = z n z z n z and where B l , B m , and B n represent the basis functions for the B-spline for parameters u, v and w [3], as shown in one of the cases below
B 0 ( u ) = ( 1 u ) 3 6 B 1 ( u ) = 3 · u 3 6 · u 2 + 4 6 B 2 ( u ) = 3 · u 3 + 3 · u 2 + 3 · u + 1 6 B 3 ( u ) = u 3 6
Vishnevsky [27] makes an interesting FFD proposal where a set of control points in the fixed image and moving image are established. Their respective deformation describes the displacements of these points and constructs a DVF d . The goal is to find a measure of the total variation for the regularization term in the objective function [27].
In effect, given the images I F and I M , the displacement vectors of the control points are described as d = { d 1 , , d N } for a N-dimensional voxel and their gradient is described as d = { d 1 , , d N } . The initial model is to find d * such that
d * = arg min d E D ( d ; I F , I M ) + λ E R ( d )
where E D corresponds to the similarity measure and E R to the regularization term. The central idea is to propose a term that estimates the transformation d * .
The most used regularization term is based on the 2 norm and is the smooth regularization model described as [3]:
E R sm ( d ) = v · n N d n 2 2
where v is the volume of the voxel. This norm allows any continuous optimization method to minimize (5), given that it is smooth and allows for analytical differentiation with respect to the transformation parameters.
On the other hand, we propose how to solve the discontinuity problem for elastic registrations. Starting off with the anisotropic total variation regularization, based on the norm 1 given by
E R aTV ( d ) = v · n N d n 1
we build a total variation regularization term based on (6) and (7) for the l control points:
E R TV ( d ) = v · l L i , j N ( i d j ( l ) ) 2 = v · D ( d ) 2 , 1
for the DVF given by D ( d ) = [ 1 d 1 2 d 1 1 d 2 N d N ] . It can be observed that the regularization is imposed at the displacements in the grid with control points k and therefore the objective function is expressed as
k * = arg min k E D ( d ( k ) ; I F , I M ) + λ η D ( k ) 2 , 1
where η is the volume of the control point’s grid cell. Then it can be seen that the regularization parameters are controlled by both the experimental value λ and by the number of voxels in a grid cell.

2.4. Performance Measures

The performance measures proposed below are intended to measure the similarity between CTs with their contours originally done by medical professionals and those estimated with the contour-propagation algorithm. To measure the segmentation or contour, the commonly used Dice coefficient is presented. Regarding the measurement of the intensities, it is proposed to use the correlation coefficient, which provides a scale between 0 and 1 to better understand the similarity of the tomography scan.

2.4.1. Dice Coefficient

The Dice coefficient is a quantitative evaluation that measures the intersection between pairs of segmentations, as well as the performance of contour-propagation algorithms. This is a measure of similarity that varies between zero and one such that the closer the coefficient is to one, the greater the overlap of the images.
D I C E ( A , B ) = 2 · | A B | | A | + | B |
where | A | and | B | are the cardinality of the sets | A | and | B | respectively, while | A B | is the cardinality of the intersection between the sets.
Since this coefficient counts the overlap of voxels that coincide between two images, it is necessary to segment the structures as shown in Figure 3 (see Figure 3b,d). By establishing a binary image of the structures, Equation (10) becomes a good performance measure to analyze the quality of the contours that propagate through the different scenarios.

2.4.2. Correlation Coefficient (CC)

The correlation coefficient quantitatively evaluates the similarity between the intensities of two CTs, A and B. Unlike the mean squared error, the values range from 0 to 1 and this allows us to analyze the value of similarity between the original scans and the estimated scans. The correlation coefficient can be expressed as:
S c o r r ( A , B ) = ( A A ¯ ) · ( B B ¯ ) ( A A ¯ ) 2 · ( B B ¯ ) 2
where A ¯ and B ¯ correspond to the mean gray-level intensity in images A and B, respectively. A slightly less strict assumption would be that there exists a linear relationship between the intensity values in the registration. In this case, the optimal similarity measure is the correlation coefficient.

2.5. Data Structure and Preprocessing

The procedures and algorithms were implemented in MATLAB R2018b. The demos-based registration was implemented using the Image Processing Toolbox function called imregdemons. The computational experiments were done using a PC with 16.0 GB of RAM, a 64-bit Windows 10 operating system, and a 2.90 GHz processor. To validate the medical results, matRad was used. It is an open source cancer treatment planning toolkit which includes tools for radiation treatment planning of three-dimensional intensity-modulated radiation therapy [28] and is available on its public GitHub repository (, accessed on 24 June 2022).
Two sets of images were used for the analysis. The first set is of 10 CT scans of the abdominal area (which will be referred to as scenarios from now on), each scan with a dimension of 256 × 256 × 130 corresponding to a patient with liver cancer. To check the accuracy of the contours obtained, we use segmentation data of the skin, liver, and clinical treatment volume (CTV), which will be called structures from now on. The second data set consists of five 3-D breast CT scans of one patient, each image stored at a 512 × 512 × 65 resolution. The following volumes were contoured: skin, right lung, left lung, heart, contralateral sinus, and CTV. This resolution results from preprocessing the original images as described below.

Breast CT Acquisition in 4-D Format

Since the five CT scans belong to the same patient, we construct an extension of scans that simulate the 4-D format for the five series, where the dimensions of the five scenarios are 256 × 256 × 65 . Scenarios 1, 2, 4, and 5 are composed of 75 slices, while Scenario 3 was taken with 10 fewer slices. This implies that the dimensions per voxel in Scenario 3 are different compared to the other scenarios. Now, the demon algorithm is an iterative process where the objective function is a similarity measure. When comparing intensities, the columns of the voxels will not match between Scenario 1, the fixed scenario, and Scenario 3. This generates erroneous displacement vectors and in order to avoid this, the first ten remaining slices of scans 1, 2, 4, and 5 are removed so the five scenarios are equally resized and have the same voxel size. With this, the resolution per voxel is expected to be 1.5226 × 1.5226 × 3.
To do this, we start with the loading of the first scenario with its respective contours, CT 1 . Then, we attach the remaining scan volumes, CT 2 , CT 3 , CT 4 , and CT 5 , to the resulting array. Finally, the dicom information and the corresponding metadata from CT 2 to CT 5 are attached.
Once the CT is obtained in 4-D format with five scenarios and six segmented structures in Scenario 1, which will be the fixed scenario, stored as segmented computed tomography (SCT), each structure in the SCTs is a set of linear positions that have their equivalent positions x, y, z in the cube, as seen in Figure 4.
These images, processed in 4-D format, are used later for the contour-propagation algorithm, which allows for its implementation in matRad, given they have the CT and SCT instances.

3. Results and Discussion of Computational Experiments

This section presents the results according to the proposed methodology, as well as their respective analyses. Initially, a heuristic algorithm is formulated to find the parameters that calculate the best DVF, where the objective function is the correlation coefficient given by Equation (11). Then, the results are analyzed with medical criteria, considering shorter time and maximum correlation. Finally, the contour-propagation algorithm based on demon and B-spline registration is presented, showing stability and the contours with the chosen parameters.

3.1. Parametrization of the Demons Algorithm

In order to obtain a set of adequate values for the three parameters of the demon algorithm (see Section 2.2), a heuristic algorithm based on local search is proposed. This algorithm explores multiple values in each parameter’s domain and evaluates the algorithm’s performance in terms of the similarity coefficients.
The local search algorithm is an iterative neighborhood search process. This approach improves the current solution by searching through your environment or neighborhood. Starting with an initial solution, a set of solutions is explored in the environment and the solution is updated if a better one is found. Each implementation of the local search process may differ depending on what is defined as the environment, which determines which solutions are attainable, and which solution is accepted and used to update the current solution. The procedure stops when it fails to improve the solution with the search in the current solution’s environment. The current solution in the last iteration of local search is called the local optimal solution. It is important to highlight that the local search process does not guarantee a global optimal solution, given that sections of the feasible region may remain unexplored.
In our implementation, the algorithm starts with initial values for each parameter: ρ 0 = 200 , N 0 = 3 , and σ 0 = 2.5. These values are used because initial experiments showed good similarity. The performance evaluation of the solution refers to the highest correlation coefficient obtained in each of the scenarios. It is important to remember that each CT set includes multiple scenarios. Assuming the first scenario as a fixed image, we have a set of moving images (for example, nine moving images for the liver case study). Thus, nine correlation coefficients are obtained, one for each moving image. Then, in order to obtain robust solutions, the highest correlation coefficient obtained in all the scenarios is taken as a measure of performance, so that in the worst case the performance is maximized.
The neighborhood of a solution is defined by the solutions obtained after increasing or decreasing the value of δ in each variable (a demon algorithm parameter), individually. The values of δ depend on the domain of each parameter; thus, the domain for the number of levels in the smoothing pyramid is ρ { 1 , 2 , 3 , 4 } and δ ρ = 1 , the domain for the number of iterations in the first level of the pyramid is N { 100 , 200 , 300 , 400 , 500 } and δ N = 100 , and the domain for the smoothing level for the Gaussian distribution is σ { 0.5, 0.6, …, 2.9, 3.0} and δ σ = 0.1. When a search in the neighborhood of a current solution generates solutions outside the domain of the parameter values, these solutions are discarded (not evaluated). Additionally, due to the linear complexity of the demon algorithm [12,29], each time a solution is explored, its performance is stored in memory. That way, if a search in the environment of a current solution generates already explored solutions, it is not necessary to repeat its evaluation and therefore speeds up the search process.
Table 1 presents a comparison between the initial solution and the local optimal solution obtained with the search process. The first column indicates each of the scenarios for liver CT scans, the second column indicates the correlation coefficient obtained with the initial parameters, and the third column indicates the correlation coefficient obtained with the local optimal parameters using local search. Scenario 1 is used as a control value because it corresponds to the fixed image and therefore its correlation coefficient must always be equal to one. An important result to highlight is that the obtained correlation coefficients are all better than the initial ones for all of the scenarios.
The values in bold identify the scenarios with the lowest correlation coefficients, which represent the level of performance of each solution. The lowest coefficient obtained with the local optimal parameters (Scenario 5) is greater than almost all of the coefficients in the initial solutions (7 out of 10 scenarios), except from Scenarios 1, 7, and 9. Additionally, for different parameter values, the scenario with the lowest correlation coefficient may vary. However, for the example shown in Table 1, Scenario 5 and 6 obtained the lowest correlation coefficients in both solutions.
The improved solution implies an improvement of 0.015 (1.6%) with respect to the initial solution, which is significant for radiotherapy and image analysis. This improvement can be voxels that represent tissue and therefore help make more precise contours of the organs in each scenario, reducing uncertainty in radiation therapy planning, i.e., calculation of delivered dose.
When comparing the default parameters provided by Matlab, we see that our observed values generate a better correlation coefficient. Figure 5, with CT scans of patients with liver cancer, shows how significant it is to search for the parameters that best fit the characteristics of the image by maximizing their similarity, in this case the correlation coefficient.
Now, given that each scenario shows a different form of the same organ, and the initial results show that the correlation coefficients not only depend on the three demon parameters but also on the considered scenario, the nonrigid registration can be used to estimate different DVFs in each scenario with different parameter values. Therefore, the local search process is adapted to find a parameter set for each scenario and compare the correlation coefficients and computation time with respect to the previously found parameters.
Two main characteristics were taken into account for the adaptation of the Fh algorithm in order to find the appropriate parameters for each scenario. First, the algorithm runs independently for each scenario, therefore it is not necessary to identify the scenario with the lowest correlation coefficient. The second adaptation is related to the computation time of the demon algorithm. In particular, this computation time depends on the chosen parameters. Taking this into account, a set of parameters that allow obtaining a faster solution may be preferable if the difference between the correlation coefficients is very small.
Due to the need of establishing a minimal difference between correlation coefficients that merits a given increase in computing time, professional medical judgment is introduced to determine the following analysis. Figure 6 shows the efficient frontiers (correlation coefficients on the horizontal axis and computation time on the vertical axis) where each point represents a determined combination of parameter values for demons. The same scales are used for the different plots per scenario in order to facilitate comparison and analysis. According to Figure 6, as we obtain better (higher) correlation coefficients, a greater computation time is required for executing the demon algorithm. In cases such as Scenarios 5, 6, 8, and 9, the maximum S c o r r have a very high demand in computing time (more than 400 s). Additionally, the maximum CC for the 9 scenarios is reached in the interval [0.965, 0.97], which coincides with the highest computation times. A similarity value of 0.9600 is considered good enough in terms of the quality of the registrations and this is obtained in reasonable times in all the scenarios.
Now, according to the solutions obtained in each scenario, the set of points with S c o r r 0.9600 form discrete sets of solutions that allow for analyzing the solutions, obtaining a balance between the criterion for minimizing the registration time, and maximizing the correlation coefficient. Therefore, if we denote T m a x and S m a x c o r r as the maximum computing time and the maximum correlation coefficient, respectively, obtained in each scenario, using the data shown in Figure 6, then we can establish the following intervals: T m i n t T m a x and S m i n c o r r S c o r r S m a x c o r r , S m i n c o r r is 0.9600 or the lowest correlation coefficient greater than 0.9600 and T m i n is the corresponding registration time.
Table 2 records the proportional increases in computing time (time increase ratio) calculated as T m a x T m i n T m i n , the length of the correlation coefficient interval (CC interval length) calculated as S m a x c o r r S m i n c o r r , and center value in the correlation coefficient interval (center of the CC interval). These values indicate how much the computation time should be increased for a given increase in the correlation coefficient, using the demon algorithm. For example, in Scenario 2, to increase the correlation coefficient by 0.0061units then the recommendation would be to use a set of parameters ρ , N, and σ that require 3.5455 times longer. Scenario 4 requires the least time increase, requiring 52% times longer for an increase of 0.0050 (0.52%) units in the correlation coefficient. On the other extreme, Scenario 8 presents a potential increase of 0.83 units in the correlation coefficient (0.86%) and requires 24.24 times more time. The scenario that presents the highest rate of increase in the correlation coefficient with computation time is Scenario 7, where an increase of 70% in computation time generates an increase of 0.69% in the correlation coefficient. The above data corroborates that, although it is possible to improve the quality of the propagated contours using the demon algorithm, correlation coefficients around are good enough in relation to the computational effort. Figure 7 shows the impact and correlation coefficients with a difference of 0.0085 for Scenario 6.
Table 3 presents the parameter values for ρ , N, and σ found with the local search algorithm for each of the breast CT scenarios. Very stable results are obtained for parameters corresponding to the number of levels in the smoothing pyramid ρ and the number of iterations in the first level of the pyramid N, which are ρ = 1 and N = 100 . However, for the parameters corresponding to the smoothing level for the Gaussian distribution σ , the values differ significantly, varying between 1.5 and 2.9.
As expected, individually optimizing the parameters for each scenario using local search offers greater freedom and flexibility to find better solutions, that is, better performance with the demon algorithm. However, it is also important to highlight that given the proximity between the parameters found, the solutions for the different scenarios can be considered as neighboring solutions, which can have a positive impact on the neighborhood search in the local search algorithm.

3.2. Contour-Propagation Algorithm

Once a set of candidate parameters has been obtained to reach a DVF with an adequate registration, we propose to include Algorithm 1 in the matRad toolkit so that it reads the CT and SCT structures and estimates the contours of the organs in each scenario in such a way that it reduces the uncertainty in the dose calculation.
For experimentation with the proposed algorithm, breast CT scans are taken in 4-D format and the contour propagation of the six structures is estimated. It is assumed that Scenario 1 is the fixed image while the other scenarios are objective. The scenarios correspond to five gray-scale cubes of the thoracic area and each scenario corresponds to an SCT with the six segmented structures. In the implementation, the algorithm assumes that there is only segmentation in Scenario 1 and the goal is to estimate the structures in the other scenarios from the registration.
Algorithm 1: matRad-contourPropagation
Input: CT scans for the n scenarios and SCT for the fixed scenario.
Output: CT scans for the n scenarios and SCT for the m structures.
for scenario i = { 1 , 2 , , n } do
  Calculate DVF u i
end for
for structure j = { 1 , 2 , , m } do
  Convert linear indices of SCT structure j for Scenario 1 into a cube ( x × y × z )
for scenario i = { 2 , , n } do
   Apply u i to the structure j for scenario 1 to estimate structure j for scenario i
   Convert the cube of structure j for Scenario i into linear indices
   Store the structure j in the SCT for Scenario i
end for
end for
Note that the algorithm calculates the contours of the structures in the different scenarios, regardless of the registration method you choose. This allows us to find the DVF with both demon registration and B-spline, using the same parameters for both methods. Figure 8 shows the steps in which each one of the registrations intervenes and the dependence that transformation T * has on the parameters found with the heuristic algorithm. The optimizer in the demons case is Equation (3) while for B-spline it is Equation (5) where the regularization term is Equation (8). The parameter ρ controls the amount of scaling to which the image is subjected to by its respective Gaussian filter, which allows for a noise reduction and thus obtains contours with minimal uncertainty.
Therefore, Algorithm 1 is executed with both registrations and its performance is measured with the Dice coefficient, obtaining the results shown in Figure 9.
With the demon-based Algorithm 1, the similarity value satisfies D I C E ( A , B ) 0.92, for each of the six structures (skin, right lung, left lung, contralateral sinus, CTV, and heart) in the five scenarios with breast CT scans. On the other hand, as explained in the methodology section, the similarity obtained with the B-spline-based algorithm allows one to calculate the DVF in terms of control points, which are the ones that ultimately generate the deformation in the B-spline registration. Additionally, it allows one to control the parameters ρ , σ , and N, which are part of the input values. If the experimentation is carried out with the default values for the distances between control points, and the parameters for level of smoothing, the number of iterations and number of pyramid levels are modified according to Table 3, then the values of Figure 9 are obtained. From here we see that the lowest Dice value is obtained in the CTV structure in Scenario 5, with the B-spline Dice equal to 0.8312, while the demon Dice is equal to 0.9227.
A qualitative evaluation of the contour was previously performed in a similar study in which the propagated contours were rated as clinically acceptable, requiring minor editing. Although different deformable image registration algorithms were used, the contours of the structures were manually done by the professional medical oncologist, which allows Equation (10) to work and measure the similarity and quality of the structures’ registration.
Figure 10 allows for a visual comparison between the structures contoured by a professional medical oncologist (Figure 10a–d at the top) and the ones estimated by the demon algorithm (Figure 10e–h at the bottom). The images are organized in such a way that the contours corresponding to Scenario 2 (in both modalities) are observed on the left. As we move to the right side, we see the results until Scenario 5. Observe that the differences are very small.

4. Conclusions

In this article, we present a contour-propagation algorithm and a local search heuristic algorithm for its parametrization.
The proposed contour-propagation algorithm proved to be useful for CT scans with the conditions used in this study: a 10-image CT set of the abdominal area of patients diagnosed with liver cancer and a 5-image CT set of a patient with breast cancer. The computational experiments managed to obtain satisfactory results. From a quantitative point of view, we found Dice coefficient values to be higher. On the other hand, from a qualitative point of view, the professional radiation oncologist verified the quality of the resulting contours, which required only minor modifications.
Additionally, two registration methods were compared, demon and B-spline, to test the stability of the contour-propagation algorithm as well as the parameters found. Based on the Dice coefficient, the demon-based registration performed better; the lowest coefficient found with B-spline was 0.8312, while the lowest with demons was 0.9227. Additionally, the average B-spline value was 0.9344 while the average value found with demons was 0.9550.
The quality of the results obtained by the demon algorithm depends directly on the parameters used: the number of levels in the smoothing pyramid ρ , the number of iterations in the first pyramid level N, and the level of smoothing for the Gaussian distribution σ . In order to use appropriate parameter values, two local search heuristic algorithms were used that improved the performance of the contour-propagation algorithm with searches in the parameter domain.
The first version of the algorithm allows one to find a set of parameters to be used in all CT scenarios. The parameters found with this algorithm showed superior performance in relation to the default parameters used by the Matlab tool and the parameters found through manual experimentation. The second version of the algorithm performs the search process separately for each scenario. This second search strategy, since it is more flexible, improves the results obtained by the first. Additionally, in the second algorithm, we performed an analysis of the relationship between the registration quality and the computation time of the demon algorithm. This allowed us to find solutions that offer a balance between quality and computational effort.

Author Contributions

Conceptualization, J.C.R., M.E.P. and G.C.; methodology, J.C.R., M.E.P. and G.C.; software, E.V.-B., J.C.R., N.W. and G.C.; validation, A.A. and G.C.; formal analysis, J.C.R., M.E.P. and G.C.; investigation, E.V.-B., J.C.R., M.E.P. and G.C.; resources, E.V.-B., G.C. and A.A.; data curation, G.C. and A.A.; writing—original draft preparation, E.V.-B. and J.C.R.; writing—review and editing, J.C.R., M.E.P. and G.C.; visualization, E.V.-B.; supervision, J.C.R., M.E.P. and G.C.; project administration, J.C.R., M.E.P. and G.C.; funding acquisition, M.E.P. and G.C. All authors have read and agreed to the published version of the manuscript.


This research was funded by the Ministry of Science, Technology and Innovation (MinCiencias) of Colombia, the El Rosario Clinic, and the EAFIT University, through the agreement with code: 121677757715, and the Federal Ministry of Education and Research from Germany through the CGCoMPRO project (BMBF, ref. No. 01DN17048).

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

Not applicable.


This work has been carried out within the framework of the project “Improvement of inverse planning for IMRT minimizing the impact of uncertainties associated with thoracic dynamics and positioning in patients with breast cancer” which has been financed by the Science and Technology program with Ministry of Science, Technology and Innovation (MinCiencias) of Colombia, the El Rosario Clinic, and the EAFIT University, through the agreement with code: 121677757715. Additionally, we would like to thank the financing granted by the Federal Ministry of Education and Research from Germany through the CGCoMPRO project (BMBF, ref. no. 01DN17048).

Conflicts of Interest

The authors declare no conflict of interest. The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript, or in the decision to publish the results.


The following abbreviations are used in this manuscript:
CCCorrelation coefficient
CTComputerized tomography
CTVClinical treatment volume
DCSDice similarity coefficient
DVFDisplacement vector field
FFDFree form deformation
MRIMagnetic resonance imaging
MSEMean squared error
OFOptical flow
SCTSegmented computed tomography
VOIVolume of interest


  1. Bookstein, F.L. Principal warps: Thin-plate splines and the decomposition of deformations. IEEE Trans. Pattern Anal. Mach. Intell. 1989, 11, 567–585. [Google Scholar] [CrossRef]
  2. Kumar, R.; Asmuth, J.C.; Hanna, K.; Bergen, J.R.; Hulka, C.; Kopans, D.B.; Weisskoff, R.; Moore, R.H. Application of 3D registration for detecting lesions in magnetic resonance breast scans. In Medical Imaging 1996: Image Processing; International Society for Optics and Photonics, SPIE: Newport Beach, CA, USA, 1996; Volume 2710, pp. 646–656. [Google Scholar] [CrossRef]
  3. Rueckert, D.; Sonoda, L.I.; Hayes, C.; Hill, D.L.G.; Leach, M.O.; Hawkes, D.J. Nonrigid registration using free-form deformations: Application to breast MR images. IEEE Trans. Med. Imaging. 1999, 18, 712–721. [Google Scholar] [CrossRef] [PubMed]
  4. Mattes, D.; Haynor, D.R.; Vesselle, H.; Lewellen, T.K.; Eubank, W. PET-CT image registration in the chest using free-form deformations. IEEE Trans. Med. Imaging 2003, 22, 120–128. [Google Scholar] [CrossRef] [PubMed]
  5. Du, S.; Liu, J.; Zhang, C.; Xu, M.; Xue, J. Accurate non-rigid registration based on heuristic tree for registering point sets with large deformation. Neurocomputing 2015, 168, 681–689. [Google Scholar] [CrossRef]
  6. Mai Elfarnawany, S.; Alam, R.; Agrawal, S.K.; Ladak, H.M. Evaluation of non-rigid registration parameters for atlas-based segmentation of CT images of human cochlea. In Medical Imaging 2017: Image Processing; Styner, M.A., Angelini, E.D., Eds.; International Society for Optics and Photonics, SPIE: Newport Beach, CA, USA, 2017; Volume 10133, pp. 283–289. [Google Scholar] [CrossRef]
  7. Santos, J.; Chaudhari, A.J.; Joshi, A.A.; Ferrero, A.; Yang, K.; Boone, J.M.; Badawi, R.D. Non-rigid registration of serial dedicated breast CT, longitudinal dedicated breast CT and PET/CT images using the diffeomorphic demons method. Phys. Medica 2014, 30, 713–717. [Google Scholar] [CrossRef] [PubMed]
  8. Mesbah, M. Gradient-based optical flow: A critical review. In Proceedings of the 5th International Symposium on Signal Processing and Its Applications, Brisbane, Australia, 22–25 August 1999; Volume 1, pp. 467–470. [Google Scholar] [CrossRef]
  9. Chakraborty, S.; Dey, N.; Samanta, S.; Ashour, A.S.; Barna, C.; Balas, M.M. Optimization of Non-rigid Demons Registration Using Cuckoo Search Algorithm. Cogn. Comput. 2017, 9, 817–826. [Google Scholar] [CrossRef]
  10. Folgoc, L.L.; Delingette, H.; Criminisi, A.; Ayache, N. Sparse Bayesian registration of medical images for self-tuning of parameters and spatially adaptive parametrization of displacements. Med. Image Anal. 2017, 36, 79–97. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  11. Wang, M.; Li, P. A Review of Deformation Models in Medical Image Registration. J. Med. Biol. Eng. 2019, 39, 1–17. [Google Scholar] [CrossRef]
  12. Thirion, J.P. Image matching as a diffusion process: An analogy with Maxwell’s demons. Med. Image Anal. 1998, 2, 243–260. [Google Scholar] [CrossRef]
  13. Horn, B.K.; Schunck, B.G. Determining Optical Flow. In Techniques and Applications of Image Understanding; Pearson, J.J., Ed.; International Society for Optics and Photonics, SPIE: Washington, DC, USA, 1981; Volume 0281, pp. 319–331. [Google Scholar] [CrossRef]
  14. Vercauteren, T.; Pennec, X.; Malis, E.; Perchant, A.; Ayache, N. Insight into Efficient Image Registration Techniques and the Demons Algorithm. In Information Processing in Medical Imaging; Karssemeijer, N., Lelieveldt, B., Eds.; Springer: Berlin/Heidelberg, Germany, 2007; pp. 495–506. [Google Scholar]
  15. Hernandez, M.; Bossa, M.N.; Olmos, S. Registration of anatomical images using geodesic paths of diffeomorphisms parameterized with stationary vector fields. In Proceedings of the 2007 IEEE 11th International Conference on Computer Vision, Rio De Janeiro, Brazil, 14–21 October 2007; pp. 1–8. [Google Scholar] [CrossRef]
  16. Ashburner, J. A fast diffeomorphic image registration algorithm. NeuroImage 2007, 38, 95–113. [Google Scholar] [CrossRef]
  17. Vercauteren, T.; Pennec, X.; Perchant, A.; Ayache, N. Diffeomorphic demons: Efficient non-parametric image registration. NeuroImage 2009, 45, S61–S72. [Google Scholar] [CrossRef]
  18. Jähne, B. Displacement Vector Fields. In Digital Image Processing: Concepts, Algorithms, and Scientific Applications; Springer: Berlin/Heidelberg, Germany, 1993; pp. 297–317. [Google Scholar] [CrossRef]
  19. Barron, J.L.; Fleet, D.J.; Beauchemin, S.S. Performance of optical flow techniques. Int. J. Comput. Vis. 1994, 12, 43–77. [Google Scholar] [CrossRef]
  20. Hermosillo, G.; Chefd’Hotel, C.; Faugeras, O. Variational Methods for Multimodal Image Matching. Int. J. Comput. Vis. 2002, 50, 329–343. [Google Scholar] [CrossRef]
  21. Cachier, P.; Bardinet, E.; Dormont, D.; Pennec, X.; Ayache, N. Iconic feature based nonrigid registration: The PASHA algorithm. Comput. Vis. Image Underst. 2003, 89, 272–298. [Google Scholar] [CrossRef]
  22. Benhimane, S.; Malis, E. Real-time image-based tracking of planes using efficient second-order minimization. In Proceedings of the 2004 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), Sendai, Japan, 28 September–2 October 2004; Volume 1, pp. 943–948. [Google Scholar] [CrossRef]
  23. Mahony, R.; Manton, J.H. The Geometry of the Newton Method on Non-Compact Lie Groups. J. Glob. Optim. 2002, 23, 309–327. [Google Scholar] [CrossRef]
  24. Bardinet, E.; Cohen, L.D.; Ayache, N. Tracking and motion analysis of the left ventricle with deformable superquadrics. Med. Image Anal. 1996, 1, 129–149. [Google Scholar] [CrossRef]
  25. Lee, S.; Wolberg, G.; Shin, S.Y. Scattered data interpolation with multilevel B-splines. IEEE Trans. Vis. Comput. Graph. 1997, 3, 228–244. [Google Scholar] [CrossRef]
  26. Lee, S.; Wolberg, G.; Chwa, K.; Shin, S.Y. Image metamorphosis with scattered feature constraints. IEEE Trans. Vis. Comput. Graph. 1996, 2, 337–354. [Google Scholar] [CrossRef]
  27. Vishnevskiy, V.; Gass, T.; Szekely, G.; Tanner, C.; Goksel, O. Isotropic Total Variation Regularization of Displacements in Parametric Image Registration. IEEE Trans. Med. Imaging 2017, 36, 385–395. [Google Scholar] [CrossRef] [PubMed]
  28. Wieser, H.P.; Cisternas, E.; Wahl, N.; Ulrich, S.; Stadler, A.; Mescher, H.; Müller, L.R.; Klinge, T.; Gabrys, H.; Burigo, L.; et al. Development of the open-source dose calculation and optimization toolkit matRad. Med. Phys. 2017, 44, 2556–2568. [Google Scholar] [CrossRef] [PubMed]
  29. Cahill, N.D.; Noble, J.A.; Hawkes, D.J. A Demons Algorithm for Image Registration with Locally Adaptive Regularization. In Medical Image Computing and Computer-Assisted Intervention—MICCAI 2009; Yang, G.Z., David, H., Daniel Rueckert, A.N., Taylor, C., Eds.; Springer: Berlin/Heidelberg, Germany, 2009; pp. 574–581. [Google Scholar]
Figure 1. Image registration process.
Figure 1. Image registration process.
Applsci 12 08523 g001
Figure 2. The images (ad) are the CT scans with their corresponding meshes of control points (intersection between lines) with the corresponding deformation.
Figure 2. The images (ad) are the CT scans with their corresponding meshes of control points (intersection between lines) with the corresponding deformation.
Applsci 12 08523 g002
Figure 3. Images (a,c) are CTs of contours of the heart for different time frames. By segmenting this structure, a binary image can be extracted, as seen in (b,d), and their similarity can be found using Equation (10).
Figure 3. Images (a,c) are CTs of contours of the heart for different time frames. By segmenting this structure, a binary image can be extracted, as seen in (b,d), and their similarity can be found using Equation (10).
Applsci 12 08523 g003
Figure 4. Converting linear indices 3, 4, 5, and 6 to subscripts of a 2 × 2 × 2 matrix. Source: MathWorks.
Figure 4. Converting linear indices 3, 4, 5, and 6 to subscripts of a 2 × 2 × 2 matrix. Source: MathWorks.
Applsci 12 08523 g004
Figure 5. Comparison between correlation coefficients of the initial parameters and the default parameters in Matlab. Default values are: N = 100 , ρ = 3 y σ = 1.0.
Figure 5. Comparison between correlation coefficients of the initial parameters and the default parameters in Matlab. Default values are: N = 100 , ρ = 3 y σ = 1.0.
Applsci 12 08523 g005
Figure 6. Efficient frontier coefficients, correlation coefficient vs. computing time, using local search algorithm.
Figure 6. Efficient frontier coefficients, correlation coefficient vs. computing time, using local search algorithm.
Applsci 12 08523 g006
Figure 7. Contrast between contour propagation with different correlation coefficients. The green and magenta colors show areas where the images do not match.
Figure 7. Contrast between contour propagation with different correlation coefficients. The green and magenta colors show areas where the images do not match.
Applsci 12 08523 g007
Figure 8. The diagram shows how each of the parameters intervene in order to obtain the optimal transformation in the matRad-contourPropagation algorithm.
Figure 8. The diagram shows how each of the parameters intervene in order to obtain the optimal transformation in the matRad-contourPropagation algorithm.
Applsci 12 08523 g008
Figure 9. Comparison between registrations with demons and B-spline for the 6 breast CT structures, using the Dice coefficient.
Figure 9. Comparison between registrations with demons and B-spline for the 6 breast CT structures, using the Dice coefficient.
Applsci 12 08523 g009
Figure 10. Comparison between the manual registration done by the professional oncologist and the registration made by the demon algorithm, for Scenarios 2 to 5 of the breast CT scans.
Figure 10. Comparison between the manual registration done by the professional oncologist and the registration made by the demon algorithm, for Scenarios 2 to 5 of the breast CT scans.
Applsci 12 08523 g010
Table 1. Comparison between initial parameters and local optimal parameters.
Table 1. Comparison between initial parameters and local optimal parameters.
ScenarioInitial ParametersLocal Optima
N = 200 , ρ = 3 , σ = 2.5 N = 300 , ρ = 2 , σ = 2.9
Table 2. Time increment ratio, correlation coefficient interval length, and center value correlation coefficient interval for Scenarios 2 through 10.
Table 2. Time increment ratio, correlation coefficient interval length, and center value correlation coefficient interval for Scenarios 2 through 10.
ScenarioTime IncrementCorrelation CoefficientCorrelation Coefficient
RatioInterval LengthCenter Value
Table 3. Set of candidate parameters for contour estimation in the 5 scenarios using breast CT scans.
Table 3. Set of candidate parameters for contour estimation in the 5 scenarios using breast CT scans.
Scenario 1Scenario 2Scenario 3Scenario 4Scenario 5
ρ 11111
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Vargas-Bedoya, E.; Rivera, J.C.; Puerta, M.E.; Angulo, A.; Wahl, N.; Cabal, G. Contour Propagation for Radiotherapy Treatment Planning Using Nonrigid Registration and Parameter Optimization: Case Studies in Liver and Breast Cancer. Appl. Sci. 2022, 12, 8523.

AMA Style

Vargas-Bedoya E, Rivera JC, Puerta ME, Angulo A, Wahl N, Cabal G. Contour Propagation for Radiotherapy Treatment Planning Using Nonrigid Registration and Parameter Optimization: Case Studies in Liver and Breast Cancer. Applied Sciences. 2022; 12(17):8523.

Chicago/Turabian Style

Vargas-Bedoya, Eliseo, Juan Carlos Rivera, Maria Eugenia Puerta, Aurelio Angulo, Niklas Wahl, and Gonzalo Cabal. 2022. "Contour Propagation for Radiotherapy Treatment Planning Using Nonrigid Registration and Parameter Optimization: Case Studies in Liver and Breast Cancer" Applied Sciences 12, no. 17: 8523.

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop