Keywords

1 Introduction

Chagas disease is an illness caused by the protozoan parasite Trypanosoma Cruzi. Within the last years, Chagas disease has spread around the globe very rapidly threatening the life of thousands of people. Once infected, the T. Cruzi parasites remain hidden mainly in the heart muscle of the patient, yielding an infection that over the years may cause sudden death from heart failure.

This disease consists of two different phases: initially, the acute phase that lasts for a period of about two months after the infection has been contracted [2], and the second phase also known as chronic phase that may last years.

In the acute phase, a large number of parasites may be observed circulating in the bloodstream and usually, there are no symptoms or they are mild in this phase. Then again, in the chronic phase the parasites are hidden mainly in the heart and digestive muscle causing patients to suffer from cardiac and digestive disorders. Over the years, the infection can cause sudden death from cardiac arrhythmias or progressive heart failure from the destruction of the heart muscle and its innervations [6].

In order to study and analyze the reactions of the disease, the murine model (use of strains of special mice to study a human disease or condition, as well as the way to prevent and treat it) turns out to be very useful in Chagas disease research [9]. Murine model presents much of the immunological, pathological and physiological characteristics of Chagas disease in humans and the acquisition of samples is relatively easy compared to that of other animals. It is also a low cost procedure and therefore highly attractive for research.

In the present echocardiographic study, for the following up of the strains of infected mice, ultrasound videos of the heart were obtained. Due to hearth anatomy, quantifying the damages caused by the disease is quite difficult due to the very condition of the ultrasonic image. The ultrasound technique used to capture the images, uses high frequency sound waves to provide cross-sectional images of the region under study. This very same technique is popular in almost all medical fields and a variety of clinical situations [7]. This imaging mode is rapidly evolving with significant advances in transducer technology and more sophisticated imaging routines [1].

In spite of recent advances, segmentation of ultrasound images is strongly influenced by the quality of the data and by no means an easy task. There are characteristic artifacts, such as attenuation, mottling, shadows and signal loss that makes difficult to obtain reasonable partitions of the images. Typical complications also arise because the contrast between the areas of interest is often low [5].

In this work a semiautomatic segmentation technique for the left ventricle in echocardiographic images of the murine model for Chagas disease will be shown.

The outline of the paper is as follows. In Sect. 2, we review the foundations of the active contour model without edges, the level set method and shape-prior based model. In Sect. 3, we present how to construct the shape prior for the left ventricle of the hearth of mice, how to select proper parameters for the model and the morphological post processing applied to the results, finally in Sect. 4 we present our conclusions.

2 Active Contour Model with for Image Segmentation with Shape Prior

2.1 Active Contours

An active contour (commonly called Snake) consists of a elastic curve that, placed on an image, starts deforming from an initial form in order to delimit the regions of interest in the scene. Curve deformation is achieved by applying internal forces, intrinsic to the Snake that control the smoothness of the curve, as well as external forces, that pushes the Snake towards the salient characteristics of the image. The active contour property makes deformable models an effective tool in multiple tasks, such as in the analysis of medical images, where the low signal-to-noise ratio makes the results obtained through classical techniques insufficient.

Geometrically, a Snake is a parametric contour \(c(s, t) = (x (s, t), y (s, t))\), variable in time and defined in the image plane \((x, y) \in {R}^2\), where the x(st), y(st) coordinates of the contour are functions of the parametric variable \(s \in [0, 1]\), and time t. The contour is supposed to be closed, through boundary conditions. The shape of the contour is expressed by the following energy function \(E_{total}\), which must be minimized in order to determine the shape and final position of the Snake:

