1 Introduction

Acalculous biliary pain (ABP), which has been a variety of names such as right upper quadrant pain, functional gallbladder (GB) disorder, biliary dyskinesia, GB dysmotility and ampullary stenosis, is a common clinical problem [1]. The frequency of ABP has been shown to be 7.6% in men and 20.7% in women [2]. Since 1990′s, laparoscopic cholecystectomy (LC) has been performed on patients with ABP after cholescintigraphy or ultrasound scans with cholecystokinin (CCK) infusion [3,4,5,6,7,8,9,10]. Unfortunately, the patients with persistent symptom still can be as many as 20% after LC [2]. More recently, clinical trials have been carried out in [10,11,12,13,14,15,16,17,18,19,20,21,22,23]. It was shown that the majority of ABP patients can have resolution of painful symptom, but the GB bile ejection fraction (EF) determined in cholescintigraphy or ultrasound scans doesn’t predict outcome and the patients with normal GB EF are subject to a less benefit form LC.

A few meta-analyses on the existing outcome after LC based on CCK-cholescintigraphy or ultrasound scans for ABP patients were performed [24,25,26,27], and it was indicated that the use of EF to select patient with suspected ABP is not supported, even though the symptom is more significantly relived than nonoperative therapy; consequently, randomized clinical trials are on demand [24, 25, 28, 29]. To standardize the trials and make the outcomes of different trials comparable, a protocol was recommended based on 0.02 µg/kg sincalide over 60 min with normal EF specified ≥ 38% [30]. A pilot randomized controlled trial of LC was launched in [31] based on that protocol for 30 ABP patients.

ABP can involve biomechanical factors. For instance, GB smooth muscle is subject to an impaired contractile capacity in response to CCK [32], and the smooth muscle to fibrosis layer thickness ratio might be associated with abnormal EF [33]. These two factors can alter the bile pressure in a GB and the stress level in the GB wall. Bearing this fact in mind, the total (active plus passive) peak stress was estimated at the beginning of GB emptying phase during a CCK-ultrasound scan examination based on an ellipsoid model in [34, 35]. It turned out that the peak stress can correlate to the ABP symptom well. Even though the ellipsoid model can be easily applied in clinical trials, it likely underestimates the stress level in the GB wall based on the stress in the sheep GB wall predicted by finite element analysis (FEA) in terms of a thin-walled membrane mechanical model [36]. Since the stress level in a GB wall is related to GB pain threshold application and pain prediction outcome, further validations on the stress level are desirable based on real GB shapes.

Actually, ultrasound/ultrasonography has been proven to be a sensitive non-invasive and simple screening tool in the diagnosis of biliary tract and GB disorders since 1970′s. Significant contributions in this issue can be found in [37,38,39,40,41,42,43,44,45,46,47,48,49,50] to name a few. Simultaneously, ultrasound was applied to investigate GB motor function or motility by determining its real-time volume during the emptying/contraction phase to help surgeons in the diagnosis of GB diseases [51,52,53,54,55,56,57,58,59,60].

Even though three-dimensional (3D) ultrasound can measure GB real-time volume accurately, it has been difficult yet in obtaining 3D GB geometrical models for FEA so far [58,59,60,61,62]. To extract real-time GB geometrical models from ultrasound images, image registration is required. Because of artifacts and speckle in ultrasound images, automatic registration of GB ultrasound image in 3D ultrasound systems remains to be an unsolved problem right now [62].

Automatic segmentation methods have been proposed for two-dimensional (2D) ultrasound static long-axis/sagittal view images of GB based on pixel grey level [63,64,65] or brightness [66] or intensity [67]. However, in these interesting studies, there are not any 3D GB geometrical models produced.

