1. Introduction
With the modern development of science and technology, surgery is advancing to a new level, largely due to computer systems that perform the complex calculations necessary for successful surgical interventions [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12]. To support surgeons, it is essential to develop and implement new computer systems and models for preoperative planning [
2,
3,
4]. Computer modeling of complex biological systems uses a variety of methods and tools to study the structure, dynamics, and functions of living organisms and their components. Using such systems, surgeons can determine the optimal tactics and extent of surgical interventions for each patient, a concept that has evolved significantly in recent decades [
13,
14].
Hemangiomas are the most common benign vascular tumors in children, affecting up to 10% of infants and accounting for up to 50% of all neoplasms in this demographic [
5,
7,
15]. Although clinically considered non-malignant, hemangiomas are characterized by rapid, progressive growth that can destroy surrounding tissues and cause significant cosmetic and functional damage [
8,
9,
16]. While diagnosing external hemangiomas is straightforward, the key question of whether to treat and how to treat remains unsolved [
5,
6]. The debate continues over immediate intervention versus a “wait-and-see” approach [
17]. Current combination treatments do not always yield excellent results, necessitating research into new methods that utilize innovative technologies [
18]. A successful outcome must achieve excellent oncological, functional and cosmetic results.
The surgical removal of hemangiomas is often the best solution for small formations in non-critical cosmetic areas (for example, for men, this could be the back, the legs, etc.). Such a procedure is typically performed under general anesthesia, where the tumor and a few millimeters of healthy tissue are removed. For deeply grown hemangiomas, the decision for surgery depends on its size and depth [
19,
20]. Pre-surgical measures, such as medication or radiation, are sometimes used to reduce tumor size.
An analysis was conducted on the structure, etiology, and management of human hemangiomas. Infantile hemangioma is the most prevalent tumor in the neonatal period. Its incidence varies: approximately 1.1–2.6% of neonates are affected according to [
21], rising to 4–10% by 12 months of age. There is a strong female predominance, with a female-to-male ratio of about 2–3:1 (some reports suggesting 3:1–5:1). Clinical presentation typically occurs shortly after birth. About 30% of hemangiomas are present at birth, while the remaining approximately 70% emerge within the first month of life. When a neonate presents with one hemangioma, there is 75% likelihood of developing additional during the first six months.
Currently, a number of hemangioma treatment methods exist [
10,
11]. Unfortunately, they do not always help, so surgical intervention is inevitable. Planning a high-quality surgical intervention for hemangioma treatment is extremely difficult because existing methods are based on the averaged statistical data and fail to account for individual anatomical variations [
4]. Computer planning technologies, including virtual modeling, can significantly simplify a doctor’s work, help to avoid errors and prepare surgeons for unforeseen complications [
22,
23,
24,
25]. The primary goal of computer planning is to select the least traumatic surgical approach for a patient based on their specific anatomy. This research was conducted to develop simulation tools to assist surgeons in planning hemangioma treatment.
2. Materials and Methods
2.1. Mathematical Description of Biological Surface
Traditional methods for determining the need for treatment often assume a rounded shape for hemangiomas, which is rarely the case in reality (
Figure 1) [
12]. In our previous work [
10,
11] the irregular boundary of the hemangioma (
Figure 2a) was projected onto a 2D plane (
Figure 2b) and partitioned into distinct segments based on curvature. Specifically, the concave region of the contour, labeled as segment 1–5 in
Figure 2b, was approximated using a third-degree polynomial (1), while the more complex convex region, labeled as segment 9–16, was modeled with a fifth-degree polynomial (2). This piecewise approach allowed for a more precise fit to the non-uniform shape.
In the method of determining the indications for the treatment of hemangiomas in children [
12], it is believed that hemangioma has a rounded shape. But this is not always the case (
Figure 1). In general, hemangioma always has an irregular shape. Based on the results presented in previous works [
10,
11], the periphery of the hemangioma shown in
Figure 1, left-hand side image, was partially approximated (concave part, points 1–5
Figure 2b and convex part, points 9–16) by polynomials of the third and fifth degrees, presented in Equations (1) and (2), respectively.
where G is an additional correction factor.
For irregular shapes, the size and area of the hemangioma are determined approximately [
12] typically, using a transparent film marked with squares, by placing the film on the hemangioma and estimating the area of the hemangioma by the sum of the squares and half-squares covering the hemangioma.
To more accurately determine the area and volume of irregularly shaped hemangiomas, we propose a method using computer technology. From a photograph, the hemangioma’s boundaries can be outlined using image processing software [
26,
27]. By applying a mesh of triangular elements within these boundaries, we can calculate not only its area, but also its volume and construct 3D model [
28]. This model, combined with patient-specific metabolic parameters, allows for predicting the dynamics of hemangioma growth over time. To construct a refined model, we use the following equations to determine the volume (V), mass (m), mean density (
), and center of mass (
,
,
) in Cartesian and cylindrical coordinates. This requires establishing a reliable coordinate system, a challenge discussed in broader neuroimaging contests [
29,
30,
31].
In this work, a method for determining the area of the hemangioma using triangular elements is proposed. Let us assume, a patient M. has a hemangioma (
Figure 2a). It consists of 41,127 calculated triangular elements (linear element of the size 4 × 10
−4 m, providing a resolution of 0.4 mm).
To construct a refined model of hemangioma, we will use the following equations, for example, determining the volume of hemangioma (3, 7), its mass (4, 8) through Cartesian and cylindrical coordinates and densities (5), as well as the coordinates of its center (6):
Here, represents the physical density of the hemangioma tissue at a given spatial coordinate (in units such as g/mm3), and is distinct from any pixel intensity or color values from the input images. For the purpose of mass estimation, this can be approximated as a uniform value based on typical biological tissue densities or informed by other imaging modalities.
Furthermore, when determining the surface area of a hemangioma,
, the biomechanical properties of the overlying skin must be considered. The skin is stretched by the underlying tumor mass, and this tension affects the true surface area. We account for this using the following conceptual relationship:
where
is the geometrically calculated surface area and
is a dimensionless skin elasticity coefficient. This coefficient accounts for age-dependent changes in skin elasticity; as skin ages, its elasticity modulus changes, making it stiffer and less extensible. Taking this into account is crucial for accurate surgical planning, particularly for estimating the tissue requirements for wound closure after excision.
2.2. 3D Surface Reconstruction from 2D Images
The method of determining the coordinates on the surface of the hemangioma model when point M passes into point M
0 is visualized in
Figure 3 and new coordinates recalculation is described by Equations (10) and (11).
An image of derived hemangioma representation in space is shown in
Figure 4.
where the angle
is calculated as
, where
Let us consider a regular surface in parametric form. A regular surface is a set of points M(x, y, z) of 3-dimensional space, the coordinates x, y, z of which are determined from the following relations:
where x(u, v), y(u, v), z(u, v), are smooth functions of their arguments, and the following relation holds:
The term ‘rank’ refers to the number of linearly independent column (or row) vectors in the matrix. This condition ensures that the tangent vectors
and
are linearly independent at every point, which guarantees the existence of a unique, non-degenerate tangent plane to the surface at that point.
The domain D is some region on the plane of parameters u, v. The equations given above are called parametric equations of the surface. They are often written in vector form:
In this case, the point M lies on the surface and will be defined by two parameters M(u, v). For example, consider the surface of a sphere with the radius R. The equation of the sphere has the following form:
It is convenient to choose spherical coordinates
,
as parameters. Then the parametric equations will take the following form:
Let the region of change in parameters u, v be the following region D:
It should be noted that this spherical example and its specific parameter limits are provided for illustrative purposes only to explain the concept of a parametric surface. They were not used in the reconstruction of the hemangioma model, where the parameter domains are defined by the physical extent of the captured 2D cross-sections.
In the region D, there are also two lines u = const and v = const. Using these lines, a coordinate grid can be constructed in the region D. This grid can then be mapped onto an element of the spherical surface using proper equations. If we calculate the partial derivatives with respect to the parameters (u, v) of the radius vector r(u, v), we can find the tangent vectors to the surface under consideration.
The normal vector can be found as the cross product of the tangent vectors:
To find the projections of the normal vector, it is convenient to write the cross product in determinant form:
The condition in the definition of a regular surface means that at each point M of a regular surface there is a tangent plane, and this plane changes continuously as the current point M moves along the surface. The tangent vectors and the normal vector change continuously. The equation of the tangent plane passing through the point M belonging to this surface will have the following form. Let the coordinates of this point be equal to M(x
0, y
0, z
0). Let the normal vector N to the surface at this point also is known. Then the equation of the tangent plane will have the following form:
A plane is a 2-dimensional object, so it can, like any surface, be described by two parameters using parametric equations.
If the figure does not have sharp bends and depressions, then its three-dimensional shape can be recreated using radial sections. The corresponding sections can be obtained by taking photographs when rotating the figure at fixed angles. Depending on the optical properties (e.g., surface reflectivity and color) of the hemangioma, it is desirable to photograph the section on a contrasting background: a light background with a dark surface of the figure, or a dark background with the foreground of the figure illuminated. This will allow binary image processing to be applied to highlight the contour of the figure and determine the coordinates of the radial section. As a result, we have a set of data in a combined coordinate system for the specified angles of section θ: . The input data is a polar coordinate system in the plane of the base xy of the figure , and the output data is the height of the figure z. If the figure has an axis of symmetry, then it is convenient to place it at the origin of the plane xy. Therefore, the discrete coordinates r will have both positive and negative values relative to the axis of symmetry of the figure.
The quality of the 3D reconstruction is fundamentally dependent on the characteristics of the image acquisition system. For this application, desirable camera features include high spatial resolution to resolve fine surface details, high bit depth (e.g., 12-bit or 14-bit) to capture subtle gradations in color and intensity, and excellent color fidelity to ensure accurate clinical representation. Furthermore, the use of standardized, diffuse lighting is critical to minimize specular reflections and hard shadows, which can be misinterpreted by reconstruction algorithms and introduce surface artifacts.
2.3. Computational Model Development and Software Implementation
To develop and validate the simulation model, a physical phantom with a complex surface analogous to a hemangioma was created. This phantom was rotated at 30° intervals and photographed to generate a set of six 2D cross-sections. The graphical representations of these cross-sections, shown in
Figure 5, served as the input data for the software workflow described below. This phantom-based approach allowed for a controlled evaluation of the reconstruction algorithm. The clinical case shown in
Figure 2 serves as an example of the type of input image the finalized system is designed to process.
The LabVIEW 2021 software (National Instruments, Austin, TX, USA) was used for data processing and model development. LabVIEW is a graphical programming environment where programs, known as Virtual Instruments (VIs), are created. Each VI consists of a front panel, which serves as the user interface, and a block diagram, where graphical icons representing functions are connected by wires to control the flow of data. This dataflow paradigm is highly suited for applications involving measurement, automation, and signal processing. The block diagrams and screenshots shown in
Figure 6,
Figure 7,
Figure 8,
Figure 9,
Figure 10 and
Figure 11 represent the data processing logic implemented in our system.
The input data, representing the surface height at different sections (
Figure 6), are read from separate files as numerical values.
The output data representing height coordinates z
i relative to x
i are sequentially read from separate files, the names of which coincide with the corresponding intersections y
k:
These data are then approximated using polynomial dependencies to achieve the best fit. A general polynomial is performed using the
General Polynomial Fit VI, a standard function within the LabVIEW analysis library. This VI takes arrays of independent (X) and dependent (Y) data, along with a specified polynomial order, and returns the set of polynomial coefficients that best fits the data using a least-squares method. This VI was used to obtain the polynomial coefficients (
) for chosen polynomial order (N = 13). The choice of a 13th-order polynomial was determined empirically by evaluating a range of orders; this value was found to provide the optimal balance between accurately fitting the complex cross-sectional contour of our phantom model and avoiding the instability and overfitting that can occur with excessively high-order polynomials. A block diagram implementing polynomial approximation presented in
Figure 7.
The executive elements of the listed operations are combined into a custom virtual device implementing polynomial approximation. The result is a two-dimensional matrix A, where each row
k contains the coefficients а
k0 … а
kn, corresponding to a specific intersection
y:
The results of calculating the coefficients are shown in
Figure 8.
Each column
i of this matrix corresponds to a coefficient
ai at different cross-section coordinates. This allows for establishing a functional dependence through another layer of polynomial approximation:
The specified action is implemented by the corresponding cyclic structure shown in
Figure 9.
The final result is a matrix of coefficients B (
Figure 10), which allows for the reconstruction of the surface height
z for any given
x and
y coordinates (26). This spline-based approach is effective for reconstructing complex 3D shapes from 2D data [
32].
The result of the calculation is a two-dimensional matrix of coefficients
(
Figure 10): the
i-th row
is used to calculate the coefficient
. Therefore, the obtained matrix of coefficients allows us to reproduce the surface
z for arbitrary values of the parameters
x and
y:
In our case, M = 5, N = 12.
This dependence is implemented in LabVIEW environment and is shown in
Figure 11. To be able to use the obtained data in other programs using additional software, the coefficient matrix is imported into an external data file.
3. Results
3.1. Three-Dimensional Model Construction and Visualization
The final stage of modeling is the construction of the 3D surface (
Figure 12). Developed method allows for the recreation of a complex surface from a series of 2D images using polynomial approximation, which is less computationally intensive than other known 3D modeling techniques used for this purpose [
33,
34]. The accuracy can be enhanced by increasing the number of radial section or the order of the polynomials. This is analogous to how computer tomography slice thickness affects 3D reconstruction quality [
19,
35].
As a result, based on frontal images of the object, taken from various angles forming wide viewing sector, a method for reconstructing a 3D surface using polynomial approximation is proposed. Specifically, a special case of the Lagrange polynomial is employed, as it allows for efficient modeling of complex surfaces with reduced computational effort compared to conventional 3D modeling techniques. In this approach, the surface is represented by a matrix of coefficients with dimensions 9 × 6 or 13 × 6. If higher accuracy is required, it can be achieved by increasing the number of terms in the polynomial series and the number of radial sections used in the reconstruction.
We also developed software implementing Non-Uniform Rational B-Splines (NURBS) to create smooth, organic shapes ideal for biological modeling [
25]. Unlike polygon-based models, NURBS surfaces are inherently smooth and can be scaled without loss of detail, making them superior for this application.
The software receives input data from a medical camera to generate a spatial model of the hemangioma. An operator can then place two arbitrary points on the model to calculate the required resection size and assess the tumor’s depth based on its topography (
Figure 13). The use of such models in clinical practice is growing, particularly for planning complex interventions with technologies like interoperative MRI and electromagnetic navigation [
36,
37,
38,
39].
In developing a three-dimensional qualitative model of a hemangioma, spline modeling was chosen over polygonal modeling due to its higher accuracy and scalability. Unlike polygonal models, spline-based models maintain consistent quality during scaling and approximation. In spline modeling, the shape of the hemangioma is defined by a set of curves distributed along the equator of a reference sphere. This approach enables the generation of a smooth surface that can be scaled with a user-defined level of precision, which can be specified during the prototyping stage. In contrast, polygonal models often exhibit varying level of detail across different planes, leading to inconsistencies in surface representation.
3.2. Surgical Planning Error Analysis
An analysis of the main errors in planning surgical interventions was conducted. The total positioning error of the surgical instrument (
) is a combination of the visualization error (
) and the mechanical positioning error of the manipulator (
) [
40,
41,
42].
The guidance error is considered, which, in the general case, for root mean square errors
and
with the correlation coefficient could be determined according to the equation:
Given the lack of correlation between errors in determining coordinates (visualization) at the “hemangioma—healthy tissue” boundary and positioning of the (mechanical) surgical instrument, we obtain the value of the resulting root mean square error of the instrument positioning:
The visualization error is influenced by factors like imaging resolution and registration accuracy [
43,
44,
45,
46]. Given the high correlation of errors from image-based calculations, the hemangioma visualization error is defined as:
where—
is the error in data representation from radial sections, calculated as:
and its value is determined basing on the considerations that the spatial resolution errors by coordinates are equal to half the spatial resolution values of the three-dimensional model by the corresponding coordinates,
,
(the numbers are indicated for the three-dimensional model used in the work, built based on high-resolution radial cross-section data);
— is the error in determining the healthy tissue boundary;
— is the methodological error in defining the coordinates of the surgical area center.
This results in a mean square visualization error of .
Positioning error of the surgical instrument by the manipulator
is determined by the errors
of the mechanical part of the drives in each of the 3 degrees of freedom, respectively:
and which will consist of the following values: backlash
, movement unevenness (tolerance for kinematic error
), from shaft twisting
, from the supports gap
, the clutch
and temperature instability
according to the following equation:
where ∗ denotes the index of each of the 3 degrees of freedom of the surgical instrument in the manipulator.
The error values are calculated according to the manuals for mechanical transmissions and they depend on the specific numerical characteristics of the drive design. Based on the above-specified, the error of the positioning of the surgical instrument by the mechanical subsystem of the manipulator is set (
). Taking into account these considerations, the resulting error in the positioning of the surgical instrument practically does not increase and equals to 2.27 mm. Accurately estimating and compensating for these errors is a key challenge in computer-assisted surgery [
47,
48,
49]. The largest contributor to this error is the coordinate visualization, which can be reduced by using higher-resolution medical imaging devices and refining calculation methodologies [
30], in which the target point will be displayed relative to certain reference landmarks and directly visualized without recalculation algorithms that introduce errors due to the complexity of accounting for the parameters of individual anatomical variability. The obtained error values are given in
Figure 14.
In the fifth data group, the linear regression equation (
Figure 15) has the following form:
The standard deviation of the residual series values is: S = 0.579.
Average approximation error: .
Since the average approximation error is 5.6%, the quality of the constructed model can be assessed as good, since the average approximation error does not exceed 10%.
The graph of the coincidence of the calculated resection parameters with the actual ones is shown in
Figure 16.
The adequacy of the linear regression model was further confirmed by an analysis of its residuals. The residual plot (
Figure 17), which shows the difference between predicted and actual values, displays a random pattern with no discernible structure, indicating that the model’s assumptions are met. This, along with a high coefficient of determination (R2), confirms the model’s goodness-of-fit.
The model’s quality was assessed as good, with an average approximation error of 5.6%, which is well below the acceptable threshold of 10%.
3.3. Discriminant Analysis of Resection Parameters
A discriminant analysis was performed on five parameters influencing the outcome of hemangioma resection: skin elasticity, tumor volume, tumor weight, tumor density and a correction factor (P) for shape and size.
The Mahalanobis distance to compare these parameters in normal versus pathological states, and is calculated using the following equation:
where
,
and
,
are the average value and standard deviation of the corresponding indicators, where
. The probability of a decision error will be determined by the following equation:
Five informative parameters were chosen for calculations.
Table 1 shows the results of the calculations of the discriminant characteristics of these five parameters.
and
represent the state of the control object in normal and pathological conditions, respectively.
The analysis showed that the computer-assisted model which includes additional mathematical coefficients, increased the Mahalanobis distance for tumor density and the P-factor by 2.3 and 2.89, respectively, while reducing the probability of error by 14% compared to traditional assessment. In
Figure 18a,b, the curve labeled ‘Traditional Planning’ represents the result of calculating the discriminant characteristics of the five parameters on which the surgeon relied when performing surgical interventions. The curve labeled ‘Computer-Assisted Planning’ represents the result of the calculation based on the parameters used by our preoperative planning system.
Figure 18b demonstrates that all parameters significantly influence the probability of making a diagnostic decision and, therefore, cannot be excluded from the analysis. The practical impact of the dimensionality of the informative parameter space on the probability of preoperative planning errors is also illustrated.
The total time required to apply this methodology for a single patient case, from initial image acquisition to the generation of a final 3D model for preoperative planning, is estimated to be approximately 3 to 4 h. This timeline includes approximately 30 min for standardized photographic image acquisition and system setup, 2 to 3 h for semi-automated image processing and computational modeling, and a final 30 min for surgeon review and interactive planning with the generated 3D model.
3.4. Limitations and Future Work
A primary limitation of this study is its scope as a proof-of-concept, demonstrating the feasibility of our proposed method on a limited dataset. We have rigorously validated the computational accuracy of the model, achieving a low average approximation error of 5.6%. However, a large-scale clinical validation study is required to compute robust statistical metrics such as diagnostic accuracy, sensitivity, and specificity. Such a study would involve applying the method to a large cohort of patients and comparing the model-based surgical plans to actual surgical outcomes, which constitutes the next phase of our research.
5. Discussion and Conclusions
This research addresses the urgent need for advanced modeling of complex biological objects by presenting a novel method for creating 3D models for preoperative planning of hemangioma surgery. The initial phase of hemangioma is marked by rapid growth, followed by slow and inevitable involution. Current treatment strategies are largely empirical and often unsatisfactory, primary due to limited understanding of the cellular and molecular mechanisms underlying hemangioma development. Progress in elucidating its programmed biological behavior is hindered by the absence of an accurate human model.
Accurate diagnosis and effective treatment require determination of the tumor type, growth characteristics, structure, and anatomical location. Existing methods for surgical planning often rely on generalized “average person” data, which fails to account for individual anatomic variations, making high-quality interventions challenging. The integration of computer-assisted planning technologies can substantially enhance surgical outcomes by expediting the planning process, minimizing the human error, anticipating potential intraoperative complications, and identifying strategies to mitigate such risk. The primary objective of computer-assisted planning is to identify, among numerous possible surgical pathways, the least traumatic approach tailored to the patient’s unique anatomy.
Our use of computer planning technologies can significantly accelerate and simplify the surgeon’s workflow, reduce errors, and improve patient outcomes. We successfully developed a method for generating a 3D surface model from 2D images using polynomial approximation and spline modeling, which is more accurate and scalable than traditional polygonal modeling.
In constructing a 3D qualitative model of hemangioma, spline modeling was chosen over polygonal modeling due to its superior accuracy and consistent quality during scaling. In this method, the hemangioma shape is defined by a series of curves aligned along the equator of a reference sphere. The spline-based surface can be scaled to any desired level of precision, specified during the prototyping stage. In contrast, polygonal models often exhibit inconsistent detail across different planes.
The 3D reconstruction method presented in this paper, based on polynomial and spline interpolation of 2D cross-sections, offers a distinct balance of accessibility, cost, and accuracy for modeling external biological surfaces. It is important to contrast this approach with other established techniques. Volumetric methods using CT or MRI data provide comprehensive 3D models of both surface and internal structures but are associated with high costs, patient radiation exposure (in the case of CT), and may not be readily available. In contrast, our image-based method is low-cost and non-invasive. Compared to other image-based techniques like photogrammetry, which require numerous images from unstructured viewpoints, our approach simplifies the data acquisition and processing by using a structured rotational capture. Furthermore, while active scanning methods like structured light or laser scanning can yield highly accurate surface models, they necessitate specialized hardware, whereas our method can be implemented with a standard digital camera, making it highly accessible for a wide range of clinical settings.
Dedicated software was developed for preoperative planning of surgical interventions on hemangiomas. The software process input data acquired from a medical imaging device to construct a spatial model of the hemangioma. The user can select two arbitrary points on the model to compute the resection dimensions. Based on the reconstructed surface geometry (including protrusions and depressions), the depth of the tumor relative to healthy tissue can be estimated.
Errors in surgical planning were quantitatively evaluated. The primary source of guidance error was found to be visualization error of coordinate points ( = 2.24 mm). This can be significantly reduced by improving the resolution of imaging devices and enhancing the accuracy of computational methods. In particular, ensuring that the target point is visualized relative to anatomical variability.
Discriminant analysis identified five parameters that significantly influence the outcome of hemangioma resection: skin elasticity coefficient, tumor volume, tumor mass, tumor density, and a correction factor P, which accounts for the shape and size of the hemangioma. The adequacy of the proposed three-dimensional spline-based model was validated using Fisher’s and Student’s criteria, demonstrating statistical significance across all five examined groups.
Despite the promising results, we acknowledge several limitations of the current study. First, the accuracy of our 3D reconstruction is highly dependent on the quality of the input 2D images; factors such as inconsistent lighting, low resolution, or patient movement during image capture can introduce errors into the final model. Second, this study serves as a proof-of-concept, and the methodology has been tested on a limited number of cases. Future work should involve a larger clinical study to validate its robustness across a diverse range of hemangioma sizes and shapes. Third, our method models the surface topography and does not provide information on the tumor’s internal vasculature or depth of tissue invasion, which must be assessed using complementary imaging modalities like MRI or ultrasound. Finally, while polynomial and spline modeling are effective, future research could explore alternative 3D reconstruction techniques, such as photogrammetry or structured light scanning, which may offer improved accuracy or a more streamlined workflow.
This works provides a robust, accurate and economically viable solution to enhance the precision of hemangioma surgery, contributing to the ongoing evolution of the “operating room of the future”.