1 Introduction

Nowadays, computational anatomy has become an important tool for medical diagnosis. Among different organs of the body, the liver is one of the most diagnosed targets as it plays an important role in vital functions such as detoxification and synthesis. Demanding medical tasks like lesion detection and surgery planning with regard to the liver routinely require the identification and extraction of the volume from medical images. Consequently, accurate liver segmentation is vital for the success of surgical operations. However, manual segmentation is no small undertaking and is very much dependent on the aptitude and experience of the radiologist.

In recent years, in order to forgo these limitations, a number of different automatic segmentation techniques for computed tomography (CT) [28] and from magnetic resonance images (MRI) have been suggested [6, 8, 9, 11, 27]. The process of automatic segmentation is complicated by the presence of image artifacts (for example intensity inhomogeneities) and the fact that the surrounding organs have the same tissue contrast. It is for this reason that information, such as the shape and specific location within the body, may be useful in carrying out the segmentation task. It is worth noting that lack of contrast is a more severe problem when the intensity of the magnetic field and/or the acquisition time decreases, which is precisely the case in the type of images used in this study, perfusion MR images. This is because they have to be acquired fast, at the same time as a contrast is diffusing through the circulatory system of the liver.

Algorithm segmentation can be guided by priori data, which may be provided by atlases. Atlas-based segmentation algorithms use the spacial concurrence between the atlas and the image to produce a segmentation of the target image by knowing the segmentation of the atlas image. Aside from the majority of research that has been carried out on the brain [3] and the heart [18, 21], there has also been some attention shown to the liver (see [24, 39].

In contrast to previous works, a new method that depends on a segmentation algorithm will be proposed in this work. This method is based on mathematical morphology. Also, it uses prior information in the form of a probabilistic atlas, which supplies information regarding the probability of belonging to the liver, which is especially useful near the contours. Within the framework of computational anatomy, a probabilistic atlas is a probability encoded map of anatomical variability of the anatomical structure that is of interest to us.

This paper is structured in five parts: Sect. 2 explains the foundation of our method to build the probabilistic atlas. Section 3 presents the methodology. Sections 4 and 5 discuss the results and conclusions, respectively.

2 Atlas construction

In this study, we focus on the use of a probabilistic atlas, a 3D volume indicating the probability of each voxel belonging to a prototype shape, the liver in this case. Some segmentation algorithms can interpret this as an a priori probability and use Bayesian methods to update it using the values of the signal at that voxel or neighboring ones as new information [31]. Other algorithms can interpret it as a probability of belonging to a set of voxels that constitute the relevant structure and rely on fuzzy techniques [29], and, finally, others can use the values as initial function to apply level-set techniques [16]. This section explains how our probabilistic atlas has been built together with the applied improvement to get a more accurate result.

Currently, the most used approach for the construction of a probabilistic atlas directly applies the estimation of probability from a sample as the number of hits with respect to the number of cases. In this context, this involves two steps: firstly, registering the binary shapes in the sample with respect to one of them using the chosen registration algorithm, and then looking at each voxel to see how many of the samples it belongs to. This number, divided by the sample size, is the probability assigned to that voxel. This is used for example in Park et al. [32]. In this work, this has been formalized as the coverage function.

Other possibilities for building probabilistic atlases use the distance function and transformations of it. Intuitively, the distance function associated with a binary shape is a function from the 3D space to the real numbers, and it measures how far each point is from the shape. There are two variants: the unsigned distance function, for which all the points of the shape get a null value and those outside get the distance to the closest point of the shape; and the signed distance function, for which the outer points also get the distance to the closest point of the shape, and the inner points get the value of their distance to the closest border with an opposite (negative) sign. There are a few approaches that use the distance function to build atlases; a relevant one is the work of Pohl et al. [35] that, using a logistic link function, transforms a signed distance map into a log-odds map.

The main idea presented in this paper with regard to atlas construction is the combination of both approaches, the coverage function and the distance function, using a generalized linear model (GLM). The formalization uses concepts of random sets. Intuitively, a random set is a statistical distribution whose realizations are n-dimensional sets of points. Let \(\varPhi\) be a random compact set whose realizations are binary shapes: compact (but not necessarily convex) sets of points of \({\mathbb {R}}^2\) or \({\mathbb {R}}^3\) (in general, \({\mathbb {R}}^d\)). Given any fixed shape S, and for any point \(x\in {\mathbb {R}}^d\), \(1_{\rm S}(x)\), will denote the set indicator function, i.e.,

$$\begin{aligned} 1_{\rm S}(x)=\left\{ \begin{array}{cc} 1 &{} \quad \text{ if } x\in S\\ 0 &{} \quad \text{ if } x\notin S \end{array} \right. \end{aligned}$$

In any random compact set, the value \(1_{\rm S}(x)\) is a random variable that takes values in the binary set \(\{0,1\}\). Now, let us consider a random sample of \(\varPhi\), i.e., a collection of independent and identically distributed (as \(\varPhi\)) random compact sets \((\varPhi _1,\ldots ,\varPhi _n)\), \((\varPhi _1,\dots , \varPhi _n)\) being the corresponding realizations. Having these data, an unbiased estimator for the coverage function c(x) is:

$$\begin{aligned} \hat{c}(x)=\sum _{i_1}^n 1_{\varphi _i}(x) \end{aligned}$$

which has a clear intuitive meaning: the number of shapes in the sample to which a point x belongs. The coverage function offers a way to calculate an unbiased estimator for the probability p(x):

$$\begin{aligned} \hat{p}(x)=\sum _{i_1}^n \frac{1_{\varphi _i}(x)}{n}. \end{aligned}$$

p(x) corresponds to the classical probability as the number of hits over the total number of cases. Its threshold below 0.5 is related with the concept of mean shape, and indeed it is a particular case of the so-called Vorobev mean [36]. But this definition for p(x) has some drawbacks mainly related to the fact of estimating the probability at each point in isolation, as if the random variable that is the coverage at that point was independent of all other points. This assumption of independence means that spatially close points can get different probability values due to noise or imperfect co-registration, which in turns makes the shapes resulting from probability thresholding rougher than would be expected of a summary shape, which is supposed to have a smooth limiting surface. A feasible alternative to solve this problem consists of using the distance function; to be precise, on finding a sensible relationship between the probability and the value of the distance function at a given point or at some related points. The formal definitions are as follow: given a binary shape, S, \(d_{\rm S}(x)\) will be the distance function to S:

$$\begin{aligned} d_{\rm S}(x)=\left\{ \begin{array}{ll} \min\nolimits_{y\in \partial S}d(x,y) &{} \quad \text{ if } x\notin S\\ 0 &{} \quad { \text{ if } x \in \partial S}\\ -\min\nolimits_{y\in \partial S}d(x,y) &{} \quad \text{ if } x\in int(S), \end{array} \right. \end{aligned}$$

where d(xy) is the Euclidean distance between x and y, \(\partial S\) the boundary of S and int(S) the interior of the set S. In a similar way, \(d_\varPhi\) can be defined not for a fixed set but for a random set \(\varPhi\). In this case, \(d_\varPhi\) is a random variable. Since \(1_\varPhi (x)=0 \iff d(x)>0\) and \(1_\varPhi (x)=1 \iff d(x)\le 0\), d(x) univocally determines \(1_\varPhi (x)\). Let

$$\begin{aligned} p(x)=E(1_\varPhi (x))=P(x\in \varPhi ) \end{aligned}$$

where E is the expectation over all sets in \(\varPhi\). From here the mean distance function \(d^*_\varPhi (x)\) is defined as

$$\begin{aligned} d^*_\varPhi (x)=E(d(x,\varPhi )). \end{aligned}$$

In practice, the mean distance function is estimated for a collection of samples \((\varPhi _1,\dots ,\varPhi _n)\) as

$$\begin{aligned} \hat{d}^*_\varPhi (x)=\sum _{i=1}^n \frac{d_{\varPhi _i}(x)}{n}. \end{aligned}$$

Similar to the mean coverage, the threshold below some value of the mean distance function gives a binary shape that can also be considered as a mean shape, this time with 0 being the natural threshold (a definition derived from the so-called Baddeley–Molchanov mean [1]. The mean distance function is smooth, so its thresholds are smoother than those of the mean coverage function. This is why the function p(x) will be estimated using information about the mean distance function.

Our hypothesis assumes that \(p(x)=f(d^*(x))\) (i.e., the probability is directly linked to the mean distance function) and the link between them must be found. Since \(d^*(x)\) can be positive or negative, the natural link in the context of general linear models consists of using a cumulative distribution function (c.d.f.), which is a non-decreasing function \(F: \mathbb {R}\rightarrow [0..1]\). The value \(d^*(x)\) is commonly transformed using a basis of functions denoted as \({{\mathbf {v}}}(x)=(1,v_1(d^*(x)),..,v_{p-1}(d^*(x)))'\), \({\mathbf t}'\) being the transpose of any vector \({\mathbf t}\). The model to be assumed is:

$$\begin{aligned} p(x)=F({{\varvec{\beta }}}'{} \mathbf{v}(x)) \end{aligned}$$

\({{\varvec{\beta }}}=(\beta _0,\beta _1,..,\beta _{p-1})\) being a vector of coefficients to be determined. In GLM the common choices for the link function F are the c.d.f. of either the standard logistic distribution or of the standard normal distribution. The first one will be used, i.e.,

$$\begin{aligned} p(x) = \frac{\hbox{e}^{{{\varvec{\beta }}}' {{\mathbf {v}}}(x)}}{1 + \hbox{e}^{{{\varvec{\beta }}}' {{\mathbf {v}}}(x)}}. \end{aligned}$$

For any given point \(x_0\), it is expected that p(x) will be a smooth function so it can be assumed that p(x) takes a constant value in a ball centered at \(x_0, B(x_0,h)\) with a sufficiently small radius h. Let \((x_j,1_{\varPhi _i}(x_j))\) with \(j=1,..,J\) be the points within \(B(x_0,h)\). In this way the local pseudo-likelihood function for the i-th realization is given by

$$\begin{aligned} \prod _{j=1}^J w(x_j,x_0) p(x_j)^{1_{\phi _i}(x_j)} (1-p(x_j))^{1- 1_{\phi _i}(x_j)}, \end{aligned}$$

using a w-function \(w(x,x_0) = K(\parallel x- x_0\parallel /h)\) with K a kernel function modulated by a bandwidth h. Accordingly, the whole likelihood function for a complete random sample of \(\varPhi\) will be:

$$\begin{aligned} L(\beta )= \prod _{i=1}^n \prod _{j=1}^J w(x_j,x_0) p(x_j)^{1_{\phi _i}(x_j)} (1-p(x_j))^{1- 1_{\phi _i}(x_j)}, \end{aligned}$$

and its log-likelihood will be:

$$\begin{aligned} l(\beta ) \,= \,& {} \log L(\beta ) \nonumber \\= & {} \sum _{i=1}^n \sum _{j=1}^J \left( \log (w(x_j,x_o)) + 1_{\varPhi _i}(x_j) \log (p(x_j)) \right. \nonumber \\&\left. +\,(1- 1_{\varPhi _i}(x_j)) \log (1-p(x_j)) \right) . \end{aligned}$$
(1)

This global likelihood will be maximized by a vector of parameters that will be denoted by \(\hat{{\varvec{\beta }}}(x_0)\), i.e.,

$$\begin{aligned} \hat{{\varvec{\beta }}}(x_0) = \mathop {{\text{argmax}}}\limits_{{\varvec{\beta }}} \ l({\varvec{\beta }}). \end{aligned}$$

Determination of \(\hat{{\varvec{\beta }}}\) is done by the optimization methods provided by the package locfit Loader [25] of the R language. The final estimator proposed for the probability function p(x) is:

$$\begin{aligned} \hat{p}(x_0) = \frac{\hbox{e}^{\hat{{\varvec{\beta }}}(x_0)' {{\mathbf {v}}}(x)}}{1 + \hbox{e}^{\hat{{\varvec{\beta }}}(x_0)' {{\mathbf {v}}}(x)}}. \end{aligned}$$

Its value at location \(x_0\) is our probabilistic atlas.

With regard to atlases, there is one important aspect to point out. The initial raw data are examples of correctly segmented binary shapes. The procedure of segmentation is of crucial importance to obtain a good atlas, so manual or assisted segmentation should be used. This is the reason why manually segmented data performed by an expert have been used in this work.

3 Methodology

To segment the liver, the proposed method is based on partial segmentation by slices, an idea also used for example in Göçeri et al. [13] or in Linguraru et al. [24], where each slice relates to the closest, previously segmented slice. Similarly to Linguraru et al [24], it makes use of a probabilistic atlas, but, in contrast to these two approaches, the segmentation of each slice uses mathematical morphology, namely viscous reconstruction, and does not use level-set-based methods.

The initial slice is selected as one of the central slices of the liver (from the lowest-higher order, in accordance with radiological convention). This slice then uses anatomical information provided by the probabilistic atlas and a previously made, approximate segmentation. From this central slice the process then advances upwards and then downwards, aided by the MR image, the probabilistic atlas and the result of the nearest segmented slice.

The most crucial parts of the global process are shown in Fig. 1 and are as follows:

  • An initial approximate 3D segmentation is carried out which starts with a point seed simply by intensity-based region growing. The initial condition for the addition of points to the growing region is based on current standard deviation of the signal level with the aim of being rather restrictive. This gives a quite strict under-segmentation. This is used solely as a seed for each slice and for atlas registration.

  • Selection of the first slice is made, and 2D segmentation of it is carried out (a detailed explanation of slice selection and segmentation will be discussed later)

  • Using, again, the corresponding slice of the initial under-segmentation as the seed, the process continues upwards to the closest slice and starts its segmentation. Here the same procedure is used as with the central slice, the only difference being that region reconstruction has limitations set by a modified contour produced from the previously segmented slice.

  • When we no longer have an under-segmentation, the inner most part of the formally segmented slice is used as the seed. The process comes to an end when the area of the new slice is sufficiently low, at which time the process begins again at the central slice, except now it goes downwards.

  • When the segmentation has finished, the result is used again in a second pass as the new initial segmentation, so the algorithm learns from the previous result. The atlas is then realigned to the new current initial segmentation.

Fig. 1
figure 1

Main steps of the segmentation procedure

In the first of the above-mentioned steps, a seed must be selected for each slice. That seed will come from an initial under-segmentation (i.e., a segmentation that misses ample areas from the liver, but which has high confidence in the retained points). From that seed, the segmentation will increase to reach the limits of the shape at that slice. Other works make use of a level-set-based method in order to allow the curve to be modified in discrete time steps. Contrary to this, this work uses viscous reconstruction, a morphological technique first introduced by Hanbury et al. [15]. Viscous binary reconstruction needs a seed image (it could be just one point inside the shape) and a marker image, which is a set of points that are fairly evenly spaced along the contour. Then an iterative procedure is carried out: a morphological dilation is applied to the seed, followed by an intersection with the negated markers, concluding with a morphological closing. Iterations cease when the shape stops growing. This process is advantageous compared to simple hole filling in that it is not necessary for the limit contour (the markers) to be closed, so even if a complete border is not found, the method will still finish appropriately. It is an improvement over level-set methods because of its simplicity, and the low requirement of free parameters (only dilation and closing radius, which also have an intuitive physical meaning).

In the next subsection, a detailed explanation of each of the steps outlined in Fig. 1 is provided.

3.1 Initial under-segmentation

The method starts with the selection of a seed point in the central area of the liver. This is carried out by taking into account the image dimensions and approximate knowledge of the typical liver position. The actual point selected is not of great importance, as long as it is appropriately deep enough inside the liver. To test this, a spherical region with a radius of 2 cm centered on the prospective seed is evaluated to see whether its mean signal level is within reasonable limits, and has a low standard deviation of the signal level. If it is not appropriate, another seed is chosen close by. There is also the option of allowing the user to select the seed point manually, but this was not needed. From this seed point a basic region growing algorithm expands the region by not allowing the inclusion of points which would increase the current region variance by more than 30%. Nevertheless, even with such strict parameters the initial region still, on occasion, grows along the aorta and can even end up including parts of the heart if the particular image was taken during a phase of contrast diffusion. To avoid this, an erosion is performed, followed the by the removal of any connected parts other than the largest, and finally a dilation is carried out.

The first part of the process produces a shape that is completely contained inside the liver but does not come close to its limits, neither does it touch any part of the left lobe, as can be seen in Fig. 2 where we can see the initial segmentation highlighted in red, surrounded by the limit of the real shape cut by a vertical plane. There are two reasons for producing this initial under-segmentation: to serve as the initial seed for the next step (2D slice segmentation) and to give a concrete location to register the probabilistic atlas.

Fig. 2
figure 2

Initial segmentation (in red) into real liver (in gray, cut by a vertical plane) (color figure online)

The probabilistic atlas is registered with binary shape registration. In order to do this, a probability threshold is selected to allow the volume occupied by points with a probability higher than this threshold to match as closely as possible with the volume of the initial segmentation. This yields a binary cut of the atlas used to determine an affine 3D transformation of the initial segmented shape. An estimation of the transformation is achieved by minimizing the mean surface-to-surface distance. This geometrical transformation is later applied to the real-valued image which is the probabilistic atlas.

3.2 Initial slice segmentation

From here a slice is taken for every voxel plane in the MR image along the inferior–superior direction. Attempts were also made in lateral and anterior–posterior directions, but with worse results. The selection of the initial slice is carried out according to the following criteria: the sum (integral) of the probability map extended to the initially segmented points of that slice is calculated, using the probabilistic map previously registered. The slice with the highest value of this measure is chosen. It is assumed that this accounts for the central and promising slices since it takes account of both the size and the approximate proper placing of the slice. This slice is then extracted from the three inputs: the MRI image, the initial binary segmentation slice and the real-valued probabilistic atlas slice. These steps are followed by 2D segmentation, and the results for a typical slice are shown in Fig. 3, where sub-figure (a) is the original MRI image. The steps used for this central slice are as follows:

  1. 1.

    A curvature anisotropic diffusion image filter [34] is applied to the MRI slice (Fig. 3a). The purpose of this filter is to smooth out near-constant areas of the image while keeping the borders unaltered as much as possible. The result, depicted in Fig. 3b, will be called \(I_{\rm s}\). The rationale behind using this as the first step is explained by the next steps: the algorithm is based on a region growing from a seed where the expansion will be stopped by the borders. Therefore, it vitally important to have a smooth image inside the region to be segmented, but also continuous and well-defined limits (borders) for such a region.

  2. 2.

    The gradient value of the formerly smoothed image is taken and transformed by a sigmoidal function. This result will be called \(\text{Sg}=\text{Sig}(\mid \nabla I_{\rm s}\mid )\), Sig(v) being a sigmoidal transform, i.e., a continuous monotonic increasing real-valued function with \(\lim _{v\rightarrow -\infty }\text{Sig}(v)=0\) and \(\lim _{v\rightarrow \infty }\text{Sig}(v)=1\). Sg is depicted in Fig. 3c and as can be seen, it delineates the borders very well, based on previously explained purpose, but it also contains borders which are inside and outside the liver.

  3. 3.

    Next, a filter is applied to the former result, which takes into account not only the obtained image value, but also the probability given by the atlas. The mean (\(\mu _{\rm Sg}\)) and standard deviation (\(\sigma _{\rm Sg}\)) of Sg in the area of the initial segmentation provides band limits. A point x is excluded if the value Sg(x) is outside the interval \(\mu _{\rm Sg}\pm 2.5\sigma _{\rm Sg}\). In addition to this, we make use of anatomical information provided by the atlas P, so point x will be discarded, too, if its probability P(x) is smaller than the threshold (0.35). The resulting image will be called PSg, and it is shown in Fig. 3d.

  4. 4.

    The thresholding of PSg will contain points that belong to the inner or outer borders of the liver; this threshold will be called PSgt and is depicted in Fig. 3e. A conservative threshold assures that all points kept in PSgt are true borders, but unfortunately in most cases they do not form a closed single limit and therefore cannot be used to stop either a viscous reconstruction, or a curve evolution resulting from a level-set method. Closing the outer border is the objective of the next step.

  5. 5.

    A Canny detector [4] is applied to the smoothed image \(I_{\rm s}\). The obtained edges help to find well-delineated limits, especially in clear slices such as the central areas, but again they are not closed and, irrespective of the border detector parameters chosen, a substantial amount of spurious borders are found. The solution to this comes from the combination of the Canny edges with the previous step, PSgt. Such a combination consists of isolating each border segment and removing all those that do not extend up to or very close to the edge points in PSgt, for at least half of its length. The union of these border segments with PSgt gives the result shown in Fig. 3f, that will be called \(I_{\rm l}\) (for limit image).

  6. 6.

    Figure 3g displays the corresponding slice of the initial 3D under-segmentation (see Sect. 3.1), that we will call \(I_\mathrm{seed}\). Here we can clearly see the need to get a very restrictive initial segmentation so that we can be sure that all shapes in the slices of \(I_\mathrm{seed}\) are well within the real limits marked by \(I_{\rm l}\). If this was not attained, viscous reconstruction would flood out of the shape.

  7. 7.

    Lastly, Fig. 3h shows the result of the viscous reconstruction, \(VR(I_\mathrm{seed},I_{l})\) which uses \(I_\mathrm{seed}\) as the seed and the negated of \(I_l\) as the image of limit markers.

Fig. 3
figure 3

Main steps for a single 2D slice segmentation

3.3 Slice segmentation using the closest segmented slice and stopping criterion

This process is very successful when applied to central slices for which the borders of the liver are adequately well-defined so that, even if border points are passed, there are a sufficient number of them to halt the growth of the seed. Unfortunately, in the outside regions of the liver the proximity of the spleen and the heart makes the border detection task much more difficult. In addition, the limits of the left lobe, and the narrowest part in particular, are normally very diffuse. This initiates flooding of the viscous reconstruction outside the expected (but scarcely visible) limits. In order to prevent this, data concerning the previous closest segmented slice are introduced. Specifically: after step (5) of those described in Sect. 3.2 borders are completed, in the same fashion as the Canny edges, except this time a modified version of the previous slice is used. The differences consist of the addition of the contour of either a dilation or an erosion to the markers. To decide which one, we measure which of the two contours is closer to the borders of this particular slice. From this it can be seen whether the slice will be larger or smaller than the previous one, and the anatomical consistency can be verified.

The segmentation begins with the first slice, which is selected as shown at the beginning of Sect. 3.2, and continues initially toward the head, and when completed, it starts again from the initial slice in the opposite direction. The process stops at each side when we have obtained a segmented slice with a negligible area (smaller than 5% of the area of the initial slice).

Another problem presents itself in relation to seed initialization at some slices. Figure 3g shows the cut of the initial segmentation at the initial slice, but as can be seen in Fig. 2, advancing upwards and also downwards there will be two limit slices from which the initial segmentation will no longer be present. Behind these two slices, a seed is used which is obtained from the previously selected slice: it is given a signed distance function, and the inner pixels (ones with the greatest negative value of the distance function) make up the new seed. The threshold on the distance function is applied so that the area of the new seed is about half the area of the former slice.

The final step, at a global level, is to establish a criterion for complete finalization (i.e., the cessation of feedback cycles). This is achieved when a sufficiently small volume variation (with respect to the previous step) is obtained (less than 1%). In the majority of cases that were analyzed, only one iteration was performed and never more than two.

4 Results

This work makes use of anatomical shapes which are binary shapes of manually segmented livers. The original images are dynamic perfusion MR images of the abdominal cavity. There were 39 explorations in total among 21 patients, 13 men and 8 women aged between 15 and 73. All volumes have been taken under the same conditions. The scanner was produced by Philips Medical Systems and worked in enhanced T1 high-resolution isotropic volume excitation mode. The patients were oriented in a supine, head first position and were required to breathe as little as was possible during the acquisition. Image resolution was \(256 \times 256\) pixels per slice and 133 slices per volume, slices being orthogonal to the machine displacement axis which was the axial (transverse) axis of the patient’s body. Each voxel has a real dimension of \(1.46 \times 1.46 \times 1.5\) mm, where 1.5 is the separation between consecutive slices. There were 17 patients with two or three explorations, which correspond to different time instants of the contrast diffusion. An example of this with coronal, sagittal and axial sections of one case is shown in Fig. 4.

Fig. 4
figure 4

Example of original images, as captured by the MRI scanner

The atlas was built according to the procedure explained in Sect. 2 using manually segmented shapes. In short, the idea is to build and keep a single atlas made with a sufficiently abundant sample. Since the number of manually segmented cases available to us is still limited, we have built different atlases using, for each of them, all available segmentations except those belonging to the patient being analyzed. One axial section of one of the probabilistic atlases used in these experiments is shown in Fig. 5. The figure shows the probability level (blue indicating lower probability and red higher) as well as the binary shape obtained by a threshold at a probability of 0.5.

Fig. 5
figure 5

An axial cut of the probabilistic GLM atlas and its cut at \(p=0.5\). Red means higher value of probability, blue lower values (color figure online)

Visual examples of segmentation for two of the analyzed cases are shown in Fig. 6. This figure depicts the initial under-segmented shape, the results of the first iteration and that of the second (in these cases, final) iteration.

Fig. 6
figure 6

Graphical comparison of initial segmentation (left), first global iteration (middle) and last iteration (right) for two cases (upper and lower row, respectively

The algorithm for the described segmentation was applied to ten cases. Visual results for three of these are displayed in Fig. 7, which makes a comparison between manual (ground truth data, right column) and automatic (left column).

Fig. 7
figure 7

Graphical comparison of results for three of the cases. (left: manual; right: automatic)

The result of comparing the automatic and manual segmentation produces numerical results in terms of five popular measures: volume overlapping (VO), dice coefficient (DC), volume error rate (VER), sensitivity (Se) and volume overlapping error (VOE). The definitions of these can be seen below, and also found in Klein et al. [20], where V(S) is the volume of any shape S, M is the manually segmented shape, and A is the automatically segmented one.

$$\begin{aligned} \hbox {DC}&= {} \frac{2(V(M\cap A))}{V(M)+V(A)}\\ \hbox {VO}&= {} \frac{V(M\cap A)}{V(M)+V(A)-(V(M\cup A))}\\ \hbox {VER}&= {} \frac{\mid V(M)-V(A) \mid }{V(M)}\\ \hbox {Se}&= {} \frac{V(M\cap A)}{V(M\cap A) + V(M \setminus A)}\\ \hbox {VOE}&= {} 1-\frac{V(M\cap A)}{V(M \cup A)},\\ \end{aligned}$$

\(\cap\) being the set-intersection, \(\cup\) the set-union and \(\setminus\) the set-difference. Notice that \(V(M\cap A)\) is the number of true-positive voxels (points correctly given as liver), \(V(A \setminus M)\) is the number of false-positives (points segmented as liver which are not) and \(V(M \setminus A)\) is the number of false-negatives (points not segmented as liver, but which are part of it).

In Table 1 we can see the DC, VO, VER, Se and VOE for each case; also their means and standard deviation are displayed. All quantities are within the [0, 1] interval, and the segmentation quality is better for values of DC, VO and Se that are close to 1 and for VER and VOE values close to 0.

Table 1 Results of the proposed measures of discrepancy between manual and automatic segmentation

Dice coefficient, the measure used most frequently, gives a mean value of 0.88, which may be thought to be enough to consider these results acceptable for most real clinical practice and comparable for example with Christ et al. [7] in MRI images; it is for this reason that the method proposed should be looked upon as preliminary, yet still a very good starting point for further manual refinement.

A comparison with other approaches to liver segmentation is shown in Table 2. Results of other methods are in general slightly better. Nevertheless, direct comparison is not possible as is, since the other works use mostly CT and only in three cases ordinary MR images, but not perfusion MR ones. The difference lies in the fact that perfusion images must be taken in a shorter time period, since they have to capture the location of the contrast agent at a precise instant, and obtain a complete series before the contrast has ended its diffusion. This in turn generates images with a lower-dynamic range and less contrast than their CT or MR counterparts.

Table 2 Results of other liver segmentation methods

The experiments were carried out on a modern computer with a Pentium Xeon running at 1.9 GHz and equipped with 64 Gb of RAM. Most of the computation time is spent building the atlas, especially calculating the distance function for each manually segmented shape and estimating the liner model, all of which may take up to 50 min. Nevertheless, the atlas or atlases used are built off-line and are valid for every new case. The real time spent segmenting a new shape is between 4 and 5 min per iteration, the worst case being that of two iterations. Nevertheless, the convergence is not theoretically guaranteed, even intuitively it seems reasonable since the shape of the thresholded atlas, and that of the currently segmented shape, become more similar as segmentation proceeds; this means that the atlas almost immediately adopts a stable position and orientation. But to prevent a lack of convergence, a limit has been set at four algorithm iterations, and a warning has been added to advise the user that results might be suboptimal.

At present, it takes about 10 min for an expert radiologist to correct the segmentation; this must be added to the either 5 or 10 min (depending on the number of iterations). The total time employed would therefore be less than 20 min. This is still far less time than the 90–120 min that it takes to perform a manual segmentation of the roughly 130 slices that compose each exploration.

The most significant source of errors in the results is due to the deficient segmentation of the terminal part of the left lobe of the liver. A particularly interesting case is that shown as a second example in Fig. 7. The absence of 2D or 3D borders in the MR images, because of the reduced contrast of perfusion MRI and its close proximity to the spleen, makes its segmentation extremely difficult, and this is usually the area where manual corrections have to be applied.

5 Conclusion

A new technique has been developed that segments the liver automatically in perfusion MR images for which there are ongoing tests and refinements in a wider database of clinical cases. Although other methods have been presented in the past, they do not use perfusion images directly, a major characteristic of which is that they have less contrast, since they have to be taken faster. For this reason, the results are not yet comparable with these methods, with Dice coefficients in the order of 0.90–0.94. However, the primary interest is in investigating the possibility of working with diffuse borders, by making inferences about border presence in close slices and integrating data about the borders from different sources (curvature anisotropic filter and Canny edges) together with anatomical information provided by a probabilistic atlas and learning based on the results of a previous step. It is our opinion that precise detection of the limits of the liver tissue at each slice may be of benefit to algorithms based on viscous reconstruction, such as ours, but also for those based on level sets which need a criterion to stop the evolution of a curve.

For the future, more extensive work needs to be done to find reliable limits for the free parameters of the algorithm and to ascertain its sensitivity. Also, a specific method for left-lobe segmentation in these low contrast images is being developed. Routines have already been programmed that determine a small spacial area where the left lobe can be found with a high certainty.