In this article, a method for generating human GB 3D geometrical models was developed based on two static ultrasound 2D images of human GBs scanned in the long-axis/sagittal and short-axis/transverse directions, respectively. The GB bile volumes of the 3D geometrical models were calculated and compared with those from the ellipsoid model and sum-of-cylinders method in [51, 52, 58]. The geometrical models were meshed in ABAQUS and FEA on them was performed based on a homogenous, isotropic, thin shell mechanical model. Additionally, the peak stress was compared with that in the ellipsoid model in [35]. A mean peak stress level ratio from the FEA was obtained against the GB ellipsoid model and the peak stress underestimation extent of the ellipsoid model was validated.

2 Images and Numerical Method

2.1 Ultrasound Images of Human GB

A series of two ultrasound static 2D images of human GB scanned in the long-axis/sagittal and short-axis/transverse directions has been obtained from a teaching hospital for seven patients. The images at the beginning of emptying phase are shown in Fig. 1 to reflect a variety of GB shapes. These images were taken when the patients were routinely inspected for GB diseases with an ordinary clinical ultrasound system. The hospital did not provide us with system parameter settings and patient information when the images were scanned. Such information seems to be unimportant here because the method for generating GB 3D geometrical models was concerned only in the paper.

Fig. 1
figure 1

Static ultrasound 2D images of seven human GBs at the beginning of emptying phase

2.2 Numerical Method

In the images shown in Fig. 1, there are two views only: one is in the long-axis plane where one longitudinal GB cross-section is presented; the other is in the short-axis/transverse plane where one cross-section with the maximum cross-sectional area is specified. The two images in these two views must be utilized to generate 3D GB geometrical models. There are three steps in the method, as demonstrated in Fig. 2.

Fig. 2
figure 2

Flowchart of method for creating GB geometrical models based on known ultrasound images

In the first step, GB ultrasound images are segmented manually in MATLAB with a custom program to decide scattered points of GB wall edges. Then, two edges are generated by fitting the points with the piecewise cubic spline function in MATLAB. The closed short-axis cross-section is lofted and the GB volume is calculated. Finally, the data files of short-axis cross-sections and guide lines are made for SolidWorks.

In the second step, GB short-axis cross-sections and guide line profiles are established in SolidWorks, and a surface is lofted with these profiles, the surface is enclosed with a small sphere cap in the apex of GB fundus. Geometrical model information exchange files in the initial graphics exchange specification (IGES) and Parasolid formats are prepared for ABAQUS or ADINA to perform FEA under a specific bile pressure and boundary condition.

In the third step, a geometrical model information exchange file is read into ABAQUS or ADINA. A mesh is created and a FEA is conducted by means of homogenous isotropic thin shell solid mechanics model with a certain thickness and a specific internal bile pressure load as well as a boundary condition.

Figure 3 illustrates the scattered points of GB 36 wall edges, fitted short-axis and long-axis cross-sections, surface of the GB wall, GB surface presentation and a quadrilateral mesh for FEA in ABAQUS.

Fig. 3
figure 3

Segmentation (a), short-axis cross-section fitting (b), long-axis cross-section fitting (c), cross-section lofting in SolidWorks (d), generated GB wall surface (e), and quadrilateral mesh for finite element analysis for GB 36 (f)

