A CT liver anatomical structure intelligent processing method and system for clinical planning
By using deep learning segmentation models and 3D reconstruction algorithms, the time-consuming and labor-intensive problems in the diagnosis and surgical planning of liver diseases have been solved, achieving high-precision segmentation and 3D modeling of liver anatomical structures, thus improving clinical applicability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HANGZHOU PUJIAN MEDICAL TECH CO LTD
- Filing Date
- 2026-02-09
- Publication Date
- 2026-05-22
Smart Images

Figure CN121662263B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of medical imaging technology, and in particular to a method and system for intelligent processing of CT liver anatomy structure for clinical planning. Background Technology
[0002] With advancements in medical imaging technology, CT scans have become a crucial basis for the diagnosis and surgical planning of liver diseases. Currently, in clinical practice, the analysis of the liver and its internal blood vessels and anatomical segments mainly relies on manual or semi-automatic analysis by physicians on two-dimensional tomographic images. This process is not only time-consuming and labor-intensive but also easily influenced by subjective experience, limiting its understanding and quantitative assessment of three-dimensional spatial relationships. Although existing deep learning technologies can achieve automatic segmentation of liver regions, problems such as topological breaks and blurred boundaries are common in the precise segmentation of fine vascular tree structures such as the portal vein and hepatic veins, as well as Couinaud segments. Existing solutions typically lack a systematic and automated evaluation process to verify whether the segmentation results can directly meet the requirements of high-precision surgical planning. Furthermore, subsequent quantitative analysis and three-dimensional interactive modeling are often separated from the segmentation process, making it difficult to form an integrated and standardized clinical analysis report generation process, thus limiting its reliability and efficiency in complex preoperative planning. Summary of the Invention
[0003] The purpose of this invention is to provide an intelligent processing method and system for CT liver anatomy structure for clinical planning, in order to overcome the shortcomings of the existing technology, and to achieve seamless integration from CT images to three-dimensional modeling and quantitative analysis, thereby improving the accuracy and clinical applicability of liver anatomy structure segmentation.
[0004] One embodiment of this application provides an intelligent processing method for CT liver anatomy structures for clinical planning, the method comprising:
[0005] Receive CT image data from imaging equipment or hospital information system, and perform preprocessing operations such as voxel resampling, grayscale standardization and orientation correction on the CT image data;
[0006] The deep learning segmentation model deployed on the server is used to infer the preprocessed CT image data, identify and segment the vascular tree structure of the liver parenchyma, portal vein and hepatic vein, as well as the Couinaud segment, and obtain the vascular tree structure and segmentation results of the liver segment.
[0007] Based on the aforementioned vascular tree structure and liver segmentation results, the integrity of vascular topology, the continuity of liver segment boundaries, and the model confidence index are comprehensively evaluated to determine whether the segmentation results meet the quality standards for clinical surgical planning.
[0008] If the segmentation results meet the quality standards, an interactive 3D mesh model of the liver, blood vessels, and liver segments is generated using a 3D reconstruction algorithm.
[0009] Based on the three-dimensional mesh model, the volume of each liver segment is calculated, the surgical resection range is simulated, the future remaining liver volume is estimated, and the proximity relationship between the lesion and key blood vessels is measured to generate a structured analysis report for preoperative planning.
[0010] Another embodiment of this application provides an intelligent processing system for CT liver anatomy structures for clinical planning, the system comprising:
[0011] The receiving module is used to receive CT image data from imaging equipment or hospital information system, and to perform preprocessing operations such as voxel resampling, grayscale standardization and orientation correction on the CT image data.
[0012] The inference module is used to perform inference on the preprocessed CT image data using a deep learning segmentation model deployed on the server, to identify and segment the vascular tree structure of the liver parenchyma, portal vein and hepatic vein, as well as the Couinaud segment, and to obtain the vascular tree structure and liver segment segmentation results.
[0013] The evaluation module is used to comprehensively evaluate the integrity of the vascular topology, the continuity of the liver segment boundaries, and the model confidence index based on the vascular tree structure and the liver segmentation results, and to determine whether the segmentation results meet the quality standards of clinical surgical planning.
[0014] The generation module is used to generate an interactive 3D mesh model of the liver, blood vessels, and liver segments using a 3D reconstruction algorithm if the segmentation results meet the quality standards.
[0015] The calculation module is used to calculate the volume of each liver segment, simulate the surgical resection range, estimate the future remaining liver volume, and measure the proximity relationship between the lesion and key blood vessels based on the three-dimensional mesh model, and generate a structured analysis report for preoperative planning.
[0016] Another embodiment of this application provides a storage medium storing a computer program, wherein the computer program is configured to execute the method described in any of the preceding claims when running.
[0017] Another embodiment of this application provides an electronic device including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the method described in any of the preceding claims.
[0018] Compared with existing technologies, the present invention provides an intelligent processing method for CT liver anatomy structure for clinical planning, which can achieve seamless integration from CT images to three-dimensional modeling and quantitative analysis, thereby improving the accuracy and clinical applicability of liver anatomy structure segmentation. Attached Figure Description
[0019] Figure 1 Hardware structure block diagram of a computer terminal for a clinical planning-oriented intelligent processing method for liver anatomical structures based on CT scans provided in this embodiment of the invention;
[0020] Figure 2 A flowchart illustrating an intelligent processing method for CT liver anatomy structure for clinical planning, provided by an embodiment of the present invention;
[0021] Figure 3 This is a schematic diagram of a CT liver anatomy structure intelligent processing system for clinical planning, provided as an embodiment of the present invention. Detailed Implementation
[0022] The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.
[0023] This invention first provides an intelligent processing method for CT liver anatomy structure for clinical planning. This method can be applied to electronic devices, such as computer terminals, specifically ordinary computers.
[0024] The following detailed explanation uses a computer terminal as an example. Figure 1 This is a hardware structure block diagram of a computer terminal for a clinical planning-oriented intelligent processing method of CT liver anatomy structures, provided in an embodiment of the present invention. Figure 1 As shown, the computer device includes a processor, memory, and network interface connected via a system bus, wherein the memory may include non-volatile storage media and internal memory.
[0025] See Figure 2 The embodiments of the present invention provide an intelligent processing method for CT liver anatomy structure for clinical planning, which may include the following steps:
[0026] S201, Receive CT image data from imaging equipment or hospital information system, and perform preprocessing operations such as voxel resampling, grayscale standardization and orientation correction on the CT image data;
[0027] Specifically, it can receive raw CT image sequence data and parse the DICOM header file to obtain raw voxel size, scan matrix and patient orientation information;
[0028] This step is the initial stage of CT image preprocessing. Its core is to accurately parse the DICOM standard file and extract key metadata from the image, providing a foundation for subsequent standardized operations and ensuring the targeted and accurate nature of the preprocessing. The specific implementation method is as follows:
[0029] The system receives raw CT image sequence data from clinical CT scanning equipment or hospital PACS systems via an image receiving interface compatible with the DICOM 3.0 standard. The data is transmitted as a series of DICOM files, each corresponding to one CT slice. The number of slices in the sequence depends on the scan range, typically 100-300 (e.g., a liver scan from the top of the diaphragm to the lower edge of the liver requires approximately 150 slices). During reception, the system automatically verifies file integrity by checking the completeness of DICOM file tags (such as patient ID, examination date, modality type, and other required tags) and file continuity (incrementing slice numbers with no missing segments). This prevents subsequent processing errors due to data transmission loss or corruption. If a missing segment is detected, a retransmission request is triggered.
[0030] The DICOM header parsing uses a dedicated medical image processing library, focusing on extracting three core metadata types: raw voxel dimensions, scan matrix, and patient orientation information. Raw voxel dimensions describe the length, width, and height of a single voxel in three-dimensional space, in millimeters (mm), and are stored in DICOM tags (0028, 0030). For example, the raw voxel dimensions of a CT image are "1.0mm × 1.0mm × 5.0mm," indicating a voxel side length of 1.0mm and a slice thickness (z-axis) of 5.0mm in the plane (x, y axes). This parameter directly determines the spatial resolution of the image. The scan matrix records the pixel arrangement scale of the CT image and is stored in tags (0028, 0010) and (00... In 28,0011), for example, "512×512" means that each slice consists of 512 rows and 512 columns of pixels. The matrix size is positively correlated with the image's ability to render details. The patient orientation information defines the image's orientation in the patient's body coordinate system and is stored in the label (0020,0037) as a direction string, such as "LPS" (Left-Posterior-Superior), indicating that the image's x-axis points to the patient's left, y-axis points to the rear, and z-axis points to the top. This information is used for subsequent spatial orientation correction.
[0031] During the parsing process, the system validates the metadata. For example, the x and y axis side lengths of voxel dimensions are typically between 0.5 and 2.0 mm, and the z-axis layer thickness is between 1.0 and 10.0 mm. If the parsed voxel size is "0.3 mm × 0.3 mm × 15.0 mm", and the z-axis layer thickness exceeds the normal range, the system will mark it as "abnormal layer thickness" and record it for special handling during subsequent resampling. The scan matrix must be an integer power of 2 (e.g., 256 × 256, 512 × 512). If the parsed result is "400 × 512", a "non-standard matrix" message will be displayed, but the data will still be retained for further processing to ensure compatibility. After parsing, the three types of metadata are bound and stored with the image sequence to generate an "image metadata list," providing parameter support for subsequent preprocessing steps.
[0032] Based on the preset standard voxel resolution, the original CT image sequence is isotropically resampled, and the voxel spatial size of all slices is unified by a trilinear interpolation algorithm to generate voxel-standardized image data.
[0033] The core objective of this step is to achieve voxel isotropy, eliminating the resolution difference between the original image in the slice thickness direction (z-axis) and the planar direction (x, y-axis), thus providing a uniform spatial reference for subsequent 3D reconstruction and structural segmentation. The specific implementation method is as follows:
[0034] The preset standard voxel resolution is determined based on the detailed requirements of clinical liver anatomy, using an isotropic resolution of 1.0mm × 1.0mm × 1.0mm. This resolution clearly presents details of the liver parenchyma and small blood vessels (such as the third-order branches of the portal vein, approximately 1-2mm in diameter) while controlling the data volume to avoid excessive redundancy (if the resolution is too low, such as 2.0mm × 2.0mm × 2.0mm, information on small blood vessels will be lost; if it is too high, such as 0.5mm × 0.5mm × 0.5mm, the data volume will increase to eight times, increasing the processing burden). The standard resolution can be adjusted through the system configuration interface to adapt to different clinical scenarios (e.g., precise tumor resection planning can be adjusted to 0.8mm × 0.8mm × 0.8mm).
[0035] The core of isotropic resampling is to supplement missing data in the layer thickness direction through interpolation algorithms, transforming the original non-uniform voxels into uniform voxels. A trilinear interpolation algorithm is employed. This algorithm is based on the gray values of six neighboring voxels (x±1, y±1, z±1) in 3D space, and calculates the gray value of the target voxel through linear weighting, with the formula V(x,y,z)=Σ(ω_i×V_i), where ω_i is the weight of neighboring voxels (the closer to the target voxel, the greater the weight), and V_i is the original gray value of the neighboring voxels. This algorithm balances interpolation accuracy and computational efficiency, avoiding significant artifacts.
[0036] The resampling process uses the metadata of the original image to calculate the number of target slices and the interpolation interval: Number of target slices = Original scan range (total length of z-axis) / standard voxel z-axis side length, Original scan range = Original voxel z-axis side length × (Number of original slices - 1). For example, if the original voxel z-axis side length is 5.0 mm, the original number of slices is 150, the scan range = 5.0 × 149 = 745 mm, the number of target slices = 745 / 1.0 = 745 slices, and the interpolation interval is 1.0 mm. During resampling, the system first fixes the voxel size in the x and y axes (retaining or adjusting it to 1.0 mm from the original 1.0 mm), and then performs dense interpolation in the z-axis direction. For example, if the original 1st and 2nd slices are 5.0 mm apart, after resampling, 4 interpolated slices are inserted between them so that the distance between adjacent slices is 1.0 mm. The grayscale value of the interpolated slices is calculated using a trilinear algorithm.
[0037] After resampling, voxel-standardized image data is generated, with all voxels having a uniform spatial size of 1.0mm×1.0mm×1.0mm. The number of slices in the image sequence is updated synchronously (e.g., from 150 to 745) to ensure consistent resolution in any direction in three-dimensional space. This provides a uniform spatial basis for subsequent vascular segmentation and liver segment division, avoiding three-dimensional structural distortion caused by excessive slice thickness (e.g., small blood vessels may be blurred in the original thick-slice image, but can be clearly presented after resampling).
[0038] The HU value truncation and linear stretching algorithm is applied to the voxel-normalized image data to map the gray values to the standard soft tissue window width and window level range, eliminating the intensity differences between different scanning devices and protocols, and generating gray-normalized image data.
[0039] This step aims to eliminate grayscale differences caused by different CT equipment and scanning parameters, unifying image grayscale to a standard range, and providing a stable input feature distribution for deep learning models. The specific implementation method is as follows:
[0040] HU (Hounsfield Unit) is a grayscale measurement standard for CT images. Different tissues correspond to fixed HU value ranges. The HU value of liver parenchyma is usually between 40-80 HU, the HU value of portal vein and hepatic vein is between 60-100 HU (arterial phase of contrast-enhanced scanning), adipose tissue is between -100 and -50 HU, air is -1000 HU, and bone is above +1000 HU. Due to differences in CT equipment models, scanning voltages (e.g., 120kV vs. 140kV), and milliampere-seconds (e.g., 200mA vs. 300mA) between different hospitals, the HU value of the same tissue may fluctuate (e.g., the HU value of liver parenchyma scanned in Hospital A is 30-70 HU, while in Hospital B it is 50-90 HU). Standardization is required through HU value truncation and linear stretching.
[0041] The standard soft tissue window width and level range is set specifically for liver anatomy, with a window width of 400 HU and a window level of 50 HU. This range clearly distinguishes liver parenchyma, blood vessels, lesions, and surrounding soft tissue. The truncation range is [window level - window width / 2, window level + window width / 2], i.e., [50-200, 50+200] = [-150 HU, 250 HU]. During the HU value truncation operation, all pixel grayscale values below -150 HU in the image are uniformly set to -150 HU (such as air areas), and pixels above 250 HU are set to 250 HU (such as bones or calcifications). This avoids the impact of extreme HU values on subsequent stretching while preserving the core grayscale information of the liver and blood vessels.
[0042] The linear stretching algorithm maps the truncated HU value range [-150HU, 250HU] to an 8-bit grayscale range of 0-255, which facilitates fast model processing. The mapping formula is G=[(HU-HU_min) / (HU_max-HU_min)]×255, where HU_min=-150, HU_max=250, and G is the stretched grayscale value (0-255 integer). For example, if the original HU value of a pixel is 40 HU (liver parenchyma), after stretching, G = [(40-(-150)) / (250-(-150))]×255 = (190 / 400)×255≈121; if the HU value of a blood vessel pixel is 80 HU, after stretching, G = [(80+150) / 400]×255≈146. Through this mapping, the HU values of the liver and blood vessels scanned by different devices are unified to the grayscale range of 0-255, and the relative grayscale relationship remains unchanged (the HU value of blood vessels is higher than that of liver parenchyma, and the grayscale value is still higher after stretching).
[0043] After stretching, grayscale-standardized image data is generated, with the grayscale value of all pixels between 0 and 255. Intensity differences caused by different scanning devices and protocols are eliminated. For example, the grayscale range of liver parenchyma in Hospital A is 80-120, while that in Hospital B is 100-140. After standardization, both are mapped to 80-120, ensuring that the input feature distribution received by the deep learning model is consistent, improving the model's generalization ability, and avoiding a decrease in segmentation accuracy due to grayscale differences.
[0044] Based on the direction cosine matrix in the DICOM header file, the grayscale standardized image data is corrected in terms of spatial coordinate system and orientation to ensure that the orientation of the liver anatomical structure in three-dimensional space is consistent with the standard anatomical coordinate system, and finally, preprocessed standardized CT data is generated.
[0045] This step corrects the spatial orientation of the images to ensure that the orientation of the liver's anatomical structures conforms to clinical anatomical practices, providing a unified spatial benchmark for subsequent 3D reconstruction, structural segmentation, and surgical planning. The specific implementation method is as follows:
[0046] The standard anatomical coordinate system uses the RAS (Right-Anterior-Superior) coordinate system. This system is defined as follows: the positive x-axis points to the patient's right side, the positive y-axis points to the patient's front, and the positive z-axis points to the patient's upper side. It is a commonly used spatial reference system in clinical surgical planning, directly reflecting the relative position of the liver to surrounding organs (e.g., the main portal vein is located posterior to the right of the liver). The spatial orientation of the original CT image is defined by the direction cosine matrix (tags 0020, 0037) in the DICOM header file. This is a 3×3 matrix, with each row corresponding to the direction cosines of the image's x, y, and z axes relative to the standard anatomical coordinate system's x, y, and z axes, respectively. The direction cosines are used to calculate the angle between the image axis and the standard axis, determining whether the image orientation conforms to the RAS standard.
[0047] The core of orientation correction is to spatially rotate or flip the grayscale-normalized image data based on the orientation cosine matrix, aligning the image axes with the RAS coordinate system axes. For example, if the orientation cosine matrix of an original image is [[-1,0,0],[0,-1,0],[0,0,1]], it means that the image's x-axis points to the left of the patient (opposite to the RAS x-axis), the y-axis points behind the patient (opposite to the RAS y-axis), and the z-axis points upwards (consistent with the RAS z-axis). In this case, the image needs to be flipped along the x and y axes. After correction, the image's x-axis points to the right and the y-axis points forward, consistent with the RAS coordinate system. The orientation correction calculation process is as follows: for the spatial coordinates (x,y,z) of each pixel, transform them using the inverse of the orientation cosine matrix to obtain the corrected coordinates (x',y',z'). Then, rearrange the image pixels according to the new coordinates to ensure that the spatial orientation conforms to the standard.
[0048] During the correction process, the system must maintain the correspondence between pixel grayscale values and spatial positions to avoid structural misalignment caused by rotation or flipping. For example, if the left lobe of the liver is on the left side of the original image, it should be located on the left side of the RAS coordinate system (the patient's right side) after correction, consistent with the actual anatomy. At the same time, the correspondence between slice numbers and spatial positions needs to be recalculated after correction, generating new metadata records (such as the corrected slice z-axis coordinate range and orientation label "RAS") to ensure that the three-dimensional spatial morphology of the liver can be correctly constructed during subsequent 3D reconstruction.
[0049] The final preprocessed and standardized CT data has three core features: voxel isotropy (1.0mm×1.0mm×1.0mm), grayscale normalization (0-255 range), and spatial orientation conforming to the RAS standard. It fully meets the input requirements of deep learning segmentation models and provides a unified and standardized data foundation for subsequent vascular topology extraction, liver segmentation, and 3D visualization, ensuring the consistency and reliability of the entire processing flow.
[0050] S202 utilizes a deep learning segmentation model deployed on the server to infer the preprocessed CT image data, identify and segment the vascular tree structure of the liver parenchyma, portal vein and hepatic vein, as well as the Couinaud segment, and obtain the vascular tree structure and liver segment segmentation results.
[0051] Specifically, the pre-processed standardized CT data can be sent to a server with a CUDA-accelerated deep learning framework via a RESTful API, and a pre-trained vascular segmentation network can be loaded for forward inference to generate an initial vascular probability map containing the portal vein and hepatic vein.
[0052] This step is the initial stage of vascular structure identification. Its core is to accurately output the probability distribution of vascular presence through standardized data transmission and high-performance model inference, laying the foundation for subsequent vascular structure extraction. The specific implementation method is as follows:
[0053] The preprocessed, normalized CT data is in a three-dimensional tensor format with dimensions [H, W, D] (e.g., 512×512×745), pixel values ranging from 0 to 255, corresponding to normalized grayscale information. The data is encapsulated in NIfTI format to ensure cross-platform compatibility. The RESTful API acts as a communication bridge between the client and server, using the HTTP / 1.1 protocol and the POST request method. The request header includes "Content-Type:application / json" and "Authorization:Tokenxxx" (authentication token to ensure secure data transmission). The request body includes the data storage path (a distributed storage address accessible to the server) and inference parameters (e.g., "infer_speed:fast" and "precision:high"). For example, the API request body sent by the client might be: {"data_path":" / storage / ct / 20250101 / patient123.nii.gz","infer_speed":"fast","precision":"high"}.
[0054] The server-side deployment uses a PyTorch-based deep learning framework and an NVIDIA Tesla V100 GPU, accelerated by CUDA 11.6. A single GPU can process two CT data sets in batches, achieving an inference speed of 5 seconds per case, meeting real-time clinical requirements. The pre-trained vessel segmentation network employs a hierarchical context bridging structure, consisting of an encoder, a bridging module, and a decoder. The encoder contains four convolutional blocks, each consisting of two 3×3×3 convolutional layers, a BatchNorm layer, and a ReLU activation function. Downsampling is achieved through convolutions with a stride of 2, capturing multi-scale features (e.g., a 1×1×1 receptive field captures small vessels, and a 7×7×7 receptive field captures main vessels). The bridging module fuses the deep and shallow features of the encoder through skip connections, compensating for the loss of detail caused by downsampling. The decoder uses transposed convolutions for upsampling, ultimately outputting an initial vessel probability map with the same dimensions as the input CT data.
[0055] During forward inference, the server first parses the API request, loads normalized CT data from the specified path, normalizes it to the [-1,1] interval (consistent with the model training data distribution), and then inputs it into the vessel segmentation network. The network simultaneously identifies the portal vein and hepatic vein through multi-scale receptive fields. Features of the main vessels (diameter > 3mm) are captured by deep convolution, while features of peripheral small branches (diameter 1-3mm) are captured by shallow convolution. In the initial vessel probability map output, each pixel value is a floating-point number between 0 and 1, representing the probability that the location is a vessel. For example, a pixel value of 0.85 indicates that there is an 85% probability that the location is a vessel; a pixel value of 0.12 is likely to be liver parenchyma or background. The probability map has two channels, corresponding to the portal vein and hepatic vein respectively. For example, the probability value of channel 0 (portal vein) in the main portal vein region is concentrated between 0.7 and 0.95, and the probability value of channel 1 (hepatic vein) in the main hepatic vein region is concentrated between 0.65 and 0.9, achieving preliminary differentiation between the two types of vessels.
[0056] The initial vascular probability map is thresholded and post-processed morphologically to extract the binary mask of the vascular structure. The skeletonization algorithm is then applied to generate the vascular centerline, and a vascular topology map is constructed with bifurcation points as nodes and centerline segments as edges to generate vascular topology data.
[0057] This step refines the vascular probability map through post-processing, extracts the real vascular structures from the probability distribution, and constructs their topological relationships to provide anatomical basis for liver segmentation. The specific implementation method is as follows:
[0058] The thresholding operation aims to transform the probability map into a binary mask (containing only two types of pixels: blood vessels and background). The threshold is automatically calculated using an adaptive thresholding method (Otsu algorithm). This algorithm determines the optimal threshold by maximizing the inter-class variance, avoiding omissions or misclassifications caused by fixed thresholds. For example, the optimal threshold for the portal vein probability map is calculated to be 0.52, and for the hepatic vein probability map it is 0.48. Pixels in the probability map with a value above the threshold are set to 1 (blood vessels), and those below the threshold are set to 0 (background), resulting in preliminary binary masks for the two types of blood vessels. For any small holes (diameter < 2 mm, non-anatomical significance) and isolated noise points (area < 5 pixels) that may exist in the mask, morphological post-processing is performed: first, a dilation operation (1 iteration) is performed using 3×3×3 spherical structuring elements to fill the small holes; then, an erosion operation (1 iteration) is performed to remove isolated noise points, ultimately obtaining a continuous and complete binary mask for blood vessels. For example, the portal vein mask forms a continuous tree-like structure in the left lobe of the liver, without breaks or isolated fragments.
[0059] The skeletonization algorithm employs the Zhang-Suen fast parallel thinning algorithm. This algorithm iteratively removes edge pixels from the vascular mask while retaining centerline pixels, ensuring the centerline width is 1 pixel and maintaining the topological connectivity of the blood vessel. During the algorithm iteration, only pixels that meet three conditions are deleted: "non-endpoint," "number of neighboring pixels between 2 and 6," and "deletion does not disrupt connectivity," avoiding over-thinning that could lead to centerline breakage. For example, the mask width of the portal vein trunk is 8 pixels. After skeletonization, a continuous centerline is generated with a coordinate sequence of [(x1,y1,z1),(x2,y2,z2),...,(xn,yn,zn)], where the spacing between adjacent coordinates is 1 voxel (1 mm), accurately reflecting the direction of the blood vessel.
[0060] The construction of the vascular topology map is based on the centerline, and the core is to identify bifurcation points and centerline segments: a bifurcation point is defined as a pixel in the centerline with a degree of ≥3 (i.e., three or more centerline branches intersect). For example, the intersection of the left and right branches of the portal vein trunk has a degree of 3 and is identified as a bifurcation point, and a unique node ID (such as Node-PV-001) is assigned; a centerline segment is defined as a segment of the centerline between two adjacent bifurcation points or between a bifurcation point and an endpoint. Each segment is assigned a unique edge ID (such as Edge-PV-001) and its attributes such as length (number of pixels × 1mm) and diameter (corresponding to the average width of the mask) are recorded. For example, the portal vein topology map includes nodes Node-PV-001 (main branch bifurcation point), Node-PV-002 (left branch bifurcation point), and Node-PV-003 (right branch bifurcation point), and edges Edge-PV-001 (Node-PV-001 to Node-PV-002, length 35mm, diameter 4mm) and Edge-PV-002 (Node-PV-001 to Node-PV-003, length 42mm, diameter 4.5mm). The final generated vascular topology data is stored in JSON format, including a list of nodes, a list of edges, and attribute information, which fully reflects the tree-like bifurcation relationship of the blood vessels.
[0061] Normalized CT data and vascular topology data are input into a pre-trained liver segmentation network. The network encodes vascular topology features through graph convolution and fuses them with image features using a cross-attention mechanism to infer segmentation probability maps of eight Couinaud liver segments, thus generating liver segment probability maps.
[0062] This step is the core of automatic liver segment identification. By fusing imaging features and vascular topological features, the segmentation results conform to the Couinaud anatomical division rules of liver segments. The specific implementation method is as follows:
[0063] The pre-trained liver segmentation network adopts an end-to-end architecture of "image feature extraction + topological feature encoding + cross-attention fusion + probability prediction". Normalized CT data is used as input to the image branch. Multi-scale image features are extracted through 4 convolutional blocks (consistent with the encoder structure of the blood vessel segmentation network) to generate a four-layer feature map with dimensions [64, 128, 256, 512]. The shallow features (64 dimensions) capture the texture details of the liver parenchyma, and the deep features (512 dimensions) capture the overall morphology of the liver and the distribution of lesions. Vascular topology data, used as input to the topology branch, is first encoded using a Graph Convolutional Neural Network (GCN). The GCN contains two hidden layers (64 nodes each) with ReLU activation. By aggregating the neighborhood features of each node (e.g., aggregating the features of Edge-PV-001 and Edge-PV-002 from Node-PV-001), the topology graph is transformed into a 64-dimensional node feature vector. Then, global average pooling is used to obtain a 128-dimensional global topology feature vector, which contains anatomical information such as the bifurcation level, length, and diameter of blood vessels.
[0064] The cross-attention mechanism is used to achieve accurate fusion of image features and topological features. Its core is to calculate the association weights of the two types of features, highlighting feature combinations relevant to liver segmentation. The mechanism includes three matrices: query (Q), key (K), and value (V). Q is generated from deep image features (512-dimensional) through linear transformation, while K and V are generated from global topological features (128-dimensional) through linear transformation. The attention weight calculation formula is Attention(Q,K,V)=Softmax(QK^T / √d_k)V, where d_k is the dimension of K (128), and √d_k is used to prevent numerical overflow. For example, the attention weight of "high grayscale value of the left lobe of the liver" in the image features and "blood supply range of the left branch of the portal vein" in the topological features is 0.83, much higher than the 0.17 for "right branch of the portal vein," indicating that the model can focus on the correspondence between liver segments and blood supply vessels. The fused feature vector has a dimension of 512, preserving both the spatial details of the image and incorporating the anatomical patterns of the blood vessels, providing a dual basis for liver segmentation.
[0065] The network's decoder upsamples the fused features to the same dimension as the input CT data through transposed convolutions, ultimately outputting a probability map of liver segments with eight channels (each channel corresponding to a Couinaud liver segment). Each pixel value is a floating-point number between 0 and 1, representing the probability that the pixel belongs to the corresponding liver segment. For example, the probability value of the channel corresponding to liver segment III in the lateral region of the left lobe is concentrated between 0.7 and 0.9, while the probability value in the right lobe region is <0.2; the probability value of the channel corresponding to liver segment V in the anterior and inferior region of the right lobe is concentrated between 0.65 and 0.85, achieving accurate probability segmentation of the eight liver segments. During network pre-training, Structural Contrast Loss (SCL) and a global memory mechanism are introduced to enhance the adaptability to multi-center CT data. For example, grayscale differences in CT data from different hospitals are compensated for by feature alignment in the memory, ensuring the consistency of the probability map segmentation.
[0066] ArgMax operation and connected component analysis are performed on the liver segment probability map to obtain discrete liver segment label maps. At the same time, spatial logic verification is performed by combining the trunk branch attribution relationship in the vascular topology data. Finally, the registered and aligned vascular tree structure and liver segment segmentation results are output.
[0067] This step, through post-processing and logical verification, transforms the probability map into a clinically usable liver segment label map, ensuring anatomical consistency with vascular structures. The specific implementation method is as follows:
[0068] The ArgMax operation is the core of converting a multi-channel probability map into a single-channel label map. For each pixel, the liver segment label corresponding to the channel with the highest probability value among the eight channels is selected (1-8 correspond to Couinaud liver segments I-VIII respectively). For example, if a pixel has a probability of 0.82 in the liver segment II channel and a probability of <0.5 in all other channels, then the label of this pixel is 2. The initial label map obtained by the ArgMax operation may contain small isolated label regions (area <100 voxels, approximately 100 mm³, which are segmentation noise) and label holes (regions without labels inside). These need to be optimized through connected component analysis: First, the area of each connected component is calculated, and connected components with an area ≥100 voxels are retained, while smaller connected components are deleted; then, a hole-filling operation is performed on the label map to fill holes with an area <50 voxels. Finally, a continuous and complete discrete liver segment label map is obtained. For example, the label region of liver segment IV covers the medial side of the left lobe of the liver, without breaks or isolated fragments, and with clear boundaries.
[0069] Spatial logic verification is based on the anatomical regularity of Couinaud's liver segments—each liver segment is supplied by a specific branch of the portal vein. The rationality of the labels is verified through the attribution relationship of the main branches in the vascular topology data. For example, according to anatomical knowledge, liver segment III is supplied by the transverse branch of the left portal vein, and liver segment VI is supplied by the posterior branch of the right portal vein. During verification, the branch to which the vascular centerline belongs within the label area of each liver segment is calculated to determine whether it is consistent with the preset blood supply branch. If the centerline of the left portal vein (which should belong to the blood supply branch of liver segment II / III) is detected in the label area of a liver segment V, it is judged as a logical anomaly, and the label of this area is corrected to liver segment II through morphological expansion; if the centerline of the posterior branch of the right portal vein is not detected in the label area of liver segment VI, the label area is expanded to the blood supply range of this branch to ensure that the liver segment division is consistent with the vascular blood supply regularity.
[0070] The registration and alignment operation ensures that the vascular tree structure and the liver segmentation results are completely consistent in spatial coordinates. By calculating the spatial overlap between the centerline coordinates in the vascular topology data and the liver segment label map, if the overlap is <95% (i.e., some vascular centerlines do not fall within any liver segment label area), the boundaries of the liver segment label map are adjusted so that the vascular centerlines are completely within the corresponding supplying liver segment. For example, if 5% of the centerline of the anterior branch of the right portal vein falls outside the label of liver segment V, the boundary of liver segment V is extended outward by one voxel to completely include the centerline. The final output consists of two parts: the vascular tree structure (binary mask + topology map) and the liver segmentation results (label map + boundary coordinates of each liver segment). The spatial registration error between the two is <1 voxel (1 mm), fully meeting the requirements of clinical surgical planning for spatial consistency of anatomical structures.
[0071] S203. Based on the aforementioned vascular tree structure and liver segmentation results, comprehensively evaluate the vascular topological integrity, liver segment boundary continuity, and model confidence index to determine whether the segmentation results meet the quality standards for clinical surgical planning.
[0072] Specifically, it can analyze vascular topology data, check whether there are breaks in the main trunks of the portal vein and hepatic vein, calculate the connectivity of branches at all levels, detect whether there are isolated vascular segments, and generate a vascular topology integrity assessment report.
[0073] This step is crucial for assessing the quality of vascular segmentation. By analyzing the node and edge relationships in the vascular topology graph, the integrity of the vascular structure is quantitatively determined, avoiding the impact of vascular rupture or absence on liver segmentation and surgical planning. The specific implementation method is as follows:
[0074] The vascular topology data is stored using a node-edge model, including the bifurcation points of the portal vein and hepatic vein (e.g., Node-PV-001, the bifurcation point of the portal vein trunk), endpoint nodes (the ends of the vessels), and the central line segments connecting these nodes (e.g., Edge-PV-001). Each edge records its length, diameter, and branch level (level 1 for the trunk, level 2 for trunk branches, level 3 for branches of branches, and so on). When checking for ruptures in the main trunks of the portal vein and hepatic vein, the trunk nodes and edges are first located: the main trunk of the portal vein is defined as the line segment edge (Edge-PV-Main) from the portal vein starting node (Node-PV-Start) to the first-level bifurcation point node (Node-PV-001), and the main trunk of the hepatic vein is the line segment edge (Edge-HV-Main) from the node where the hepatic vein merges into the portal vena cava (Node-HV-End) to the first-level bifurcation point node (Node-HV-001). By traversing the topology graph, it is determined whether there are continuous node connections on the main trunk edge. If there is no valid edge connection between the two endpoint nodes of the main trunk edge, or if the edge length is 0 or the diameter is abnormal (less than 50% of the normal trunk diameter, such as a segment with a diameter of only 3mm when the normal portal vein trunk diameter is about 8mm), then it is determined that the main trunk is broken. For example, in a certain topology data, there is no valid connection between the starting node Node-PV-Start and the bifurcation point Node-PV-001 of the portal vein trunk edge Edge-PV-Main, and no other alternative edges are detected in this area, then it is determined that the portal vein trunk is broken.
[0075] The connectivity of branches at each level is calculated on a per-branch-level basis. Connectivity is defined as the ratio of the number of connected line segments in a branch at that level to the total number of line segments in that level. The formula is C_k = (E_connected_k / E_total_k) × 100%, where C_k is the connectivity of the k-th level branch, E_connected_k is the number of edges in that level that are connected to the trunk, and E_total_k is the total number of edges in that level. The branch levels are classified according to anatomy: Level 1 is the trunk, Level 2 is the left and right branches (left and right branches of the portal vein; left, middle, and right branches of the hepatic vein), Level 3 is the segmental branches (such as the transverse and sagittal portions of the left branch of the portal vein), and Level 4 and above are subsegmental branches. For example, a second-order branch of the portal vein includes a left branch (Edge-PV-002) and a right branch (Edge-PV-003), a total of two branches, both of which are connected to the main trunk. Therefore, C_2 = (2 / 2) × 100% = 100%. A third-order branch has five branches, four of which are connected to the second-order branches, and one is disconnected. Therefore, C_3 = (4 / 5) × 100% = 80%. The connectivity threshold is set according to the order of the branches: the first-order main trunk must be ≥100% (no breaks allowed), second-order branches ≥90%, third-order branches ≥80%, and fourth-order branches and above ≥70%. Branches below the threshold are considered to have insufficient connectivity for that order.
[0076] The detection definition of an isolated vascular segment is a vascular line segment that has no connection to the trunk or any branch and has a length <10mm (corresponding to 10 voxels). By traversing all edges in the topological graph, it is determined whether the segment forms a connected path with other edges through nodes. If both endpoints of an edge are isolated nodes (without other edge connections) and the edge length is <10mm, it is determined to be an isolated segment. For example, if a vascular line segment has an edge length of 6mm, neither of its two endpoints is connected to any other edge, and there is no trunk or branch extension in this region, it is determined to be an isolated segment. Physiologically small branches (length ≥10mm and diameter ≥1mm) must be excluded during detection to avoid false positives.
[0077] The generated vascular topology integrity assessment report contains three core components: trunk integrity (e.g., "Portal vein trunk is continuous, hepatic vein trunk is unbroken"), connectivity data of branches at all levels (e.g., "Level 2 branch connectivity 100%, Level 3 80%, Level 4 75%), and isolated fragment statistics (e.g., "Two isolated fragments were detected, with lengths of 6mm and 8mm respectively, and have been marked as noise"), and indicates whether clinical standards are met (e.g., "Level 3 branch connectivity of 80% meets the standard, and the overall vascular topology integrity meets the requirements").
[0078] The boundary of each liver segment label region in the liver segmentation results is detected to identify whether there are large areas of missing parts, non-physiological holes, or areas that are severely blurred and adhered to the boundary of adjacent liver segments, and a liver segment boundary continuity assessment report is generated.
[0079] This step focuses on the spatial integrity and boundary clarity of liver segment segmentation. By analyzing the boundary features and regional morphology of the liver segment label map, the impact of segmentation errors on surgical planning is eliminated. The specific implementation method is as follows:
[0080] The liver segmentation results are presented as discrete label maps, with each segment corresponding to a unique label value (1-8), and the boundary is the intersection of different label regions. Before boundary detection, the label map is first extracted by using the Sobel gradient operator to calculate the pixel grayscale gradient. Regions with abrupt changes in gradient values are the boundaries (gradient values inside the liver segment are close to 0, and gradient values at the boundary are >50). Large-area missing areas are determined based on the liver segment volume, calculated by multiplying the number of voxels in the label map by the voxel volume (1 mm³). Large-area missing areas are defined as liver segments whose actual volume is less than 80% of their normal anatomical volume (normal anatomical volume is based on statistics from 1000 healthy individuals' CT data; for example, the normal volume of liver segment III is approximately 120 ± 20 cm³), and the missing area is concentrated in the core region of the liver segment (not the edge). For example, if the actual volume of a liver segment label map is 90 cm³, and the normal volume is 120 cm³, the ratio is 75% < 80%, and the missing area is located in the center of the liver segment without any edge gradient features, then it is determined to be a large-area missing area.
[0081] Non-physiological holes refer to blank areas within the liver segment label region that are not covered by the label, and the three-dimensional diameter of the hole is >5mm (corresponding to 5 voxels). Normal gaps formed by physiological blood vessels are excluded (the diameter of these gaps is usually <3mm, and they are surrounded by vascular labels). During detection, blank areas within the liver segment are extracted using connected component analysis. The three-dimensional circumscribed sphere diameter of each blank area is calculated. If the diameter is >5mm and there are no surrounding vascular labels, it is determined to be a non-physiological hole. For example, if there is a blank area with a diameter of 8mm within a liver segment label, and no vascular labels pass through this area and it is not connected to the external background of the liver segment, it is determined to be a non-physiological hole.
[0082] The determination of severe blurred adhesion at the boundary of adjacent liver segments is based on the gray-level gradient and label transition characteristics of the boundary region. A normal boundary has a gray-level gradient value > 50, with the label abruptly changing from one liver segment to another (e.g., from label 2 to label 3). A blurred adhesion region has a gradient value < 30 and a transition zone with a width > 3 voxels (3 mm), containing mixed label values (e.g., simultaneously including labels 2, 3, and the undefined label 0). For example, at the junction of liver segments II and III, the average gradient value is 25 < 30, the transition zone width is 4 mm, and labels 2 and 3 account for 40% and 35% respectively, while the undefined label accounts for 25%, thus indicating severe blurred adhesion at the boundary.
[0083] The vascular topological integrity assessment report includes the boundary detection results of each liver segment: large-area missing areas (e.g., "no large-area missing areas in liver segment V, actual volume of liver segment VI is 95cm³, normal volume is 125cm³, accounting for 76%, large-area missing areas exist"), statistics of non-physiological pores (e.g., "one non-physiological pore with a diameter of 6mm exists in liver segment IV, no pores exist in liver segment VIII"), and blurred boundary adhesion (e.g., "a 3mm wide blurred band exists at the boundary between liver segments II and III, the boundary between liver segments V and VI is clear"), and clarifies whether the continuity of the boundary of each liver segment meets the standard.
[0084] Extract the average confidence score of the corresponding segmented region from the probability maps output by the blood vessel segmentation network and the liver segmentation network, and compare it with a preset threshold to generate a model confidence assessment report;
[0085] This step evaluates the reliability of the segmentation results by quantifying the output confidence of the segmentation network. The confidence score directly reflects the model's certainty in judging the segmented region. The specific implementation method is as follows:
[0086] The output probability maps of the vessel segmentation network and the liver segmentation network each have a floating-point value of 0-1, representing the probability that the pixel belongs to the corresponding structure (vessel or liver segment). The segmented region refers to the set of pixels in the probability map that, after thresholding, are determined to be the target structure (vessel pixel probability ≥ 0.5, liver segment pixel probability ≥ 0.5). The formula for calculating the average confidence score is: S_avg = (ΣP_i) / N, where ΣP_i is the sum of the probability values of all pixels in the segmented region, and N is the total number of pixels in the segmented region. For example, in the vessel segmentation probability map, if the segmented region contains 10,000 pixels and the sum of the probability values is 8,500, then the average confidence score for the vessel is S_avg_vessel = 8500 / 10000 = 0.85; if the segmented region in the liver segmentation probability map contains 8,000 pixels and the sum of the probability values is 6,560, then the average confidence score for the liver segment is S_avg_segment = 6560 / 8000 = 0.82.
[0087] The preset thresholds were determined based on clinical validation data. By analyzing 1000 clinically accepted high-quality segmentation results, the distribution characteristics of their confidence scores were calculated, and the lower limit of the 95% confidence interval was used as the threshold to ensure its clinical significance. The confidence threshold for vessel segmentation was set at 0.75, and the confidence threshold for liver segmentation was set at 0.70. If the average confidence score is greater than or equal to the threshold, it indicates that the model has high certainty regarding the segmentation results and the results are reliable; if it is less than the threshold, it indicates that there are many blurry pixels in the segmented area, the model's judgment is highly uncertain, and misclassification may occur. For example, in a certain case, the average confidence score for portal vein segmentation was 0.85 (≥ 0.75), and the average confidence score for liver segment III segmentation was 0.68 (< 0.70). Therefore, the confidence score for vessel segmentation was deemed acceptable, while the confidence score for liver segment III segmentation was deemed unacceptable.
[0088] When extracting confidence scores, the average confidence scores for the portal vein, hepatic vein, and eight liver segments need to be calculated separately. For vessel segmentation, the average confidence score of the portal vein and hepatic vein is used as the overall vessel confidence score. For liver segmentation, the average confidence score of the eight liver segments is used as the overall liver segment confidence score. For example, if the portal vein confidence score is 0.85 and the hepatic vein confidence score is 0.83, the overall vessel confidence score is (0.85 + 0.83) / 2 = 0.84. If the confidence scores of the eight liver segments are 0.82, 0.78, 0.68, 0.85, 0.76, 0.80, 0.79, and 0.81, the overall liver segment confidence score is (0.82 + 0.78 + 0.68 + 0.85 + 0.76 + 0.80 + 0.79 + 0.81) / 8 ≈ 0.799.
[0089] The generated model confidence assessment report includes: the overall vascular confidence score and whether it meets the standard (e.g., "overall vascular confidence 0.84 ≥ 0.75, meets the standard"), the overall liver segment confidence score and whether it meets the standard (e.g., "overall liver segment confidence 0.799 ≥ 0.70, meets the standard"), the confidence details of each substructure (e.g., "liver segment III confidence 0.68 < 0.70, does not meet the standard"), and the location of the low confidence area is marked (e.g., "the low confidence area of liver segment III is concentrated at the boundary edge with liver segment IV").
[0090] Based on the comprehensive assessment reports on vascular topological integrity, liver segment boundary continuity, and model confidence, if all assessment indicators meet the preset clinically usable standards, the segmentation results are deemed to meet the quality standards; otherwise, they are deemed not to meet the standards and a quality alarm is triggered.
[0091] This step is the final assessment of segmentation quality. By integrating the evaluation results from the first three dimensions, a comprehensive standard that can be used clinically is established to ensure that the segmentation results can support surgical planning. The specific implementation method is as follows:
[0092] The pre-defined clinically usable standards are a multi-dimensional threshold set based on clinical surgical safety requirements, clearly defining the passing lines for each assessment indicator: Regarding vascular topological integrity, there are no breaks in the main trunks of the portal vein and hepatic vein; the connectivity of second-order branches is ≥90%, third-order branches ≥80%, and fourth-order and above ≥70%; there are no isolated vascular fragments with a length >5mm. Regarding the continuity of liver segment boundaries, all liver segments have no large-area defects (actual volume ≥80% of normal volume), no non-physiological holes with a diameter >5mm, and no severe blurred adhesions at the boundaries of adjacent liver segments (blurred band width ≤3mm). Regarding model confidence, the overall vascular confidence is ≥0.75, the overall liver segment confidence is ≥0.70, and the number of individual liver segments with a confidence of ≤0.65 does not exceed one.
[0093] The comprehensive judgment adopts the principle of "full compliance equals qualification," meaning that the segmentation result is considered to meet the quality standard only if all indicators meet the clinically usable criteria; if any indicator fails to meet the standard, it is judged as unqualified. During the judgment process, unqualified indicators need to be classified into levels: minor unqualified (e.g., connectivity of a certain level 4 branch 68% < 70%, no other unqualified indicators), moderate unqualified (e.g., a non-physiological hole with a diameter of 6mm in a certain liver segment, or overall liver segment confidence 0.68 < 0.70), and severe unqualified (e.g., rupture of the main portal vein, or large-area loss of multiple liver segments). For example, in a certain case, the vascular topological integrity met the standard, but a non-physiological hole with a diameter of 7mm existed in liver segment IV (moderate unqualified), and the model confidence met the standard; therefore, the comprehensive judgment is that the segmentation result does not meet the quality standard. If only the connectivity of a certain level 4 branch is 69% (minor unqualified), and all other indicators meet the standard, it is still judged as unqualified, but the alarm level is reduced.
[0094] The triggering method of quality alarms matches the level of non-compliance: When the non-compliance is minor, the system will pop up a yellow prompt window on the client, indicating "The segmentation result has a minor quality problem, manual review is recommended", and record the non-compliance index in the log; when the non-compliance is moderate, an orange prompt window will pop up, accompanied by a short prompt sound, indicating "The segmentation result is of medium quality and needs to be manually corrected before use", and the three-dimensional coordinates of the non-compliance area will be marked; when the non-compliance is severe, a red warning window will pop up, accompanied by a continuous prompt sound, indicating "The segmentation result is of unacceptable quality and cannot be used for surgical planning. Please re-perform the segmentation", and the re-segmentation process will be automatically triggered (returning to the AI segmentation step).
[0095] The comprehensive assessment report integrates results from all dimensions, clearly indicating "meets quality standards" or "does not meet quality standards," and details the indicators that meet and fail to meet the standards, explaining the level of non-compliance and its impact (e.g., "A non-physiological hole exists in liver segment IV, which may lead to errors in liver segment volume calculation and affect the estimation of the remaining liver volume"). This provides a clear basis for subsequent manual intervention or resegmentation. For example, the final assessment report states: "The segmentation result does not meet the clinical surgical planning quality standards, level of non-compliance: moderate. Specific non-compliance indicators: 1. A non-physiological hole with a diameter of 7mm exists in liver segment IV; 2. Confidence level of liver segment III is 0.63 < 0.70. Impact: May lead to an error of >5% in liver segment volume calculation; manual correction of the hole area and the boundary of liver segment III is recommended."
[0096] S204. If the segmentation results meet the quality standards, an interactive 3D mesh model of the liver, blood vessels, and liver segments is generated using a 3D reconstruction algorithm.
[0097] Specifically, the moving cube algorithm can be applied to the binary mask for liver parenchyma, vascular tree and liver segmentation that meet the quality standards to reconstruct the corresponding triangular mesh surface model from the voxel space and generate the initial triangular mesh set.
[0098] This step is the core starting point of 3D reconstruction. It uses the moving cube algorithm to transform the 2D voxel mask into a 3D surface model, laying the foundation for subsequent visualization and interaction. The specific implementation method is as follows:
[0099] The segmentation binary mask that meets the quality standards is in the format of a three-dimensional array, where each voxel has a value of 0 or 1. 1 represents the corresponding structure (liver parenchyma, vascular tree, liver segment), and 0 represents the background or other structures. For example, in the liver parenchyma mask, the voxel value for the liver region is 1, and the background is 0; in the portal vein mask, the voxel value for the vascular region is 1, and the rest are 0. Before applying the moving cube algorithm, a specific isosurface threshold needs to be set for different structures. The isosurface is defined as the interface where the voxel value transitions from 0 to 1, corresponding to the surface of the anatomical structure. The isosurface threshold for the liver parenchyma, vascular tree, and liver segment is set to 0.5, meaning that when the voxel value is ≥0.5, it is considered internal to the structure, and <0.5, it is considered external, ensuring accurate surface localization.
[0100] The core principle of the moving cube algorithm is to traverse each 3×3×3 voxel block in voxel space, determine the relationship between the voxel values of the 8 vertices within the block and the isosurface threshold, and determine the topological structure of the triangular facets of the isosurface within the block through 15 preset combinations of voxel vertex states. Then, it calculates the vertex coordinates and normal vectors of the triangular facets. For example, in a 3×3×3 voxel block, 4 vertices have voxel values of 1 and 4 have voxel values of 0. The algorithm matches the corresponding triangular facet combinations to generate 2 interconnected triangular facets, forming the surface segment of that region. The algorithm's sampling step size is set to 1 voxel (1 mm), consistent with the normalized voxel size, to ensure reconstruction accuracy; the side length threshold for the triangular facets is set to 2 mm. When the calculated facet side length exceeds this value, the facets are automatically subdivided to avoid an overly rough surface.
[0101] To address the reconstruction characteristics of different structures, the algorithm parameters are optimized accordingly: For liver parenchyma masks, which are large (typically containing over 1 million voxels), the algorithm employs a parallel computing mode, utilizing multi-core CPU resources to accelerate traversal, with a single instance reconstruction time controlled within 3 seconds; for vascular tree masks, which contain numerous small branches (1-3 mm in diameter), the algorithm enables a fine structure preservation mode to reduce the number of facet subdivisions and avoid distortion of branch structures; for liver segment masks, which require clear distinction of adjacent liver segment boundaries, the algorithm increases the accuracy of normal vector calculation at boundary voxel blocks to ensure clear boundaries.
[0102] The generated initial triangular mesh set contains three independent meshes: the liver parenchyma mesh (approximately 500,000 triangular faces), the vascular tree mesh (approximately 200,000 triangular faces), and the liver segment mesh (8 liver segments, totaling approximately 300,000 triangular faces). Each mesh contains information such as vertex coordinates (x, y, z, in mm), triangular face index, and vertex normal vector (used for subsequent lighting rendering). For example, a vertex in the liver parenchyma mesh has coordinates (120.5, 85.3, 90.7), a normal vector of (0.3, 0.5, 0.2), and a triangular face index of (1024, 1025, 1026), corresponding to a surface segment formed by three vertices.
[0103] Laplacian smoothing filtering and a mesh-based hole repair algorithm are applied to the initial triangular mesh set to eliminate surface step artifacts caused by voxel discretization and fill in non-anatomical mesh missing parts, generating an optimized smooth mesh model.
[0104] This step eliminates reconstruction artifacts and repairs structural defects through mesh optimization, improving the clinical readability and interactive fluency of the model. The specific implementation method is as follows:
[0105] The core of Laplacian smoothing filtering is to smooth the mesh surface by adjusting the coordinates of each vertex, while preserving the overall shape of the structure and avoiding the loss of detail caused by over-smoothing. The filtering algorithm uses a local neighborhood weighted averaging strategy. For each vertex v_i, its new coordinates v'_i = v_i + λ × (v_avg - v_i), where v_avg is the average coordinates of the k neighboring vertices of vertex v_i, λ is the smoothing coefficient (controlling the smoothing intensity), and k is the number of neighboring vertices (default 10). The smoothing coefficient λ is set according to the structure type: λ = 0.2 for liver parenchyma mesh (large surface area, requiring moderate smoothing), λ = 0.1 for vascular tree mesh (many small branches, avoiding excessive smoothing), and λ = 0.15 for liver segment mesh (balancing smoothing and boundary clarity).
[0106] The filtering iterations are set to 3. After each iteration, the surface curvature of the mesh is calculated. If the curvature change rate of a certain region is >50% (indicating important anatomical details, such as vascular bifurcation or liver segment boundaries), the λ value for that region is automatically halved in the next iteration to preserve details. For example, in the liver fissure region on the liver surface, the curvature change rate reaches 60% after the first iteration. In the second iteration, the λ value for that region is adjusted to 0.1, which eliminates the step-like artifacts while preserving the anatomical features of the liver fissure. The "sawtooth" surface (vertex coordinate fluctuation ±0.5mm) formed by voxel discretization in the initial mesh becomes ≤0.1mm after 3 filtering iterations, presenting a continuous and smooth morphology.
[0107] A mesh-based hole repair algorithm is used to fill non-anatomically significant mesh gaps (such as small holes caused by insufficient voxel sampling). A hole is defined as a closed boundary loop on the mesh surface, and the area enclosed by the boundary loop is <10mm² (excluding physiological gaps, such as vascular inlet / outlet holes in the hepatic hilum). The repair process consists of three steps: First, by traversing the edges of the mesh, edges not shared by two triangular patches are identified; these edges constitute the boundary loop of the hole. Then, the center coordinates and normal vector of the boundary loop are calculated to generate triangular patches to fill the hole. The number of patches is proportional to the number of vertices of the boundary loop (e.g., a boundary loop with 8 vertices generates 4 triangular patches). Finally, the filled patches are merged with the original mesh, and the normal vectors of adjacent vertices are adjusted to ensure a smooth transition.
[0108] For example, in a small branch region of a vascular tree mesh, there is a hole with an area of 5 mm². The boundary ring contains 6 vertices. The algorithm generates 3 triangular patches to fill the hole. After filling, the angle between the patch and the original mesh is less than 5°, with no obvious splicing marks. After repair, the mesh needs to be checked for topological consistency to ensure that there are no duplicate vertices or invalid patches (area < 0.1 mm²). The final optimized and smoothed mesh model has no step artifacts on the surface of the liver parenchyma, the vascular tree branches are continuous and complete, the liver segment boundaries are clear and smooth, and the total number of triangular patches is reduced by 10% compared to the initial mesh (because smoothing merges some small patches), improving the efficiency of subsequent rendering and interaction.
[0109] The smooth mesh models of the liver, blood vessels, and liver segments are imported into a GPU-accelerated 3D rendering engine. Different colors and initial transparency are assigned to different structures, and a hierarchical scene graph is established to manage their spatial nesting relationships, generating a layered visual scene.
[0110] This step visualizes the mesh model using a rendering engine, distinguishes the structure through color and transparency, and ensures clear spatial relationships through hierarchical management. The specific implementation method is as follows:
[0111] The GPU-accelerated 3D rendering engine is developed based on the OpenGL core model and supports Vertex Buffer Objects (VBOs), Vertex Array Objects (VAOs), and shader programs. It leverages the parallel computing power of the GPU to achieve real-time rendering with a frame rate of ≥30fps (meeting the requirements for smooth interaction). When importing a smooth mesh model, the engine stores the mesh's vertex coordinates, normals, texture coordinates, and other data in VBOs, organizes the data access format through VAOs, and then uses vertex shaders and fragment shaders to calculate lighting, color, and other effects. The vertex shader is responsible for converting vertex coordinates to screen coordinates, and the fragment shader is responsible for calculating the final color of each pixel (combining diffuse reflection, specular reflection, and ambient light).
[0112] The color allocation for different structures follows clinical visualization practices, employing a high-contrast, easily distinguishable color scheme: liver parenchyma is set to light red (RGB: 255, 150, 150), portal vein in the vascular tree is set to blue (RGB: 100, 100, 255), and hepatic veins are set to green (RGB: 100, 255, 100). The eight Couinaud liver segments are each set to different soft hues (e.g., liver segment I: yellow RGB255, 255, 100; liver segment II: orange RGB255, 180, 80; liver segment III: pink RGB255, 150, 200, etc.). The brightness and saturation of the colors are controlled within a moderate range to avoid visual fatigue.
[0113] Initial transparency is set according to the spatial nesting relationship of the structure, adopting the principle of "high transparency for inner structures and low transparency for outer structures" to ensure that nested structures are visible: the initial transparency of the vascular tree (inner layer, nested within the liver and liver segments) is set to 50% (Alpha value 0.5), the liver segment (middle layer, nested within the liver) is set to 70% (Alpha value 0.7), and the liver parenchyma (outer layer) is set to 90% (Alpha value 0.9). For example, the main portal vein is nested within liver segment IV. 50% transparency allows the doctor to see the vascular course through the liver segment, 70% transparency allows for the differentiation of liver segment boundaries, and 90% transparency of the liver parenchyma ensures that the overall morphology of the liver is clear.
[0114] The hierarchical scene graph is used to manage the spatial relationships and rendering order of various structures. The scene graph consists of three layers: the top layer is the liver parenchyma mesh, the middle layer is eight liver segment meshes (sorted by segment number), and the bottom layer is the vascular tree mesh (the portal vein and hepatic vein are managed separately). The rendering engine renders in the order of "bottom layer → middle layer → top layer," that is, it renders the vascular tree first, then the liver segments, and finally the liver parenchyma, ensuring that inner structures are not completely obscured by outer layers. The scene graph also supports parent-child relationship binding of structures. For example, a vascular branch of a liver segment can be bound to a child node of that segment. When the liver segment is hidden, its internal vascular branches are also hidden simultaneously, improving interactivity.
[0115] After generating the layered visualization scene, the engine automatically calculates the scene's lighting parameters, using the Phong lighting model. Ambient light intensity is set to 0.3 (simulating uniform ambient light), diffuse reflection intensity is set to 0.6 (to reveal structural surface details), and specular reflection intensity is set to 0.1 (to avoid excessive reflection). The light source position is set diagonally above the scene (x=100, y=100, z=200) to ensure the structure's three-dimensional appearance. The visualization scene supports global zoom (0.1-10x), with the default viewpoint directly in front of the liver, allowing for clear observation of the overall liver morphology, liver segment divisions, and the nested relationship of blood vessels.
[0116] The rendering engine integrates rotation, scaling, and translation interaction controllers, and implements selective structure hiding, real-time transparency adjustment, and section cutting functions based on mouse clicks, ultimately generating a 3D mesh model that supports real-time interactive operations.
[0117] This step empowers doctors to manipulate the 3D model through an interactive controller, meeting the needs of multi-angle observation and structural analysis in preoperative planning. The specific implementation method is as follows:
[0118] The interactive controller is based on mouse and keyboard events and supports three basic operations: rotation, scaling, and translation. The operation logic conforms to the usage habits of clinical software: dragging with the left mouse button rotates the model around the X and Y axes of the screen, with a rotation speed of 0.5° / pixel (dragging 10 pixels rotates 5°) to ensure precise operation; scrolling with the mouse wheel scales the model, with a scaling factor of 1.1 (scrolling up once zooms in by 10%, scrolling down once zooms out by 10%), and the scaling center is the model point currently being pointed at by the mouse, making it easy to focus on observing local structures; dragging with the right mouse button translates the model, with a translation speed of 0.1mm / pixel (dragging 20 pixels translates 2mm), and the translation range is limited to twice the bounding box of the model to prevent the model from moving off the screen.
[0119] The selective structure hiding function based on mouse clicks is implemented through raycasting: when a doctor clicks the mouse, the engine emits a ray from the click location, performs intersection detection with all mesh models in the scene graph, and returns the nearest intersecting structure (such as liver segment III). An operation menu pops up with three options: "Hide this structure," "Hide other structures," and "Show all structures." For example, if "Hide this structure" is selected after clicking liver segment III, the engine turns off the rendering switch for liver segment III in the scene graph, making the liver segment III area transparent in the model, revealing its internal vascular structure. Selecting "Hide other structures" only preserves liver segment III and the vascular tree, making it easier to observe the morphology and blood supply of this liver segment separately.
[0120] The real-time transparency adjustment function supports adjustments to individual structures or the entire structure. A transparency slider (range 0-100%, corresponding to an alpha value of 0-1) is set in the interface. Dragging the slider updates the alpha value of the corresponding structure in real time and re-renders it. For example, adjusting the transparency of the portal vein from 50% to 30% makes it clearer, facilitating observation of its branch details; adjusting the transparency of a liver segment from 70% to 40% provides a clearer view of its internal vascular distribution. The adjusted transparency parameters are automatically saved and linked to the current patient data, automatically restoring upon the next opening.
[0121] The section cutting function is used to observe the internal anatomical structures of the model. It supports planar cutting in the X, Y, and Z directions. Doctors can adjust the position of the cutting plane using sliders (ranging from the minimum to the maximum value of the model's bounding box). The normal vector of the cutting plane is consistent with the corresponding coordinate axis (e.g., the normal vector of the cutting plane in the X direction is (1,0,0)). After cutting, the engine only renders the model portion on one side of the cutting plane, highlighting the cut surface in red (RGB: 255,50,50), and simultaneously displaying the position coordinates of the cutting plane (e.g., X=120mm). For example, cutting a liver model along the Z-axis and adjusting the cutting plane to Z=90mm allows observation of the liver segment boundaries and vascular cross-sectional morphology at that level, aiding in determining the positional relationship between lesions and blood vessels.
[0122] The resulting 3D mesh model, which supports real-time interactive operation, can not only clearly present the 3D morphology and spatial relationship of the liver, blood vessels, and liver segments, but also enable multi-angle observation through rotation, scaling, and translation. It can also achieve refined structural analysis through selective hiding, transparency adjustment, and cross-sectional cutting. The interactive response time is ≤50ms, which fully meets the interactive needs of clinical preoperative planning.
[0123] S205. Based on the three-dimensional mesh model, calculate the volume of each liver segment, simulate the surgical resection range, estimate the future remaining liver volume, and measure the proximity relationship between the lesion and key blood vessels to generate a structured analysis report for preoperative planning.
[0124] Specifically, the triangular mesh model corresponding to each liver segment can be traversed, and the volume enclosed by each liver segment model can be calculated by using the voxelization method or the volume accumulation algorithm based directly on the mesh, generating a liver segment volume list containing the volume data of eight liver segments.
[0125] This step is the core quantitative step in preoperative planning. By accurately calculating the volume of each liver segment, it provides basic data for subsequent simulation of the resection range and estimation of the remaining liver volume. The specific implementation method is as follows:
[0126] Each liver segment's triangular mesh model consists of tens of thousands to hundreds of thousands of triangular faces, containing core information such as vertex coordinates and face indices. The spatial accuracy of the mesh model is consistent with the normalized voxel size (1 mm), ensuring the accuracy of volume calculation. Two complementary algorithms are provided for volume calculation, automatically selected based on the structural complexity of the liver segment: the voxelization method is suitable for liver segments with irregular boundaries and many small protrusions (such as liver segments V and VI), while the direct mesh-based volume accumulation algorithm is suitable for liver segments with regular shapes (such as liver segments I and IV).
[0127] The core of the voxelization method is to map the triangular mesh model to a three-dimensional voxel space, count the number of voxels completely contained within the model, and then multiply the number by the volume of a single voxel (1 mm³) to obtain the liver segment volume. The specific process is as follows: First, determine the three-dimensional bounding box of the liver segment mesh model (from minimum coordinates x_min, y_min, z_min to maximum coordinates x_max, y_max, z_max), and construct a voxel mesh (voxel side length 1 mm) that matches the bounding box; then, traverse each voxel, using the ray casting method to determine if the voxel center is inside the mesh model (a ray is emitted from the voxel center; if the number of intersections with the triangular facets is odd, it is inside; if even, it is outside); finally, count the total number of voxels inside, and calculate the volume V = total number of voxels × 1 mm³. For example, the bounding box of liver segment V is x (100-150mm), y (80-130mm), z (90-140mm). A 50×50×50 voxel mesh is constructed. After traversing it, the number of internal voxels is counted to be 125,000, and the volume is 125,000mm³ = 125cm³.
[0128] The direct mesh-based volume accumulation algorithm calculates the volume enclosed by the mesh using the spatial coordinates of triangular facets. The core formula involves decomposing the mesh into tetrahedrons with the origin as vertices and triangular facets as bases. The volume of each tetrahedron is calculated using vector cross products, and then the volumes of all tetrahedrons are summed to obtain the total volume. The formula is V=(1 / 6)|Σ(x_i(y_jz_k-y_kz_j)+x_j(y_kz_i-y_iz_k)+x_k(y_iz_j-y_jz_i))|, where (x_i,y_i,z_i), (x_j,y_j,z_j), and (x_k,y_k,z_k) are the coordinates of the three vertices of the triangular facets, and the origin is (0,0,0). For example, a liver segment mesh contains 200,000 triangular faces. By traversing each face and calculating the tetrahedral volume, the volume is accumulated to obtain 118.5 cm³. This algorithm does not require voxelization, is 30% faster than the voxelization method, and has higher boundary accuracy.
[0129] To ensure computational reliability, the system automatically cross-validates the results of the two algorithms. If the difference is ≤2%, the average is taken as the final volume; if the difference is >2%, an optimization algorithm (increasing the voxelization sampling density or refining the mesh patches) is used for recalculation. The final generated liver segment volume list contains the specific volume data of eight Couinaud liver segments, in cm³, rounded to one decimal place, for example, "Liver segment I: 35.2 cm³, Liver segment II: 98.9 cm³, Liver segment III: 113.4 cm³, Liver segment IV: 275.7 cm³, Liver segment V: 55.2 cm³, Liver segment VI: 228.5 cm³, Liver segment VII: 134.4 cm³, Liver segment VIII: 203.3 cm³". The list also indicates the calculation algorithm type and error range (e.g., "Liver segment V: Voxelization method, error ±1.2%)", providing a data reliability reference for clinical decision-making.
[0130] The system receives the range of liver segments to be resected, either drawn by the user or automatically generated based on the location of the lesion, in the 3D interactive interface. It summarizes the total volume of the marked liver segments as the planned resection volume according to the liver segment volume list, calculates the total volume of the whole liver, and generates the planned resection range and volume data.
[0131] This step allows for flexible definition of the resection area. Through a combination of human-computer interaction and automatic recognition, it accurately locates the liver segment to be resected, providing a clear basis for calculating the remaining liver volume. The specific implementation method is as follows:
[0132] The 3D interactive interface is built on a GPU-accelerated rendering engine and supports two resection range definition modes to meet the needs of different clinical scenarios: the user-drawing mode is suitable for complex lesions (such as tumors spanning liver segments), where doctors can draw the resection boundary on the 3D mesh model by dragging the mouse or using touch operations, and the system automatically identifies the liver segment and part of the liver segment area covered by the boundary; the automatic generation mode based on lesion location is suitable for lesions within a single liver segment, where the system automatically matches the liver segment where the lesion is located and the adjacent liver segments that may be invaded by using the center coordinates and volume of the lesion mesh model to generate a preliminary resection range, which doctors can manually adjust and optimize.
[0133] In the user sketching mode, the interface provides three tools: "Free Drawing," "Polygon Drawing," and "Quick Liver Segment Selection." Free Drawing allows doctors to draw closed curves along the lesion's edge, and the system uses a spatial projection algorithm to determine the liver segment region included in the curve. Polygon Drawing is suitable for regular resection boundaries; doctors click to define multiple vertices to form a polygon, and the system automatically connects the vertices to generate a closed boundary. The Quick Liver Segment Selection tool provides eight quick checkboxes for liver segments; after selection, the entire liver segment is directly marked as the intended resection area. For example, if a doctor uses Free Drawing to cover most of liver segment III and a small portion of liver segment IV, the system automatically identifies and marks "Liver Segment III (entire segment), Liver Segment IV (15%)" as the intended resection area.
[0134] The core logic of the automatic lesion location generation mode is as follows: First, obtain the center coordinates (x0, y0, z0) of the lesion mesh model, traverse the mesh models of the eight liver segments, and determine whether the center coordinates are inside the liver segment; then, calculate the ratio of the lesion volume to the volume of the liver segment. If the ratio is >30%, the liver segment and adjacent liver segments (determined based on vascular supply relationship, such as liver segment III adjacent to liver segments II and IV) are marked as the proposed resection range; if the ratio is ≤30%, only the liver segment is marked. For example, if the lesion center coordinates are located inside liver segment V, with a volume of 60 cm³, and liver segment V has a volume of 55.2 cm³, the ratio is >100%, and the system automatically marks "liver segment V (entire segment) and liver segment VI (adjacent segment)" as the preliminary resection range.
[0135] The planned resection volume is calculated as the weighted sum of the volumes of the marked liver segments, and the total volume of the whole liver is the sum of the volumes of the eight liver segments. For example, if the planned resection area is "liver segment III (113.4 cm³) and liver segment V (55.2 cm³)," then the planned resection volume = 113.4 + 55.2 = 168.6 cm³; the total volume of the whole liver = 35.2 + 98.9 + 113.4 + 275.7 + 55.2 + 228.5 + 134.4 + 203.3 = 1144.6 cm³. The generated data on the proposed resection range and volume includes "a list of liver segments to be resected (including coverage percentage), the proposed resection volume (cm³), the total volume of the whole liver (cm³), and the proposed resection percentage (proposed resection volume / total volume of the whole liver × 100%)", for example, "proposed liver segments: III (100%), V (100%); proposed resection volume: 168.6cm³; total volume of the whole liver: 1144.6cm³; proposed resection percentage: 14.7%".
[0136] Subtracting the planned resection volume from the total liver volume yields the initial estimated future remaining liver volume. This is then combined with the patient's body surface area to calculate the standardized percentage of the future remaining liver volume, generating the future remaining liver volume assessment result.
[0137] This step involves standardized assessment of the functional reserve of the remaining liver volume, avoiding misjudgments due to individual differences caused by simply measuring volume values. It provides a core basis for surgical safety, and the specific implementation method is as follows:
[0138] The initial estimate of the future residual liver volume (FLR) is a simple subtraction operation, with the formula FLR_raw = total liver volume - planned resection volume. This value reflects the physical volume of the liver after surgery, but it does not take into account differences in patient body size (such as differences in liver function reserve between adults and children, and between obese and lean patients). It needs to be standardized by body surface area to be converted into a clinically comparable indicator. For example, if the total liver volume is 1144.6 cm³ and the planned resection volume is 168.6 cm³, the initial estimate FLR_raw = 1144.6 - 168.6 = 976.0 cm³.
[0139] The patient's body surface area (BSA) is calculated using the clinically accepted DuBois formula: BSA = 0.007184 × weight^0.425 × height^0.725, where weight is in kg, height is in cm, and the result is in square meters (㎡). The system supports manual input of the patient's height and weight, or automatic synchronization from the hospital's HIS system. For example, if a patient is 175cm tall and weighs 70kg, substituting these values into the formula yields BSA = 0.007184 × 70^0.425 × 175^0.725 ≈ 2.38㎡.
[0140] The standardized formula for future residual liver volume percentage (FLR%) is FLR%=(FLR_raw / BSA) / 10. This formula correlates residual liver volume with body surface area and converts it into the percentage of residual liver volume per 10㎡ of body surface area. The clinical safety threshold is FLR%≥30% (≥40% for patients with cirrhosis).
[0141] The generated future residual liver volume assessment results include "initial estimated residual liver volume (cm³), patient body surface area (m²), standardized residual liver volume (cm³ / m²), standardized percentage (%), and safety assessment conclusion," for example, "initial estimated residual liver volume: 976.0 cm³; patient body surface area: 1.73 m²; standardized residual liver volume: 564 cm³ / m²; standardized percentage: 188%; safety assessment: sufficient residual liver volume, meeting surgical safety requirements (standard safety value ≥ 300 cm³ / m²)." For patients with cirrhosis, the system automatically raises the safety standard to 400 cm³ / m² and notes in the assessment conclusion, "The patient has cirrhosis, standardized residual liver volume 564 cm³ / m² ≥ 400 cm³ / m², and can tolerate surgery."
[0142] The system calculates the shortest distance from each point on the lesion mesh model surface to the key vessel mesh model surface, determines the minimum distance value and its corresponding spatial location, assesses the surgical dissection risk, and finally integrates the liver segment volume list, the planned resection range and volume data, the future remaining liver volume assessment results, and the lesion vessel proximity relationship data to automatically generate a structured preoperative planning analysis report.
[0143] This step assesses surgical risk by quantifying the spatial relationship between the lesion and key blood vessels, and integrates all planning data to generate a clinically usable structured report. The specific implementation method is as follows:
[0144] The lesion mesh model is generated by the AI segmentation module and includes a 3D surface triangular mesh of the lesion. The key vessel mesh model covers the main portal vein and its third-order branches, and the main hepatic vein and its major branches (such as the left, middle, and right hepatic veins). Both are registered and aligned with the liver segment mesh model, with a spatial error ≤1mm. The shortest distance is calculated using a "point-to-triangular patch" distance algorithm. It traverses all vertices (approximately 10,000 to 50,000) on the surface of the lesion mesh model, calculates the shortest distance from each vertex to all triangular patches of the key vessel mesh model, and then takes the minimum value of all vertex distances as the shortest distance between the lesion and the vessel.
[0145] The calculation logic for the distance from a point to a triangular facet is as follows: For a vertex P(x0,y0,z0) on the lesion surface and a triangular facet ABC on the blood vessel surface (vertices A(x1,y1,z1), B(x2,y2,z2), C(x3,y3,z3)), first calculate vectors AP, AB, and AC. Then, determine whether the projection of P onto the plane containing facet ABC is inside the facet. If it is inside, the distance is the perpendicular distance from P to the plane. If it is not inside, the distance is the shortest distance from P to points A, B, and C, or the shortest distance from P to the three sides AB, BC, and CA. For example, if the projection of vertex P(120,90,100) on the lesion surface onto the portal vein branch facet ABC is inside the facet, the calculated perpendicular distance is 5.2 mm. Since the distance from this vertex to other blood vessel facets is ≥8 mm, the corresponding shortest distance for this vertex is 5.2 mm.
[0146] After traversing all lesion vertices, the global minimum distance value and its corresponding spatial location (vertices coordinates) are determined, and associated with the corresponding key vessel name. For example, if the global minimum distance is 4.8mm, corresponding to vertex coordinates (122, 91, 102), and the associated vessel is "transverse branch of the left portal vein," then the shortest distance between the lesion and the transverse branch of the left portal vein is determined to be 4.8mm. Surgical dissection risk is graded according to the shortest distance: ≤3mm is high risk (potential vessel damage, requiring meticulous dissection), 3-10mm is medium risk (requiring careful operation), and >10mm is low risk (easy dissection). For example, 4.8mm corresponds to medium risk, and the assessment conclusion is "the lesion is adjacent to the transverse branch of the left portal vein, with a minimum distance of 4.8mm; careful dissection is required during surgery to avoid vessel damage."
[0147] The structured preoperative planning and analysis report adopts a standard clinical format and includes five core chapters: patient basic information, preoperative imaging assessment, liver segment volume and resection extent planning, residual liver volume assessment, lesion and vascular proximity relationship and surgical risk assessment, and surgical recommendations. Patient basic information is synchronized from the HIS system, including name, gender, age, hospital number, and CT examination date; the preoperative imaging assessment briefly describes the CT image quality, overall liver morphology, lesion location and size; the liver segment volume and resection extent planning lists the complete liver segment volume, the liver segment to be resected and its volume, and the total liver volume; the residual liver volume assessment presents the initial estimate, body surface area, standardized values, and safety assessment; the lesion and vascular proximity relationship lists the shortest distance, location, and risk level between key blood vessels and the lesion; the surgical recommendations, based on the above data, provide the resection method (e.g., "laparoscopic liver segment III+V resection"), intraoperative precautions (e.g., "priority protection of the transverse branch of the left portal vein"), and postoperative monitoring recommendations (e.g., "monitor liver function and coagulation function for 3 days postoperatively").
[0148] The report supports exporting to PDF format, including screenshots of the 3D mesh model (such as liver segmentation diagrams and diagrams showing the relationship between lesions and blood vessels). Key data is highlighted in bold, and risk levels are distinguished by color (high risk red, medium risk yellow, low risk green), for example, "the shortest distance between the lesion and the transverse branch of the left portal vein is 4.8mm (medium risk)". The report also supports integration with surgical navigation systems, exporting data such as the planned resection area and the location of key blood vessels in a format recognizable by the navigation system to assist in precise intraoperative operations.
[0149] Another embodiment of the present invention provides an intelligent processing system for CT liver anatomy structures for clinical planning, see [link to relevant documentation]. Figure 3 The system may include:
[0150] The receiving module 301 is used to receive CT image data from imaging equipment or hospital information system, and to perform preprocessing operations such as voxel resampling, grayscale standardization and orientation correction on the CT image data.
[0151] The inference module 302 is used to perform inference on the preprocessed CT image data using a deep learning segmentation model deployed on the server, to identify and segment the vascular tree structure of the liver parenchyma, portal vein and hepatic vein, as well as the Couinaud liver segment, and to obtain the vascular tree structure and liver segment segmentation results.
[0152] The evaluation module 303 is used to comprehensively evaluate the integrity of the vascular topology, the continuity of the liver segment boundaries, and the model confidence index based on the vascular tree structure and the liver segmentation results, and to determine whether the segmentation results meet the quality standards of clinical surgical planning.
[0153] The generation module 304 is used to generate an interactive 3D mesh model of the liver, blood vessels and liver segments using a 3D reconstruction algorithm if the segmentation result meets the quality standard.
[0154] The calculation module 305 is used to calculate the volume of each liver segment, simulate the surgical resection range, estimate the future remaining liver volume, and measure the proximity relationship between the lesion and key blood vessels based on the three-dimensional mesh model, and generate a structured analysis report for preoperative planning.
[0155] This invention also provides a storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above method embodiments when running.
[0156] This invention also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
[0157] The above description, based on the embodiments shown in the figures, details the structure, features, and effects of the present invention. The above description is only a preferred embodiment of the present invention, but the present invention is not limited to the scope of implementation shown in the figures. Any changes made in accordance with the concept of the present invention, or equivalent embodiments modified to have equivalent changes, that do not exceed the spirit covered by the specification and figures, should be within the protection scope of the present invention.
Claims
1. A method for intelligent processing of CT liver anatomy structures for clinical planning, characterized in that, The method includes: Receive CT image data from imaging equipment or hospital information system, and perform preprocessing operations such as voxel resampling, grayscale standardization and orientation correction on the CT image data; A deep learning segmentation model deployed on the server is used to infer the preprocessed CT image data, identifying and segmenting the vascular tree structure of the liver parenchyma, portal vein, and hepatic vein, as well as the Couinaud segment, to obtain the vascular tree structure and liver segmentation results. Specifically, the preprocessed, standardized CT data is sent to the server with a CUDA-accelerated deep learning framework via a RESTful API, loading the pre-trained vascular segmentation network for forward inference to generate an initial vascular probability map containing the portal vein and hepatic vein. The initial vascular probability map is then thresholded and post-processed morphologically to extract a binary mask of the vascular structure, and a skeletonization algorithm is applied to generate the vascular center. The system first constructs a vascular topology map with bifurcation points as nodes and center segments as edges, generating vascular topology data. Then, it inputs standardized CT data and vascular topology data into a pre-trained liver segmentation network. This network encodes vascular topology features through graph convolution and fuses them with image features using a cross-attention mechanism, inferring segmentation probability maps for eight Couinaud liver segments, generating liver segment probability maps. ArgMax operations and connected component analysis are performed on the liver segment probability maps to obtain discrete liver segment label maps. Simultaneously, spatial logic verification is performed by combining the main branch attribution relationships in the vascular topology data, ultimately outputting a registered and aligned vascular tree structure and liver segmentation results. Based on the aforementioned vascular tree structure and liver segmentation results, the integrity of vascular topology, the continuity of liver segment boundaries, and the model confidence index are comprehensively evaluated to determine whether the segmentation results meet the quality standards for clinical surgical planning. If the segmentation results meet the quality standards, an interactive 3D mesh model of the liver, blood vessels, and liver segments is generated using a 3D reconstruction algorithm. Based on the three-dimensional mesh model, the volume of each liver segment is calculated, the surgical resection range is simulated, the future remaining liver volume is estimated, and the proximity relationship between the lesion and key blood vessels is measured to generate a structured analysis report for preoperative planning.
2. The method according to claim 1, characterized in that, The process of receiving CT image data from imaging equipment or a hospital information system and performing preprocessing operations such as voxel resampling, grayscale normalization, and orientation correction on the CT image data includes: Receive raw CT image sequence data and parse the DICOM header file to obtain raw voxel dimensions, scan matrix and patient orientation information; Based on the preset standard voxel resolution, the original CT image sequence is isotropically resampled, and the voxel spatial size of all slices is unified by a trilinear interpolation algorithm to generate voxel-standardized image data. The HU value truncation and linear stretching algorithm is applied to the voxel-normalized image data to map the gray values to the standard soft tissue window width and window level range, eliminating the intensity differences between different scanning devices and protocols, and generating gray-normalized image data. Based on the direction cosine matrix in the DICOM header file, the grayscale standardized image data is corrected in terms of spatial coordinate system and orientation to ensure that the orientation of the liver anatomical structure in three-dimensional space is consistent with the standard anatomical coordinate system, and finally, preprocessed standardized CT data is generated.
3. The method according to claim 2, characterized in that, Based on the vascular tree structure and liver segmentation results, a comprehensive evaluation is conducted on vascular topological integrity, liver segment boundary continuity, and model confidence indices to determine whether the segmentation results meet the quality standards for clinical surgical planning, including: Analyze vascular topology data, check for breaks in the main trunks of the portal vein and hepatic vein, calculate the connectivity of branches at all levels, detect the presence of isolated vascular segments, and generate a vascular topology integrity assessment report. The boundary of each liver segment label region in the liver segmentation results is detected to identify whether there are large areas of missing parts, non-physiological holes, or areas that are severely blurred and adhered to the boundary of adjacent liver segments, and a liver segment boundary continuity assessment report is generated. Extract the average confidence score of the corresponding segmented region from the probability maps output by the blood vessel segmentation network and the liver segmentation network, and compare it with a preset threshold to generate a model confidence assessment report; Based on the comprehensive assessment reports on vascular topological integrity, liver segment boundary continuity, and model confidence, if all assessment indicators meet the preset clinically usable standards, the segmentation results are deemed to meet the quality standards; otherwise, they are deemed not to meet the standards and a quality alarm is triggered.
4. The method according to claim 3, characterized in that, If the segmentation result meets the quality standard, an interactive 3D mesh model of the liver, blood vessels, and liver segments is generated using a 3D reconstruction algorithm, including: For the liver parenchyma, vascular tree and liver segmentation binary mask that meet the quality standards, the moving cube algorithm is applied to reconstruct the corresponding triangular mesh surface model from the voxel space to generate the initial triangular mesh set. Laplacian smoothing filtering and a mesh-based hole repair algorithm are applied to the initial triangular mesh set to eliminate surface step artifacts caused by voxel discretization and fill in non-anatomical mesh missing parts, generating an optimized smooth mesh model. The smooth mesh models of the liver, blood vessels, and liver segments are imported into a GPU-accelerated 3D rendering engine. Different colors and initial transparency are assigned to different structures, and a hierarchical scene graph is established to manage their spatial nesting relationships, generating a layered visual scene. The rendering engine integrates rotation, scaling, and translation interaction controllers, and implements selective structure hiding, real-time transparency adjustment, and section cutting functions based on mouse clicks, ultimately generating a 3D mesh model that supports real-time interactive operations.
5. The method according to claim 4, characterized in that, The process involves calculating the volume of each liver segment, simulating the surgical resection range, estimating the future remaining liver volume, and measuring the proximity of lesions to key blood vessels based on the three-dimensional mesh model. This generates a structured analysis report for preoperative planning, including: Traverse the triangular mesh model corresponding to each liver segment, and use the voxelization method or the volume accumulation algorithm based directly on the mesh to calculate the spatial volume enclosed by each liver segment model, and generate a liver segment volume list containing the volume data of eight liver segments. The system receives the range of liver segments to be resected, either drawn by the user or automatically generated based on the location of the lesion, in the 3D interactive interface. It summarizes the total volume of the marked liver segments as the planned resection volume according to the liver segment volume list, calculates the total volume of the whole liver, and generates the planned resection range and volume data. Subtracting the planned resection volume from the total liver volume yields the initial estimated future remaining liver volume. This is then combined with the patient's body surface area to calculate the standardized percentage of the future remaining liver volume, generating the future remaining liver volume assessment result. The system calculates the shortest distance from each point on the lesion mesh model surface to the key vessel mesh model surface, determines the minimum distance value and its corresponding spatial location, assesses the surgical dissection risk, and finally integrates the liver segment volume list, the planned resection range and volume data, the future remaining liver volume assessment results, and the lesion vessel proximity relationship data to automatically generate a structured preoperative planning analysis report.
6. A CT liver anatomy structure intelligent processing system for clinical planning, characterized in that, The system includes: The receiving module is used to receive CT image data from imaging equipment or hospital information system, and to perform preprocessing operations such as voxel resampling, grayscale standardization and orientation correction on the CT image data. The inference module utilizes a server-side deep learning segmentation model to infer the preprocessed CT image data, identifying and segmenting the vascular tree structure of the liver parenchyma, portal vein, and hepatic vein, as well as the Couinaud segment, obtaining the vascular tree structure and liver segmentation results. Specifically, the preprocessed, standardized CT data is sent to a server with a CUDA-accelerated deep learning framework via a RESTful API. A pre-trained vascular segmentation network is loaded for forward inference, generating an initial vascular probability map containing the portal vein and hepatic vein. The initial vascular probability map is then thresholded and post-processed morphologically to extract a binary mask of the vascular structure, and a skeletonization algorithm is applied to generate... The vascular centerline is used to construct a vascular topology map with bifurcation points as nodes and centerline segments as edges, generating vascular topology data. Normalized CT data and vascular topology data are input into a pre-trained liver segmentation network. This network encodes vascular topology features through graph convolution and fuses them with image features using a cross-attention mechanism to infer segmentation probability maps for eight Couinaud liver segments, generating liver segment probability maps. ArgMax operations and connected component analysis are performed on the liver segment probability maps to obtain discrete liver segment label maps. At the same time, spatial logic verification is performed by combining the main branch attribution relationship in the vascular topology data, and finally, the registered and aligned vascular tree structure and liver segment segmentation results are output. The evaluation module is used to comprehensively evaluate the integrity of the vascular topology, the continuity of the liver segment boundaries, and the model confidence index based on the vascular tree structure and the liver segmentation results, and to determine whether the segmentation results meet the quality standards of clinical surgical planning. The generation module is used to generate an interactive 3D mesh model of the liver, blood vessels, and liver segments using a 3D reconstruction algorithm if the segmentation results meet the quality standards. The calculation module is used to calculate the volume of each liver segment, simulate the surgical resection range, estimate the future remaining liver volume, and measure the proximity relationship between the lesion and key blood vessels based on the three-dimensional mesh model, and generate a structured analysis report for preoperative planning.
7. The system according to claim 6, characterized in that, The receiving module is specifically used for: Receive raw CT image sequence data and parse the DICOM header file to obtain raw voxel dimensions, scan matrix and patient orientation information; Based on the preset standard voxel resolution, the original CT image sequence is isotropically resampled, and the voxel spatial size of all slices is unified by a trilinear interpolation algorithm to generate voxel-standardized image data. The HU value truncation and linear stretching algorithm is applied to the voxel-normalized image data to map the gray values to the standard soft tissue window width and window level range, eliminating the intensity differences between different scanning devices and protocols, and generating gray-normalized image data. Based on the direction cosine matrix in the DICOM header file, the grayscale standardized image data is corrected in terms of spatial coordinate system and orientation to ensure that the orientation of the liver anatomical structure in three-dimensional space is consistent with the standard anatomical coordinate system, and finally, preprocessed standardized CT data is generated.
8. A storage medium, characterized in that, The storage medium stores a computer program, wherein the computer program is configured to execute the method of any one of claims 1-5 when it is run.
9. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to perform the method of any one of claims 1-5.