$$\begin{aligned} E_{total}= \int _0^1 \frac{\alpha |c'(s)|^2 + \beta |c''(s)|^2}{2}ds + \int _0^1 g(u(c(s)))ds \end{aligned}$$
(1)

where and \(E_{ext}\) correspond to the terms of internal and external energy, respectively. \(E_{int}\) gives the deformation characteristics of the elastic contour and the functions \(\alpha (s)\) and \(\beta (s)\) determine the degree to which the Snake can be stretched or curved. These functions are useful for manipulating the physical behavior and local continuity of the model. Thus, for example, an increment in the magnitude of \(\alpha (s)\) results in increments in the tension of the curve, which tends to eliminate loops or curls by reducing the contour length. On the other hand, an increment in \(\beta (s)\) increases the rigidity of the Snake, making it softer in shape and less flexible.

These functions, \(\alpha (s)\) and \(\beta (s)\), may be dependent of s, curve length, and by adjusting them it is possible to change the characteristics of the Snake in each parametric coordinate. However, most applications specify constant values along the contour for \(\alpha \) and \(\beta \). The external energy function \(E_{ext}\), is derived from the image in such a way that it takes in its smallest values the characteristics that are of interest to us, such as the edges or borders. For this case, g(u(c(s))), denotes a potential scalar function that is defined in the image plane.

2.2 Level Sets

A simple but clever way to track evolving active contours was designed Osher and Sethian [8]. The main idea behind this method is the representation of curves or surfaces as the zero level set of a hyper-surface of higher dimension. For instance, sharp curves on a 2-dimensional space are considered as the level sets of a continuous surface of in the 3-dimensional space. This is, a smooth function \(\phi (x, y, t)\) can be defined to represent the surface while the set of definitions \(\phi (x, y, t)=0\) for some values of t may represent the evolving contours. By doing so, the evolution of a curve can be transformed into the evolution of a function of level sets in 3D space.

To obtain such a representation, let \(\phi (x, y, t = 0)\) be a function of level sets, where the zero level set corresponds to the curve being tracked. By making the curve as the boundary surface, it is possible to define two separated regions, the region inside the curve and region outside the curve. A signed distance function (SDF) is then defined within the surface. This is

$$\begin{aligned} \phi (x,y,t=0)=d \end{aligned}$$
(2)

where, d represents the shortest distance from the point x on the surface and the curve. Throughout the process of evolution of the curve its points are adjusted by the following equation:

$$\begin{aligned} \phi _{t} + F|\nabla \phi |=0 \end{aligned}$$
(3)

known as the Eikonal equation, where F represents the velocity related to the evolution of the surface properties such as the normal direction and its curvature.

When used for the task of image segmentation, F may depend on image information with an ideal value of zero at the edge of the object, that is, the largest value of the image intensity gradient.

Some advantages of using the level set method for curve evolution are the stability of the method and its capacity of handling changes of curve topology very easily.

2.3 Active Contours Without Edges

The active contours model without edges, also known as the Chan-Vese model, was introduced some years ago by Chan and Vese [3]. This model assumes that the gray level image can be split in regions of almost constant brightness. The mathematical formulation of the model is the minimization of a functional with the following components:

$$\begin{aligned} F(c_1, c_2,C) = \mu \cdot long(C) + v \cdot Area(In(C))+\lambda _1F_1(c_1,C) + \lambda _2F_2(c_2,C). \end{aligned}$$
(4)

with

$$\begin{aligned} F_{1}(c_1,C) = \int _{In(C)} |u_0(x,y)-c_1|^2 d\varOmega \end{aligned}$$
(5)
$$\begin{aligned} F_{2}(c_2,C) = \int _{Out(C)} |u_0(x,y)-c_2|^2 d\varOmega , \end{aligned}$$
(6)

where the given image (allowed to be noisy) is denoted by \(u_0\) and defined on \(\varOmega \subset R^{2}\), the initial curve will be C and can take any form, size and location in the image, \(c_1\), \(c_2\) are constants that represent the average of the image inside and outside the curve respectively. Area(In(C)) and long(C) are terms for keeping bounded the longitude of the curve and the area inside the curve. Finally, \(\mu , v \ge 0\) and \(\lambda _1, \lambda _2> 0\) are parameters chosen in advance.

The problem is therefore to compute the minimum of F with respect to \((c_1, c_2, C)\). The active contours model without edges can be rewritten using the level set formulation as follows:

$$\begin{aligned} \begin{aligned} \min _{c_1,c_2,\phi }F_{CV}(c_1,c_2,\phi )&= \mu \int _\varOmega \delta (\phi )|\nabla \phi |d\varOmega + \nu \int _\varOmega H(\phi ) d\varOmega \\&\quad +\, \lambda _1\int _\varOmega |u_0-c_1|^2H(\phi ) d\varOmega + \lambda _2\int _\varOmega |u_0-c_2|^2(1-H(\phi )) d\varOmega \end{aligned} \end{aligned}$$
(7)

where \(\delta (\cdot )\) is the delta function and \(H(\cdot )\) the Heaviside function.

2.4 Shape-Prior Based Model

A strong limitation of the Chan-Vese model is that it does not consider the shape of the region or object to be segmented. Therefore, artifacts with similar gray level to the one of the object of interest (OOI) are also assigned to the same region completely ruining the segmentation result. To remedy this, in [4] a shape-prior was introduced in the mathematical formulation. The main idea is to construct a shape model from a set of different views of the OOI and use this a priori information somehow in the model to force the contour to move in that direction. The model is as follows:

$$\begin{aligned} F_{PS}(c_1,c_2,\phi ) = F_{CV}(c_1,c_2,\phi ) + \alpha F_{shape}(\phi ), \end{aligned}$$
(8)

where

$$\begin{aligned} F_{shape}(\phi ) = \int _{\varOmega }(\phi (x) - \phi _0(x))^2 dx, \end{aligned}$$
(9)

and \(\phi _0\) represents the shape prior constructed by averaging the level set functions of a set of images containing the OOI. Here \(\alpha > 0\) is a weight.

3 Experiments

In this section, we present experimental results of using the active contour model with shape prior on ultrasound images of the heart of mice. In particular, the objective is to segment the left ventricle when it is in any of two states: diastole or systole. To this aim, shape priors were constructed for each state using a set of manually segmented images (the training set). To validate the results obtained from the semi-automatic segmentation, a python script was coded that generates a confusion matrix returning the true positive (TP), true negative (TN), false positive (FP) and false negative values (FN). With the values obtained from the confusion matrix we can calculate the accuracy, F1 score and the Mathews correlation coefficient (MCC).

3.1 Shape Prior Construction

The quality of construction of the shape prior is of paramount importance for the performance of the model. In this case, a set of manually segmented ultrasound images was used for this purpose. The manual segmentation focused in segmenting the left ventricle of the hearth in images from mice infected with the T. Cruzi parasite. It was decided to analyze only two states of the ventricle: the diastole state and the systole state.

Once the manual segmentation of the image set was finished, the binary images were processed with the level set algorithm to yield signed distance functions. This process even though slow, is relevant since it brings stability to the whole algorithm.

In Fig. 1(a), some samples of different ventricles, in diastole state, are shown. Although they are similar in shape, it is possible to observe some differences. In Fig. 1(b) the resultant level set prior is presented. The shape prior looks as an out of focus image. This is due to the averaging process of all the level sets. The blurred regions may be interpreted as regions of uncertainty for the algorithm.

In Fig. 2(a), samples for the left ventricle in systole state are presented. The correspondent level set prior is shown in Fig. 2(b).

Fig. 1.
figure 1

(a) Diastole masks from the training set. (b) Average diastole mask.

Fig. 2.
figure 2

(a) Systole masks from the training set. (b) Average systole mask.

3.2 Tuning the Model and Results

The selection of the parameters \(\alpha , dt\) and \(\mu \) is critical for the performance of the method. In this section, we show how to compute them and illustrate with some Figures the results for different combinations of them.

The first experimental tests were carried out over the ultrasonic images of the mice control group in the acute phase of the illness. Images of the hearth in diastole and systole states were used.

In Fig. 3, from (a) to (d), a good segmentation of the left ventricle, in both states, can be observed. The best parameters were obtained by trial and error by running the algorithm with different sets of values and evaluating accuracy, F1 score and Mathews coefficient correlation (MCC) at each iteration.

The parameters used here were \(\alpha = 0.01\), a step size \(dt = 0.1\) which allows a rapid convergence of the algorithm and a fixed \(\mu = 0.2\). The algorithm converged on average after 1, 485 iterations. In the second experimental tests, the value of the weight parameter was increased to \(\alpha = 15\), forcing contour to keep very close to the shape prior, the step size remained at \(dt = 0.1\) and the value of \(\mu = 0.2\) fixed. With this set of values, convergence was acquired after 1, 458 iterations on average.

Fig. 3.
figure 3

Segmentation results with \(\alpha = 0.01\), a step size \(dt = 0.1\) and a fixed \(\mu = 0.2\)

The results of this experiment can be seen in Fig. 4 from (a) to (d). There it can be appreciated that a very small reduction on the quality of segmentation was obtained for the diastolic images while an improvement in accuracy of 0.025%, F1 score of 0.014% and MCC of 0.24% were obtained in Fig. 4(b) and also increases of 0.03% in accuracy, 0.01% in the F1 score and 0.4% in MCC for Fig. 4(d) can be observed. Finally, the third set of experimental tests were carried out with a value of \(\alpha = 50\), a step size \(dt = 0.5\) in order to accelerate the convergence of the algorithm and a \(\mu = 0.2\). This time, it was observed that the algorithm converged on average in 364 iterations. The results are presented in Figs. 5 from (a) to (d) where, compared to the previous experiments, an overall increase in the accuracy values, F1 score and MCC, can be seen in both diastole and systole states.

Fig. 4.
figure 4

Segmentation results with \(\alpha = 15\), a step size \(dt = 0.1\) and \(\mu = 0.2\) fixed.

Fig. 5.
figure 5

Segmentation result with \(\alpha = 50\), a step size \(dt = 0.5\) and \(\mu = 0.2\) fixed.

3.3 Morphological Post-processing

The output of the active contour model with shape prior very often presents some artifacts, either due to the inherent instability of the algorithm or due to noise present in the region of interest. Therefore, to smooth out the result and improve precision of the segmentation, we applied morphological filters such as bridge and fill to the output of the active contour model.

Fig. 6.
figure 6

Segmentation result for image problem in Fig. 3(a) for the diastole state. (a) Output from the active contour method (b) After morphological processing (c) Ground truth

Fig. 7.
figure 7

Segmentation result for image problem in Fig. 3(c) for the diastole state. (a) Output from the active contour method (b) After morphological processing (c) Ground truth

Fig. 8.
figure 8

Segmentation result for image problem in Fig. 4(b) for the systole state. (a) Output from the active contour method (b) After morphological processing (c) Ground truth

Fig. 9.
figure 9

Segmentation result for image problem in Fig. 4(d) for the systole state. (a) Output from the active contour method (b) After morphological processing (c) Ground truth

In Figs. 6 and 7 we compare the results for the diastole state from the outcome of the active contours model, after morphological processing, and the ground truth (manual segmentation by the expert). In Figs. 8 and 9, we do the same for the systole state.

It can be appreciated by simple observation that morphological processing removes artifacts yielding a cleaner segmentation.

Finally, in Table 1, we present a summary of the different metrics we computed for each experiment.

Table 1. Results of segmentation for the left ventricle in diastole state (first two rows) and systole state (last two rows).

4 Conclusion

In this paper we presented a methodology to segment the left ventricle of the hearth of mice in ultrasound images by using the active contours model with shape prior. We shortly reviewed the theory of the active contours model and level set method and discussed the way to construct the shape prior for the two states of the ventricle: diastole and systole. The obtained results are encouraging since the quality and precision of the segmentation was pretty much in accordance with the manual segmentation from medical experts. Some metrics such as precision, F1 score and MCC were computed on the results and overall they achieved high values. We also presented how to further improve the quality of the segmentation by applying morphological post-processing to the binary images.

There is however still much to do in order to take this methodology to the next level. For instance, constructing the shape prior is very time consuming and tedious. There is also the need to align the shape prior to the region of interest in the image. This is an important step that now has to be carried out manually. The implementation of a simultaneous image registration and segmentation with shape prior algorithm would improve results by facilitating the alignment. This will be part of our future work.