In the second step, GB cross-section curve fitting, lofting and volume calculation are the essential in 3D GB geometrical model generation. The details of the MATLAB code for accomplishing these functions are as follows:

  1. (1)

    Determine image scales based on marks and number figures in the images in Fig. 1;

  2. (2)

    Read data files of two edges scattered points are made in the previous segmentation;

  3. (3)

    Calculate the geometrical centre coordinates of the short-axis/transverse cross-sectional curve (xc, yc), determine the polar-coordinate system (θ, r), and perform the curve fitting with the MATLAB spline function r = csape(θ, r,’periodic’), which is cubic spline interpolation with end conditions, the coordinates of the edge are (xc + r cosθ, yc + r sinθ);

  4. (4)

    Locate the middle point of GB neck (yfneck, zfneck) and specify it as the reference point of the long-axis/sagittal cross-section edge scattered points, determine the other reference point (\(y_{b\hbox{max} }\), \(z_{b\hbox{max} }\)) at which the maximum length is achieved from the middle point (yfneck, zfneck), rotate the cross-section edge points in an angle of \(- \tan ^{{ - 1}} \left[ {\left( {y_{{{\text{bmax}}}} - y_{{{\text{fneck}}}} } \right)/\left( {z_{{{\text{bmax}}}} - z_{{{\text{fneck}}}} } \right)} \right]\) to allow the cross-section to be laid horizontally in the new coordinates (\(y_{rot}\), \(z_{rot}\)), compute the arc length \(s\) of the scattered points from the first one to the last one in the neck, define the MATLAB spline function z = csape(\(s\), \(z_{\text{rot}}\), \(q\)), y = csape(\(s\), \(z_{\text{rot}}\), \(q\)), and \(q = {1 \mathord{\left/ {\vphantom {1 {\left[ {1 + {{\left( {z_{\text{rot2}} - z_{\text{rot1}} } \right)^{3} } \mathord{\left/ {\vphantom {{\left( {z_{\text{rot2}} - z_{\text{rot1}} } \right)^{3} } 6}} \right. \kern-0pt} 6}} \right]}}} \right. \kern-0pt} {\left[ {1 + {{\left( {z_{\text{rot2}} - z_{\text{rot1}} } \right)^{3} } \mathord{\left/ {\vphantom {{\left( {z_{\text{rot2}} - z_{\text{rot1}} } \right)^{3} } 6}} \right. \kern-0pt} 6}} \right]}}\) is the end condition parameter, \(z_{\text{rot1}}\) and \(z_{\text{rot2}}\) are the horizontal coordinates of the first and second scattered points after rotation, then the rotated scattered points are interpolated, the reference point (\(y_{b\hbox{max} }\), \(z_{b\hbox{max} }\)) is searched again, and the angle of rotation is updated, and the points are rotated accordingly, the MATLAB spline function is redefined, and a subsequent interpolation is launched once more; such a cycle is repeated for five times until the sagittal cross-section is horizontal exactly;

  5. (5)

    Interpolate more dense scattered points with the functions defined in (4), divide the whole long-axis cross-section edge into two parts: i.e. upper and lower parts, determine the location where the maximum height in the long-axis cross-section occurs, rescale the existing short-axis cross-section height and insert this cross-section into the long-axis cross-section orthogonally;

  6. (6)

    Specify the short-axis cross-section at the GB neck and the short-axis cross-section near the GB fundus apex are a circle, and then loft the rest short-axis cross-sections from three existing short-axis cross-sections based on the ratio of a local short-axis cross-section height to the maximum short-axis cross-section height;

  7. (7)

    Calculate the volume of GB by summarizing the volumes of each truncated cone formed by two neighbouring short-axis cross-sections, this method is slightly more complex than the sum-of-cylinders method [51, 52, 58];

  8. (8)

    Write the Cartesian coordinates (\(x_{surf}\), \(y_{surf}\), \(z_{surf}\)) of all short-axis cross-section edges (lofted plus existing) into separate data files for SolidWorks, and the Cartesian coordinates of the long-axis cross-section edges in the horizontal and vertical planes are also written into data files for SolidWorks as guide lines.

3 GB Shape, Volume and FEA

3.1 GB Shape

GB wall surfaces of the rest six GB samples, which were generated by means of the method mentioned above, are illustrated in Fig. 4. It is shown that GB 1 and 17 present a pear shape, while GB 9, 30 and 36 in Fig. 3 exhibit a slender structure, but GB 19 and 37 are in an odd shape.

Fig. 4
figure 4

GB wall surfaces of six GB samples, generated by a custom MATLAB code

3.2 GB Bile Volume

The bile volumes of seven GB samples have been calculated based on the ellipsoid model with three major axis lengths measured in each 3D model dimensions from the image and the 3D model itself, respectively. The ellipsoid model [35] and its original 3D model for the image of GB 36 are illustrated in Fig. 5a, b as an example. The GB volume was estimated by means of the sum-of-cylinders method [51] and presented in the figure, too. The ellipsoid model volume is calculated by the expression \(V_{el} = {{\pi d_{1} d_{2} d_{3} } \mathord{\left/ {\vphantom {{\pi d_{1} d_{2} d_{3} } 6}} \right. \kern-0pt} 6}\) [52, 58], the formula of the sum-of-cylinders method for GB volume can be found in [51, 52, 58]. The GB volume of 3D model is due to the method in Sect. 2.2. A comparison of GB volume is made between three methods in Fig. 5c and Table 1.

Fig. 5
figure 5

GB 3D model from the image of GB 36 (a), its corresponding ellipsoid model with three major axis lengths such as d1, d2 and d3 (b), GB volumes based on ellipsoid model, sum-of-cylinders method and 3D model from the images of seven GB samples (c), and regressed relationships of V3D to Vel and Vsc, respectively (d)

Table 1 Comparison of GB volumes estimated with three methods

The GB volumes from 3D models, \(V_{{ 3 {\text{D}}}}\), are consistently larger than those from the simple ellipsoid model, \(V_{\text{el}}\), across all the GB samples with an error in the range of (0.8–29.2) % and the mean of 20.1%, which is basically close to a similar value of 15.0% in [58]. The GB volumes from the tedious sum-of-cylinders method, \(V_{\text{sc}}\), are basically smaller than those from 3D models with an error in (− 8.9 to 0.4)% and the mean of − 4.4%. Even though there is a noticed difference in GB volume across three methods, the GB volumes from 3D models can correlate to the volumes predicted with the sum-of-cylinders and ellipsoid models very well, respectively, as shown in Fig. 5d.

This fact suggests that the method for generating 3D GB geometrical model from 2D ultrasound images proposed in the article is meaningful and reliable. Since GB volume from the ellipsoid model or sum-of-cylinders method is always higher or smaller than that from the 3D model, the ellipsoid method still can be used clinically due to its simplicity. Specially, one can use the correlations in Fig. 5d to predict a nearly true GB volume based on either \(V_{\text{el}}\) or \(V_{\text{sc}}\).

3.3 FEA

Seven 3D GB geometrical models were put into ABAQUS 6.11 standard to carry out a linear FEA with an aim to identify whether the geometrical models can be applicable in FEA and what the stress pattern and level are different from those based on the analytical solution of an ellipsoid GB geometrical model in [35]. The material property constants and the model parameter setting in FEA are presented in Table 2.

Table 2 Property constants of GB wall and parameter settings in FEA

The Young’s modulus is 500 kPa approximately based on the experimental data summarized in [68], and the Poisson’s ratio 0.49 is chosen for incompressible GB wall. The GB wall thickness was assumed to be 2.5 mm uniform [35]. Thin shell elements used in the FEA are included by choosing type S3 (3-node triangular general-purpose shell) and S4 (4-node quadrilateral general-purpose shell) elements. The pressure load was applied on the GB inside surface, and the load magnitudes are patient-specific and referred to [35]. The boundary condition was imposed in the GB neck inlet by fixing six degrees of freedom. The convergence tolerance is the default value of \(1 \times 10^{ - 5}\) in displacements in ABAQUS. The independence of mesh size and effects of Young’s modulus are demonstrated in Appendix. The results achieved with mesh1 in Table 5 are shown the following sections.

The ratio of the maximum first principal in-plane stress in a 3D GB geometrical model to the counterpart in its ellipsoid model, i.e. \(S = {{\sigma_{1,3D} } \mathord{\left/ {\vphantom {{\sigma_{1,3D} } {\sigma_{1,e} }}} \right. \kern-0pt} {\sigma_{1,e} }}\), is shown in Fig. 6 to quantity the difference in stress level between two geometrical models. The first principal in-plane stress in the ellipsoid model was calculated based on the method in [35]. Clearly, under the same loading condition and material property constants, the stress level in the 3D geometrical model is higher than that in the ellipsoid model across the samples. The mean ratio is 1.76 with 0.11 standard deviation.

Fig. 6
figure 6

The first principal in-plane stress ratio of seven GB samples, it is defined as the ratio of the maximum first principal in-plane stress in a GB 3D geometrical model, \(\sigma_{1,3D}\), to the counterpart in its ellipsoid model, \(\sigma_{1,e}\), \(S = {{\sigma_{1,3D} } \mathord{\left/ {\vphantom {{\sigma_{1,3D} } {\sigma_{1,e} }}} \right. \kern-0pt} {\sigma_{1,e} }}\)

The contours of the first principal in-plane stress across seven 3D GB geometrical models are illustrated in Fig. 7. Further, the location for the maximum stress is coincident with the location for the largest strain, as shown in Fig. 8.

Fig. 7
figure 7

Contours of the first principal in-plane stress in seven GB 3D geometrical models

Fig. 8
figure 8

Contours of the first principal in-plane strain in seven GB 3D geometrical models

Since the curvature of the cross-sectional edge changes significantly in the short-axis/transverse plane, see Fig. 3b, the stress exhibits a bumpy variation, particularly with compression (negative) stress. In the contour of the first principal stress given by the analytical method based on the ellipsoid model in [35] demonstrates a bumpy characteristic as well, but in a different pattern and without compression stress, see Fig. 9 for GB 36.

Fig. 9
figure 9

Contour of the first principal in-plane stress in GB36 due to ellipsoid model and analytical method in [35]

These facts suggest that the GB ellipsoid model provides us with a simple clinical biomechanical model, however, its volume and stress level estimated can be lower by a certain factor than those based on 3D GB geometrical models from ultrasound images. Note that the contour of the first principal in-plane stress from the more realistic 3D GB models can differ from the pattern produced based on the ellipsoid model and analytical method.

4 Discussions

In the paper, a numerical method was proposed to establish human 3D GB geometrical models from static ultrasound 2D images in the long-axis/sagittal and short-axis/transverse cross-sections in routine biliary disease diagnosis at the beginning of emptying phase in hospital. The extracted 3D models were adopted to estimate GB volume in MATLAB, stress level and distribution in ABAQUS and the corresponding results were compared with those due to the existing ellipsoid model and analytical method [35]. The idea and work are original, and have not been indicated in the literature, and can be meaningful in biomedical engineering and ABP diagnosis.

The cubic spline function in MATLAB was chosen to fit the scattered points in the long-axis/sagittal and short-axis/transverse cross-sections for the edges. The function can represent the complex edge shape of human GB wall. In [69], the Fourier series with five terms was utilized to fit the scattered points in the short-axis/transverse cross-section. Initially, this method was employed to perform the fitting task. However, the fitted curve is unable to pass through the scattered points picked up from the image simultaneously, as seen Fig. 10 for GB 36. However, the fitted curve generated by the cubic spline function passes through the points and can preserve the edge geometrical feature. Thus, the cubic spline function in MATLAB was favoured in the paper.

Fig. 10
figure 10

A comparison of fitting curves established by Fourier series [69], circle and cubic spline function in MATLAB for the scattered points in the short-axis/transverse cross-section of GB 36

In Figs. 3 and 4, seven human GB samples exhibit a variety of shapes. Fortunately, these GB shapes can be observed in GB 3D volumes rendered computed tomography (CT) cholangiographic images shown in Fig. 11 [48]. Among these shapes, GB 1 has a similar shape to the GB in Fig. 11a to some degree, so does GB 17 to the GB in Fig. 11b, GB30 to the GB in Fig. 11c, GB 36 to the GB in Fig. 11d, GB 19 to the GB in Fig. 11e and GB 37 to the GB in Fig. 11f. This information suggests that the method proposed in the paper is sensitive to GB shape.

Fig. 11
figure 11

GB 3D volumes rendered computed tomography (CT) cholangiographic images at the beginning of emptying phase, ag GB pictures are after [48]

Honestly, the paper is subject to a few limitations. Firstly, the method was not validated directly by using a balloon filled by liquid or 3D ultrasound data or magnetic resonance imaging (MRI) images of GB, because these kinds of data are lack in open source databases presently. However, an indirect validation has been made in Sect. 3.2 in terms of GB bile volume. The mean errors in GB bile volume calculated by the ellipsoid model and the sum-of-cylinders method are 20.1% and − 4.4% against the 3D GB geometrical model, respectively, in the paper. In [58], the corresponding mean errors of the ellipsoid model and the sum-of-cylinders method are 15.0% and 2.7% against the GB bile volume determined by 3D ultrasound system. Thus, the bile volume based on the 3D GB geometrical model in the paper seems to be reasonable and its accuracy in GB volume estimations can be considered at least equivalent to those of the ellipsoid model and the sum-of-cylinders method.

Secondly, human GB wall can exhibit both anisotropic and nonlinear behavior in biomechanical property shown by in vivo computational biomechanics approach [36, 70, 71] and by in vitro uniaxial tensile test [72, 73]. However, in the paper, GB wall property has been considered isotropic and linear, even though the geometrical nonlinearity was involved when the biomechanical model being set up in ABAQUS. During the emptying phase of human GB, there are both active and passive tensions. The passive tension and anisotropic property can be modelled by using the numerical approach and fibre structure presented in [71]. The method for modelling the active tension developed in human GB in the emptying phase has been unavailable at all so far.

Thirdly, in a linear numerical GB biomechanical analysis, the reference configuration can be the same as the current configuration. However, the reference configuration should be different from the current configuration because the strain can be quite large in a nonlinear numerical GB biomechanical analysis. Accordingly, a reference configuration must be known in advance in the nonlinear analysis. How to determine the reference configuration for a GB based on in vivo ultrasound images remains unknown currently. Nonetheless, active tension modelling and reference configuration determination will be two key issues in nonlinear human GB biomechanics during the emptying phase.

Based on GB volume predicted, the method proposed herein is equivalent to the ellipsoid model or sum-of-cylinders method in accuracy based on two-view ultrasound images. However, the method in the paper can produce a more realistic GB shape in terms of the comaprison with the existing GB volumes rendered from CT images. Consequently, the stress and strain levels and patterns in terms of such a shape may more likely close to the true values and patterns than those based on the existing GB ellipsoid model. These 3D GB shapes potentially can be applied to GB shape analysis by using principal component analysis (PCA) method to correlate the shape features to GB pain score in the future. Note that the method is preliminary and further validations performed by radiologists or other experts are on demand.

5 Conclusions

A numerical approach was proposed to establish 3D GB geometrical models from existing static 2D long-axis/sagittal and short-axis/transverse cross-sectional ultrasound images scanned in routine GB disease diagnosis practice in hospital at the beginning of emptying phase. GB volumes of the geometrical models were extracted and compared with those estimated with well-known ellipsoid model and sum-of-cylinders method. The models were read into SolidWorks for surface generation and then involved in ABAQUS for FEA analysis based on homogenous isotropic linear material and thin shell mechanical model. The results were discussed against those of the ellipsoid model. The approach developed in the article can create a satisfactory 3D geometrical model from the ultrasound images of human GB. The GB volumes from 3D geometrical models are different from those estimated by using the ellipsoid model and sum-of-cylinders method with 15.5% and − 4.4% mean errors, respectively, but can correlate positively to the latter with a correlation coefficient as large as 0.99. The first principal stress level in the 3D geometrical models can be higher than that in the ellipsoid model by a factor of 1.0–2.63 with the mean of 1.76. The bumpy stress pattern in the 3D geometrical models is significantly deviated from that in the ellipsoid model. The method proposed potentially can be applicable in clinical diagnosis of GB disease and GB shape analysis in terms of principal component method in the future. The forthcoming work includes generating 3D GB geometrical models in the whole emptying phase, determining GB reference configuration, identifying anisotropic nonlinear material properties of GB wall in passive state, and modelling active behavior of GB wall in the emptying phase based on the generated 3D models.