A carotid artery lumen geometry model construction system based on CTA images

Through the construction system of carotid artery lumen geometric model based on CTA images, the problems of high cost, complex operation and legal risks in the existing technology are solved, and efficient and accurate carotid artery geometric model construction is achieved, supporting the fluid dynamic analysis of atherosclerosis and aneurysms.

CN120086916BActive Publication Date: 2025-08-19ZHEJIANG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510240289.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-03
Publication Date
2025-08-19
Estimated Expiration
2045-03-03

AI Technical Summary

Technical Problem

The prior art relies on commercial software when building carotid artery geometric models, resulting in high costs, cumbersome operational processes, and legal risks, slow speed, and inability to efficiently and accurately perform carotid artery fluid dynamics analysis.

Method used

The carotid artery lumen geometric model construction system based on CTA images is adopted, including data import, volume data cropping, interactive carotid artery lumen segmentation, 3D model construction, model processing, model cropping, boundary detection and STL file export, etc., to realize the automated and interactive model construction process.

Benefits of technology

The simple, efficient and precise construction of carotid geometric models provides strong support for the hydrodynamic analysis of diseases such as atherosclerosis and aneurysms, avoiding the dependence of commercial software and legal risks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120086916B_ABST
    Figure CN120086916B_ABST
Patent Text Reader

Abstract

This invention discloses a system for constructing a carotid artery lumen geometry model based on CTA images. This system relates to the field of image processing technology and encompasses modules such as data import, volumetric data cropping, interactive carotid artery lumen segmentation, 3D model construction, model processing, model cropping, boundary detection, entrance and exit filling, and STL file export. Each module has a clear division of labor and a detailed workflow. This invention addresses the problems of existing geometric modeling methods, such as reliance on commercial software, high costs, legal risks, and cumbersome and slow operational procedures. By enabling simple, efficient, and accurate construction of carotid artery geometry models, this invention provides strong support for the analysis, research, and diagnosis of carotid artery fluid dynamics in diseases such as atherosclerosis and aneurysms.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and more particularly to a system for constructing a carotid artery lumen geometric model based on CTA images. Background Art

[0002] Currently, in clinical medicine, carotid artery fluid dynamics analysis is of great significance for the research and diagnosis of diseases such as atherosclerosis and aneurysms. The key to fluid dynamics simulation is to establish an accurate carotid artery geometric model. Currently, existing geometric modeling methods have many drawbacks:

[0003] Reliance on commercial software: Medical imaging data (such as CTA images) typically requires segmentation and modeling using commercial software (such as MIMICS), followed by model refinement using software like Geomagic to ultimately obtain the desired geometric model. This process requires the coordinated operation of multiple software packages, which is not only costly but also raises legal compliance issues, such as the risk of using pirated software.

[0004] Complicated workflow: The existing segmentation and modeling process is extremely complex, involving data transfer and processing between different software. Due to the inherent complexity of commercial software, even processing a simple carotid artery model is slow, making it inefficient for research and clinical applications.

[0005] Therefore, how to construct a carotid artery geometric model simply, efficiently and accurately is a problem that needs to be solved urgently by those skilled in the art. Summary of the Invention

[0006] In view of this, the present invention provides a system for constructing a carotid artery lumen geometric model based on CTA images to solve the problems existing in the background technology.

[0007] In order to achieve the above object, the present invention adopts the following technical solutions:

[0008] A carotid artery lumen geometric model construction system based on CTA images, comprising: a data import module, a volume data clipping module, an interactive carotid artery lumen segmentation module, a 3D model construction module, a model processing module, a model clipping module, a boundary detection module, an entrance and exit filling module, and an STL file export module;

[0009] The data import module automatically imports carotid CTA image data from the user-specified folder and converts it into three-dimensional volume data;

[0010] The volume data clipping module clips the imported 3D volume data VolumeData according to the clipping range selected by the user and generates clipped sub-volume data;

[0011] The interactive carotid artery lumen segmentation module automatically and manually segments the carotid artery lumen based on sub-volume data through user interaction;

[0012] The 3D model construction module extracts surface meshes from the segmented data, generates three-dimensional surface data, and then constructs a preliminary three-dimensional geometric model;

[0013] The model processing module performs smoothing on the obtained preliminary three-dimensional geometric model;

[0014] Model clipping module, which clips the preliminary 3D geometric model through interactive selection of planes by the user;

[0015] Boundary detection module, which identifies the boundaries and holes of the preliminary 3D geometric model by analyzing the boundaries of the mesh;

[0016] The entrance and exit filling module fills the openings of the preliminary 3D geometric model by extracting the vertices of the 3D geometric model boundary, calculating the plane, and filling the closed boundary area through the constrained Delaunay triangulation method to generate new patches to fill the openings;

[0017] The STL file export module converts the processed 3D geometric model data into the STL file format and saves it in ASCII encoding.

[0018] Optionally, the workflow of the data import module is:

[0019] User selects a DICOM folder: The user triggers the folder selection operation by clicking the "Open CTA File" button on the interface. At this time, the system pops up a folder selection dialog box, allowing the user to select the folder containing the DICOM file. After the user selects the folder, the system obtains the folder path and saves it to the variable folderPath.

[0020] Read DICOM data: The system uses the dicomread function to read DICOM files from the folder path folderPath; if the selected folder contains DICOM files, the system will list and read all qualified files; during the reading process, the system will extract the metadata in each DICOM file;

[0021] Processing DICOM data: After reading the DICOM data, the system will determine whether the data is a multi-frame DICOM sequence. If it is a multi-frame DICOM sequence, the system will sort the multiple files by InstanceNumber or SliceLocation and stack them into 3D volume data.

[0022] Display data preview: After importing data, the system will use orthosliceViewer to display slices of 3D data; users can view different slices by sliding the yellow lines in the diagram;

[0023] Update interface controls: The system dynamically updates the slider controls on the main interface based on the size of the imported VolumeData.

[0024] Optionally, the workflow of the volume data clipping module is as follows:

[0025] Get the cropping range: After the data is imported, the user sets the data cropping range by sliding the sliders xRangeSlider, yRangeSlider, and zRangeSlider on the graphical user interface.

[0026] Crop volume data: After the user sets the crop range, the system uses the user-set xRange, yRange, and zRange to crop VolumeData to obtain sub-volume data subVolume;

[0027] Display cropping results: The system uses orthosliceViewer to display the sub-volume data subVolume.

[0028] Optionally, the workflow of the interactive carotid artery lumen segmentation module is as follows:

[0029] Initialization and data loading: When the user first calls this module, the input data is subVolume data; the system pops up a new interface, and the left side of the interface first performs preliminary binarization processing on the data according to the initial thresholds thLow and thHigh to display the preliminary mask;

[0030] Threshold adjustment and mask update: Users adjust the threshold through the thLow and thHigh input boxes. After clicking the "Update Threshold" button, the system regenerates the mask based on the new threshold;

[0031] 3D Region Growing: By clicking the "Region Growing" button, the user selects a seed point in the currently displayed slice and confirms the seed point by pressing the Enter key. The seed point will serve as the starting point for region growing. The system uses a breadth-first search method to grow the region based on the position of the seed point and the current mask to obtain the entire region connected to the seed point. The result of region growing will be merged into the current mask to obtain an updated segmentation result, and the slice display and 3D view will be updated synchronously.

[0032] Crop to Mask: When the user is satisfied with the segmentation result, click the "Crop to Mask" button to crop the volume data and mask to the minimum bounding box of the mask;

[0033] Mask preview: During all operations, users can always view the current mask status in the 3D view in the lower right corner;

[0034] Export and End: The user exports the segmentation results to the MATLAB workspace for subsequent processing.

[0035] Optionally, the workflow of the 3D model construction module is:

[0036] Generate a 3D surface: Use the isosurface function to extract the surface mesh from the 3D mask data ExportedMask; the isosurface function calculates the isosurface of the 3D volume data based on the set threshold and returns the face and vertex data on the surface; the generated face data and vertex data are used to construct the 3D geometry;

[0037] Simplify the three-dimensional surface: Use the reducepatch function to simplify the surface using the simplification ratio to obtain the simplified face data F2 and the simplified vertex data V2;

[0038] Save the simplified 3D model as an STL file;

[0039] Display the exported STL model: Use the stlread function to read the exported STL file, pop up a new graphics window to display the 3D model, and allow users to interactively view different perspectives of the model.

[0040] Optionally, the workflow of the model processing module is:

[0041] Default smoothing: The module first performs default smoothing. Specifically, it uses the SurfaceSmooth function to iteratively smooth the input V2 and F2. After the processing is completed, the smoothed vertex data V_smoothed is obtained.

[0042] Manual processing: After the default smoothing process, an interface window pops up, which divides the 3D drawing area on the left and the operation panel on the right. Use the patch function to display the model data with the default smoothing process in the 3D drawing area on the left.

[0043] Global smoothing operation: The user adjusts the smoothing parameters using the global smoothing factor slider and clicks the "Global Smooth" button. The system uses the patchSmooth function to smooth the current model based on the global smoothing factor set by the user based on the weighted average method and updates the vertex data. After the processing is completed, the graphics window will update the model display.

[0044] Mesh simplification operation: Users adjust the simplification level using the Mesh Simplification Ratio slider and click the "Redraw Mesh (Reducepatch)" button; the system calls the Reducepatch algorithm to simplify the face data and vertex data of the current model, and the updated model data is displayed in real time in the graphics window;

[0045] Restore and export: If the user is not satisfied with the editing results, click the "Restore original mesh" button to restore the model data to its initial state; and click the "Export mesh (F, V) to workspace" button to export the final edited model data to the MATLAB workspace.

[0046] Optionally, the workflow of the model cutting module is as follows:

[0047] Initialize the graphical interface: When the cropping module is activated, an interface will pop up first. The interface consists of two areas:

[0048] The left display area is used to display the 3D geometric model and draw the initial display of the mesh through the patch function. The vertex data and face data of the mesh are used to generate the model.

[0049] The right operation panel: contains four input boxes for users to enter the coordinates of the four points required for the clipping plane, and also provides "Confirm Plane", "Clip Model", and "Reverse Clip Model" buttons;

[0050] Plane definition and creation:

[0051] The user enters four points on the plane: Initially, the four points of the clipping plane (point1, point2, point3, point4) are predefined. After the user clicks the "Confirm Plane" button, the system calculates the plane equation based on the four points and draws the plane in the display area on the left.

[0052] Plane equation calculation: First calculate the normal vector of the plane by selecting four points, and then calculate the plane equation using the normal vector and the selected points;

[0053] Draw a plane: Based on the calculated plane equation, use the meshgrid function to generate a grid in the area where the plane is located, and calculate the z value of each point in the area; then use the surf function to draw the plane;

[0054] Cutting the model:

[0055] When the user clicks the “Crop” button, the geometric model is divided into two parts according to the plane shown on the left;

[0056] Reverse cropping:

[0057] The function of the "Reverse Cropping" button is the opposite of normal cropping. After the user clicks this button, the system will perform the same steps as cropping, but will retain the opposite part of the cropped model. The result of the reverse cropping operation will also update F_final and V_final and save them to the workspace.

[0058] Optionally, the workflow of the boundary detection module is:

[0059] Extract all edge information from the mesh F_final using the detect_mesh_boundary_and_holes function. Sorting and deduplicating all edges yields independent boundary edges. Traversing these independent boundary edges, connecting adjacent vertices in sequence until we return to the starting point, forming a complete boundary. Sort the boundary edges in descending order based on the number of vertices, print the number of detected boundaries, and pop up a graphics window to view the detected boundaries.

[0060] Optionally, the workflow of the entrance and exit filling module is as follows:

[0061] Extract boundary vertices: Get the vertex index loopIdx of each boundary, and extract the coordinates loopVerts of the boundary vertex from the global vertex set V_final;

[0062] Calculate the best-fit plane: Determine the direction vector and normal vector within the plane by calculating the centroid of the boundary vertices and using principal component analysis to calculate the main directions of the plane;

[0063] Project the 3D vertices into the plane: Project each boundary vertex relative to the plane, calculate its 2D coordinates, and generate a 2D coordinate set uv;

[0064] Perform Delaunay triangulation and map back to global coordinates: Perform constrained Delaunay triangulation on the two-dimensional projected point set, filter out valid triangles, and then map the vertex indices of the two-dimensional triangles back to the global vertex coordinates V_final to obtain a new face and fill the polygon;

[0065] Merge the filled patches with the original mesh: store the filled patches corresponding to each boundary into F_patch and merge them with the patches of the original mesh to generate a new patch set F_new;

[0066] Display results: Use a graphical interface to display the filled grid.

[0067] Optionally, the workflow of the STL file export module is:

[0068] Open the file and write header information: Use fopen to open the STL file filled_model.stl in the default path and write the file header solidmodel to mark the beginning of the file;

[0069] Traverse the triangle patch and write data: For each triangle patch, get the coordinates of the three vertices corresponding to the patch. The indices of these vertices correspond to V_final through F_new; for each triangle, extract the three-dimensional coordinates of its three vertices (v1, v2, v3), calculate the normal vector, and use fprintf to write the normal vector and vertex data of each triangle;

[0070] Write to the end and close the file: Write endsolidmodel at the end of the file to mark the end of the STL file, and then use fclose to close the file.

[0071] As can be seen from the above technical solutions, compared to existing technologies, the present invention provides a CTA image-based carotid artery lumen geometry model construction system, encompassing modules such as data import, volume data cropping, interactive carotid artery lumen segmentation, 3D model construction, model processing, model cropping, boundary detection, entrance and exit filling, and STL file export. Each module has a clear division of labor and a detailed workflow. This invention addresses the problems of existing geometric modeling methods, such as reliance on commercial software, high costs, legal risks, and cumbersome and slow operational procedures. By enabling simple, efficient, and accurate construction of carotid artery geometry models, the present invention provides strong support for the analysis, research, and diagnosis of carotid artery fluid dynamics in diseases such as atherosclerosis and aneurysms. BRIEF DESCRIPTION OF THE DRAWINGS

[0072] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0073] Figure 1 A schematic diagram of the system structure provided by the present invention;

[0074] Figure 2 This is a schematic diagram of the CTA data slice preview provided by the present invention;

[0075] Figure 3 This is a schematic diagram of previewing the cropped CTA data slices provided by the present invention;

[0076] Figure 4 A schematic diagram of the interactive 3D segmentation tool provided by the present invention;

[0077] Figure 5 A schematic diagram of the STL model provided by the present invention;

[0078] Figure 6 This is a schematic diagram of the model processing interface provided by the present invention;

[0079] Figure 7 This is a schematic diagram of the model cutting interface provided by the present invention;

[0080] Figure 8 A schematic diagram of the boundary viewing interface provided by the present invention;

[0081] Figure 9 This is a schematic diagram of the original model and boundary plane filling results provided by the present invention. DETAILED DESCRIPTION

[0082] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0083] The embodiment of the present invention discloses a carotid artery lumen geometric model construction system based on CTA images, comprising: a data import module, a volume data clipping module, an interactive carotid artery lumen segmentation module, a 3D model construction module, a model processing module, a model clipping module, a boundary detection module, an entrance and exit filling module, and an STL file export module;

[0084] The data import module automatically imports carotid CTA image data from the user-specified folder and converts it into three-dimensional volume data;

[0085] The volume data clipping module clips the imported 3D volume data VolumeData according to the clipping range selected by the user and generates clipped sub-volume data;

[0086] The interactive carotid artery lumen segmentation module automatically and manually segments the carotid artery lumen based on sub-volume data through user interaction;

[0087] The 3D model construction module extracts surface meshes from the segmented data, generates three-dimensional surface data, and then constructs a preliminary three-dimensional geometric model;

[0088] The model processing module performs smoothing on the obtained preliminary three-dimensional geometric model;

[0089] Model clipping module, which clips the preliminary 3D geometric model through interactive selection of planes by the user;

[0090] Boundary detection module, which identifies the boundaries and holes of the preliminary 3D geometric model by analyzing the boundaries of the mesh;

[0091] The entrance and exit filling module fills the openings of the preliminary 3D geometric model by extracting the vertices of the 3D geometric model boundary, calculating the plane, and filling the closed boundary area through the constrained Delaunay triangulation method to generate new patches to fill the openings;

[0092] The STL file export module converts the processed 3D geometric model data into the STL file format and saves it in ASCII encoding.

[0093] The following is a detailed description of each module:

[0094] Data import module

[0095] The main function of this module is to automatically import carotid artery CTA (computed tomography) image data from the user-specified folder and convert it into 3D volume data for subsequent operations. The specific steps are as follows:

[0096] 1.1 User selects DICOM folder

[0097] First, the user triggers a folder selection operation by clicking the "Open CTA File" button on the interface. A folder selection dialog box pops up, allowing the user to select the folder containing the DICOM file. After the user selects a folder, the system retrieves the folder path and saves it to the variable folderPath.

[0098] 1.2 Reading DICOM Data

[0099] The system uses the dicomread function to read DICOM files from the folder path folderPath. If the selected folder contains DICOM files, the system lists and reads all matching files. During the reading process, the system extracts metadata from each DICOM file, such as pixel spacing and slice thickness, and stores it in VolumeInfo.

[0100] 1.3 Processing DICOM Data

[0101] After the DICOM data is read, the system determines whether the data is a multi-frame DICOM sequence. If it is a multi-frame DICOM sequence, the system sorts the multiple files by InstanceNumber or SliceLocation and stacks them into 3D volume data.

[0102] 1.4 Display data preview

[0103] After importing the data, the system will use orthosliceViewer to display the slices of the 3D data (such as Figure 2 This allows users to intuitively view the imported CTA data and view different sections by sliding the yellow lines in the graph.

[0104] 1.5 Update interface controls

[0105] The system dynamically updates the main interface (such as Figure 1 The slider controls (xRangeSlider, yRangeSlider, and zRangeSlider) on the VolumeData are shown in the figure. These sliders are used to set the data clipping range. The minimum and maximum values of the sliders are automatically adjusted according to the size of VolumeData to ensure that users can select a reasonable clipping range.

[0106] Volume data clipping module

[0107] The main function of the volume data clipping module is to clip the imported 3D volume data VolumeData according to the clipping range selected by the user, generating the clipped sub-volume data subVolume. This module can dynamically adjust the sub-volume data according to the clipping range set by the user. The specific process is as follows:

[0108] 2.1 Get the clipping range

[0109] After importing the data, the user sets the cropping range by sliding the xRangeSlider, yRangeSlider, and zRangeSlider sliders on the graphical user interface. These sliders correspond to the x-axis (columns), y-axis (rows), and z-axis (slices) of the data, respectively. These values are stored in the xRange, yRange, and zRange variables.

[0110] 2.2 Clipping Volume Data

[0111] After the user sets the cropping range, the system crops VolumeData using the user-defined xRange, yRange, and zRange to generate the subvolume data subVolume. SubVolume is the cropped subvolume data, encompassing the user-selected area. It is a subset of VolumeData, and its size is determined by the user-defined cropping range.

[0112] 2.3 Display cropping results

[0113] The system uses orthosliceViewer to display subvolume data, such as Figure 3 As shown in the figure, users can see the multi-slice view of the subVolume, which makes it easy to observe the data intuitively.

[0114] Interactive carotid artery lumen segmentation module

[0115] The Interactive Carotid Lumen Segmentation Module performs automatic and manual segmentation of the carotid lumen based on subvolume data through user interaction. This module combines threshold segmentation, manually edited masks, and region growing techniques, and provides a real-time 3D preview function to facilitate precise adjustment and modification of segmentation results. The specific process is as follows:

[0116] 3.1 Initialization and data loading

[0117] When the user first calls this module, the input data is subVolume data. The system pops up a new interface (such as Figure 4 The left side of the interface first performs a preliminary binarization of the data based on the initial thresholds thLow and thHigh, displaying a preliminary mask. At this point, all voxels within the subvolume data that meet the threshold range are marked as true, while the rest are marked as false. The upper right corner of the interface contains the operation area, while the lower right corner provides a preview of the 3D mask, which the user can rotate.

[0118] 3.2 Threshold adjustment and mask update

[0119] The user adjusts the threshold using the thLow and thHigh input boxes. Clicking the "Update Threshold" button causes the system to regenerate the mask based on the new threshold. The updated mask is displayed on the current slice, and the 3D Mask View is also updated synchronously.

[0120] 3.3 Manually edit the mask

[0121] When users want to fine-tune the automatic segmentation results, they can enter manual editing mode by clicking the "Manually Add Mask" or "Manually Erase Mask" buttons. The system allows users to add or erase mask areas by freely drawing on the current slice.

[0122] The freely drawn region is instantly applied to the current slice and the 3D view is updated. Users can fine-tune the segmentation result through manual editing.

[0123] 3.43D Region Growing

[0124] By clicking the "Region Grow" button, the user can select a seed point in the currently displayed slice and confirm the seed point by pressing the Enter key. This seed point will serve as the starting point for region growing. The system uses a breadth-first search (BFS) method to grow the region based on the location of the seed point and the current mask, obtaining the entire region connected to the seed point.

[0125] The results of region growing will be merged into the current mask to obtain an updated segmentation result, and the slice display and 3D view will be updated synchronously.

[0126] The updated segmentation result can continue to undergo multiple manual editing of masks and 3D region growing operations until a user-satisfied result is achieved.

[0127] 3.5 Clipping to Mask

[0128] Once you're satisfied with the segmentation results, you can click the "Crop to Mask" button to crop the volume data and mask to the mask's minimum bounding box. This operation reduces the size of the data to the smallest region containing all true voxels, eliminating excess white space and reducing the computational effort required for subsequent processing.

[0129] The cropped data will be updated to the system, and the range of the slice slider will be updated to ensure that subsequent operations are performed within the cropped area.

[0130] 3.63D Mask Preview

[0131] During all operations, users can always view the current mask status in the 3D view in the lower right corner. This view uses isosurface to generate a 3D isosurface, helping users intuitively see the three-dimensional effect of the mask. If the mask area is empty, the system will display a prompt in the 3D view.

[0132] 3.7 Export and End

[0133] Users can export the segmentation results (mask and data) to the MATLAB workspace for subsequent processing. After clicking the "Export Mask to Workspace" button, the current mask will be saved as ExportedMask for subsequent use in other modules.

[0134] 3D model building module

[0135] This module can convert 3D mask data ExportedMask into a model suitable for 3D modeling and simulation, and export it as an STL file.

[0136] 4.1 Generate three-dimensional surface:

[0137] Use the isosurface function to extract the surface mesh from the 3D mask data ExportedMask. The isosurface function calculates the isosurface (surface) of the 3D volume data based on a set threshold (usually 0.5) and returns the face and vertex data on the surface. The generated face data (F) and vertex data (V) are used to construct the 3D geometry. F: Face data (Faces) of the 3D surface, indicating that each triangular face is connected by three vertices. V: Vertex data (Vertices), indicating the 3D coordinates of each vertex on the surface.

[0138] 4.2 Simplify three-dimensional surface:

[0139] Because the isosurface function can generate very complex surface meshes with excessive faces and vertices, these meshes often need to be simplified. Using the reducepatch function, a simplification ratio (e.g., 0.5, which retains 50% of the faces) is used to simplify the surface, generating simplified face data F2 and simplified vertex data V2. The reducepatch function effectively reduces redundant faces, preserves the surface's essential shape, and optimizes subsequent computation and storage.

[0140] 4.3 Save the simplified 3D model as an STL file:

[0141] Use the stlwrite function to save the simplified 3D surface data as an STL file. The STL format is widely used in 3D printing and CAD tools. The default file name is ExportedMask_Surface.stl, which can be modified as needed.

[0142] 4.4 Display the exported STL model:

[0143] Use the stlread function to read the exported STL file, and a new graphics window will pop up to display the 3D model (such as Figure 5 ) and allows the user to interactively view different perspectives of the model.

[0144] Model processing module

[0145] The main purpose of this module is to smooth the preliminary 3D geometric model obtained in the previous steps to eliminate surface irregularities and noise and improve the geometric shape. The specific process and key variables are described as follows:

[0146] 5.1 Default smoothing

[0147] The module first performs a default smoothing process, specifically using the SurfaceSmooth function to iteratively smooth the inputs V2 and F2. The core idea is to use the neighborhood information of each vertex to calculate the normal vectors and area weights of adjacent faces, adjusting the vertex positions to smooth the overall mesh and reduce local sharpness and noise. A damping factor (DampingFactor) is used to suppress oscillations and ensure that vertex movement remains within the permitted range until the preset displacement tolerance (default 0.02) is met or the maximum number of iterations (default 100) is reached. After processing, the smoothed vertex data V_smoothed is obtained.

[0148] 5.2 Manual Processing

[0149] After the module is smoothed by default, the interface window (such as Figure 6 (as shown in the figure), which divides the window into a 3D drawing area on the left and an operation panel on the right. In the operation panel, set sliders and buttons for parameters such as global smoothing and mesh simplification. Use the patch function to display the default smoothed model data (F2, V_smoothed) in the 3D drawing area on the left.

[0150] 5.3 Global Smoothing Operation

[0151] The user adjusts the smoothing parameters using the global smoothing factor slider and clicks the "Global Smooth" button. The system uses the patchSmooth function to smooth the current model based on the global smoothing factor set by the user using a weighted average method and updates the vertex data.

[0152] After the processing is completed, the graphics window will update the model display, and the user can intuitively see the changes before and after smoothing.

[0153] 5.4 Mesh simplification operations

[0154] The user adjusts the simplification level using the mesh simplification ratio slider and clicks the "Redraw Mesh (Reducepatch)" button.

[0155] The system calls the reducepatch algorithm to simplify the face data and vertex data of the current model, reducing redundant faces and vertices and improving the computational efficiency of the model.

[0156] The updated model data is displayed in real time in the graphics window.

[0157] 5.5 Restoration and Export

[0158] If the user is not satisfied with the editing results, he can click the "Restore Original Mesh" button to restore the model data to its initial state.

[0159] Users can also click the "Export Mesh (F, V) to Workspace" button to export the final edited model data (EditedFaces, EditedVertices) to the MATLAB workspace.

[0160] Model clipping module

[0161] This module allows users to interactively select a plane to crop a 3D geometric model. Users can define a plane by specifying four points, and then use this plane to split or crop the model into desired parts. This module provides three functions: determine the plane, crop the model, and reverse crop the model. The results of these operations are updated in real time and displayed in the graphical interface on the left.

[0162] 6.1. Initialize the graphical interface

[0163] When the cropping module is activated, an interface will pop up first (such as Figure 7 ). The interface consists of two areas:

[0164] The left display area is used to display the 3D geometric model and draw the initial display of the mesh through the patch function. The vertex data and face data of the mesh are used to generate the model.

[0165] The operation panel on the right: contains four input boxes for users to enter the coordinates of the four points required for the clipping plane, and also provides "Confirm Plane", "Clip Model", and "Reverse Clip Model" buttons.

[0166] 6.2. Plane definition and creation

[0167] The user enters four points on the plane: Initially, the four points of the clipping plane (point1, point2, point3, point4) are predefined. The user can modify the coordinates of these points. After clicking the "Confirm Plane" button, the system calculates the plane equation based on the four points and draws the plane in the display area on the left.

[0168] Plane equation calculation: First, calculate the plane's normal vector using the four selected points. Then, use the normal vector and the selected points to calculate the plane equation. The standard form of the plane equation is ax + by + cz = d, where (a, b, c) is the normal vector and d is a constant term.

[0169] Draw a plane: Based on the calculated plane equation, use the meshgrid function to generate a grid around the plane and calculate the z value for each point in the area. Then use the surf function to draw the plane.

[0170] 6.3. Model cropping

[0171] When the user clicks the "Crop" button, the geometric model (EditedFaces, EditedVertices) is divided into two parts according to the plane shown on the left.

[0172] 6.3.1 Clipping Triangles

[0173] Compute the signed distances from each triangle's three vertices to the plane.

[0174] Use the clipPolygonWithPlane function to clip a polygon. This function processes each vertex based on the plane's position. If a vertex is above the plane, it is retained. Otherwise, the intersection point is interpolated using the intersection formula and added to the clipped polygon. The polygon is then converted into multiple triangles.

[0175] 6.3.2 Determine the retained portion

[0176] For each vertex, calculate its signed distance to the plane. Use this distance to determine whether the vertex is above or below the plane. If the distance is greater than or equal to zero, the vertex is above the plane; otherwise, it is below the plane. If it is the "Crop" button, the portion above the plane is retained.

[0177] You can perform multiple clipping by setting different planes.

[0178] After each cropping is completed, the system will automatically save the cropped new face data F_final and vertex data V_final to the workspace for subsequent operations.

[0179] 6.4. Reverse Cropping

[0180] The "Reverse Crop" button performs the opposite of normal cropping. Clicking this button will cause the system to perform the same steps as cropping, but will retain the opposite portion of the model. The results of the reverse cropping operation will also update F_final and V_final and be saved to the workspace.

[0181] Boundary detection module

[0182] This module identifies the boundaries and holes of the model by analyzing the boundaries of the mesh. By calculating the boundary information in the triangle mesh, the module can accurately find the topology of all boundaries and holes and return a list of boundaries and holes.

[0183] The detect_mesh_boundary_and_holes function is used to extract all edge information from the mesh F_final. These edges are sorted and deduplicated to obtain independent boundary edges. By traversing these independent edges, adjacent vertices are connected in sequence until the starting point is returned to form a complete boundary. Only boundaries that contain at least three different vertices are considered valid boundaries. Valid boundaries are added to the boundaries list. Sort in descending order according to the number of vertices on the boundary. Boundaries is a list containing all valid boundaries, each boundary is represented by a set of vertex indices. The number of detected boundaries is printed, and a graphics window pops up to view the detected boundaries (such as Figure 8 Each boundary vertex coordinate is plotted with a different color (red, green, blue, etc.) and line width (2).

[0184] The correct model will contain three boundaries: one inlet and two outlets of the carotid artery.

[0185] Entrance and exit filling modules

[0186] This module fills the openings (boundaries) of the model by extracting the vertices of the boundary, calculating the plane, and filling the closed boundary area through the constrained Delaunay triangulation method to generate new patches to fill these openings.

[0187] 8.1 Extract boundary vertices: Get the vertex index loopIdx of each boundary and extract the coordinates loopVerts of these vertices from the global vertex set V_final.

[0188] 8.2 Compute the Best Fit Plane: Determine the direction vectors and normal vectors within the plane by calculating the centroids of the boundary vertices and computing the plane's principal orientations using principal component analysis (PCA). PCA provides a plane where the first two principal components (direction vectors) define the orientation within the plane, and the third principal component is the normal vector. These direction vectors will be used to project points in 3D space onto the plane.

[0189] 8.3 Project 3D vertices into the plane: Project each boundary vertex relative to the plane, calculate its 2D coordinates, and generate a 2D coordinate set uv.

[0190] 8.4 Perform Delaunay triangulation and map back to global coordinates: Perform constrained Delaunay triangulation on the two-dimensional projected point set. After screening valid triangles, map the vertex indices of the two-dimensional triangles back to the global vertex coordinates V_final to obtain a new facet and fill the polygon.

[0191] 8.5 Merge the filled patch with the original mesh:

[0192] The filling patches corresponding to each boundary are stored in F_patch and merged with the patches of the original mesh to generate a new patch set F_new.

[0193] 8.6 Display results:

[0194] Use the graphical interface to display the filled mesh, where the original mesh is displayed in semi-transparent blue. The filled face is highlighted in red (e.g. Figure 9 shown).

[0195] STL file export module

[0196] This module is used to convert the processed 3D mesh data (including vertex and facet information) into STL file format and save it in ASCII encoding.

[0197] 9.1 Open the file and write the header information:

[0198] Use fopen to open the STL file filled_model.stl in the default path (current working folder) and write the file header solidmodel to mark the beginning of the file.

[0199] 9.2 Traverse the triangle patch and write data:

[0200] For each triangle patch (each row in F_new), retrieve the coordinates of the three vertices corresponding to that patch. These vertex indices are mapped to V_final via F_new. For each triangle, extract the 3D coordinates of its three vertices (v1, v2, v3). Calculate the normal vector and write the normal and vertex data for each triangle using fprintf.

[0201] 9.3 Write the tail and close the file:

[0202] Write endsolidmodel at the end of the file to mark the end of the STL file, and then use fclose to close the file to ensure that the file is saved intact.

[0203] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Reference can be made to the common and similar parts between the various embodiments. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the method description.

[0204] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention is not limited to the embodiments shown herein but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A system for constructing a carotid artery lumen geometric model based on CTA images, characterized in that: include: Data import module, volume data cropping module, interactive carotid artery lumen segmentation module, 3D model construction module, model processing module, model cropping module, boundary detection module, entrance and exit filling module, STL file export module; The data import module automatically imports carotid CTA image data from the user-specified folder and converts it into three-dimensional volume data; The volume data clipping module clips the imported 3D volume data VolumeData according to the clipping range selected by the user and generates clipped sub-volume data; The interactive carotid artery lumen segmentation module automatically and manually segments the carotid artery lumen based on sub-volume data through user interaction; The 3D model construction module extracts surface meshes from the segmented data, generates three-dimensional surface data, and then constructs a preliminary three-dimensional geometric model; The model processing module performs smoothing on the obtained preliminary three-dimensional geometric model; Model clipping module, which clips the preliminary 3D geometric model through interactive selection of planes by the user; Boundary detection module, which identifies the boundaries and holes of the preliminary 3D geometric model by analyzing the boundaries of the mesh; The entrance and exit filling module fills the openings of the preliminary 3D geometric model by extracting the vertices of the 3D geometric model boundary, calculating the plane, and filling the closed boundary area through the constrained Delaunay triangulation method to generate new patches to fill the openings; The STL file export module converts the processed 3D geometric model data into the STL file format and saves it in ASCII encoding.

2. The system for constructing a carotid artery lumen geometric model based on CTA images according to claim 1, characterized in that: The workflow of the data import module is as follows: User selects a DICOM folder: The user clicks the "Open CTA File" button on the interface to trigger the folder selection operation. At this time, the system pops up a folder selection dialog box, allowing the user to select the folder containing the DICOM file. After the user selects the folder, the system obtains the folder path and saves it to the variable folderPath. Read DICOM data: The system uses the dicomread function to read DICOM files from the folder path folderPath; if the selected folder contains DICOM files, the system will list and read all qualified files; during the reading process, the system will extract the metadata in each DICOM file; Processing DICOM data: After reading the DICOM data, the system will determine whether the data is a multi-frame DICOM sequence. If it is a multi-frame DICOM sequence, the system will sort the multiple files by InstanceNumber or SliceLocation and stack them into 3D volume data. Display data preview: After importing data, the system will use orthosliceViewer to display slices of 3D data; users can view different slices by sliding the yellow lines in the diagram; Update interface controls: The system dynamically updates the slider controls on the main interface based on the size of the imported VolumeData.

3. The system for constructing a carotid artery lumen geometric model based on CTA images according to claim 1, characterized in that: The workflow of the volume data clipping module is as follows: Get the cropping range: After the data is imported, the user sets the data cropping range by sliding the sliders xRangeSlider, yRangeSlider, and zRangeSlider on the graphical user interface. Crop volume data: After the user sets the crop range, the system uses the user-set xRange, yRange, and zRange to crop VolumeData to obtain sub-volume data subVolume; Display cropping results: The system uses orthosliceViewer to display the sub-volume data subVolume.

4. The system for constructing a carotid artery lumen geometric model based on CTA images according to claim 1, characterized in that: The workflow of the interactive carotid artery lumen segmentation module is as follows: Initialization and data loading: When the user first calls this module, the input data is subVolume data; the system pops up a new interface, and the left side of the interface first performs preliminary binarization processing on the data according to the initial thresholds thLow and thHigh to display the preliminary mask; Threshold adjustment and mask update: Users adjust the threshold through the thLow and thHigh input boxes. After clicking the "Update Threshold" button, the system regenerates the mask based on the new threshold; 3D Region Growing: By clicking the "Region Growing" button, the user selects a seed point in the currently displayed slice and confirms the seed point by pressing the Enter key. This seed point will serve as the starting point for region growing. The system uses a breadth-first search method to grow the region based on the location of the seed point and the current mask, obtaining the entire region connected to the seed point. The result of region growing will be merged into the current mask to obtain the updated segmentation result, and the slice display and 3D view will be updated synchronously; Crop to Mask: When the user is satisfied with the segmentation result, click the "Crop to Mask" button to crop the volume data and mask to the minimum bounding box of the mask; Mask preview: During all operations, users can always view the current mask status in the 3D view in the lower right corner; Export and End: The user exports the segmentation results to the MATLAB workspace for subsequent processing.

5. The system for constructing a carotid artery lumen geometric model based on CTA images according to claim 1, characterized in that: The workflow of the 3D model construction module is as follows: Generate a 3D surface: Use the isosurface function to extract the surface mesh from the 3D mask data ExportedMask; the isosurface function calculates the isosurface of the 3D volume data based on the set threshold and returns the face and vertex data on the surface; the generated face data and vertex data are used to construct the 3D geometry; Simplify the three-dimensional surface: Use the reducepatch function to simplify the surface using the simplification ratio to obtain the simplified face data F2 and the simplified vertex data V2; Save the simplified 3D model as an STL file; Display the exported STL model: Use the stlread function to read the exported STL file, pop up a new graphics window to display the 3D model, and allow users to interactively view different perspectives of the model.

6. The system for constructing a carotid artery lumen geometric model based on CTA images according to claim 1, characterized in that: The workflow of the model processing module is as follows: Default smoothing: The module first performs default smoothing. Specifically, it uses the SurfaceSmooth function to iteratively smooth the input V2 and F2. After the processing is completed, the smoothed vertex data V_smoothed is obtained. Manual processing: After the default smoothing process, an interface window pops up, which divides the 3D drawing area on the left and the operation panel on the right. Use the patch function to display the model data with the default smoothing process in the 3D drawing area on the left. Global smoothing operation: The user adjusts the smoothing parameters using the global smoothing factor slider and clicks the "Global Smooth" button. The system uses the patchSmooth function to smooth the current model based on the global smoothing factor set by the user using a weighted average method and updates the vertex data. After processing is complete, the graphics window will update the model display; Mesh simplification: Users adjust the simplification level using the Mesh Simplification Ratio slider and click the "Redraw Mesh (Reducepatch)" button. The system invokes the Reducepatch algorithm to simplify the face and vertex data of the current model. The updated model data is displayed in real time in the graphics window. Restore and Export: If the user is not satisfied with the editing results, click the "Restore Original Mesh" button to restore the model data to its initial state; And click the "Export Mesh (F, V) to Workspace" button to export the final edited model data to the MATLAB workspace.

7. The system for constructing a carotid artery lumen geometric model based on CTA images according to claim 1, characterized in that: The workflow of the model cutting module is as follows: Initialize the graphical interface: When the cropping module is activated, an interface will pop up first. The interface consists of two areas: The left display area is used to display the 3D geometric model and draw the initial display of the mesh through the patch function. The vertex data and face data of the mesh are used to generate the model. The right operation panel: contains four input boxes for users to enter the coordinates of the four points required for the clipping plane, and also provides "Confirm Plane", "Clip Model", and "Reverse Clip Model" buttons; Plane definition and creation: The user enters four points on the plane: Initially, the four points of the clipping plane (point1, point2, point3, point4) are predefined. After the user clicks the "Confirm Plane" button, the system calculates the plane equation based on the four points and draws the plane in the display area on the left. Plane equation calculation: First calculate the normal vector of the plane by selecting four points, and then calculate the plane equation using the normal vector and the selected points; Draw a plane: Based on the calculated plane equation, use the meshgrid function to generate a grid in the area where the plane is located, and calculate the z value of each point in the area; then use the surf function to draw the plane; Cutting the model: When the user clicks the "Crop" button, the geometric model is divided into two parts according to the plane shown on the left; Reverse cropping: The function of the "Reverse Cropping" button is the opposite of normal cropping. After the user clicks this button, the system will perform the same steps as cropping, but will retain the opposite part of the cropped model. The result of the reverse cropping operation will also update F_final and V_final and save it to the workspace.

8. The system for constructing a carotid artery lumen geometric model based on CTA images according to claim 1, characterized in that: The workflow of the boundary detection module is as follows: Extract all edge information from the mesh F_final using the detect_mesh_boundary_and_holes function. Sorting and deduplicating all edges yields independent boundary edges. Traversing these independent boundary edges, connecting adjacent vertices in sequence until we return to the starting point, forming a complete boundary. Sort the boundary edges in descending order based on the number of vertices, print the number of detected boundaries, and pop up a graphics window to view the detected boundaries.

9. The system for constructing a carotid artery lumen geometric model based on CTA images according to claim 1, characterized in that: The workflow of the entrance and exit filling module is as follows: Extract boundary vertices: Get the vertex index loopIdx of each boundary, and extract the coordinates loopVerts of the boundary vertex from the global vertex set V_final; Calculate the best-fit plane: Determine the direction vector and normal vector within the plane by calculating the centroid of the boundary vertices and using principal component analysis to calculate the main directions of the plane; Project the 3D vertices into the plane: Project each boundary vertex relative to the plane, calculate its 2D coordinates, and generate a 2D coordinate set uv; Perform Delaunay triangulation and map back to global coordinates: Perform constrained Delaunay triangulation on the two-dimensional projected point set, filter out valid triangles, and then map the vertex indices of the two-dimensional triangles back to the global vertex coordinates V_final to obtain a new face and fill the polygon; Merge the filled patches with the original mesh: store the filled patches corresponding to each boundary into F_patch and merge them with the patches of the original mesh to generate a new patch set F_new; Display results: Use a graphical interface to display the filled grid.

10. The system for constructing a carotid artery lumen geometric model based on CTA images according to claim 1, characterized in that: The workflow of the STL file export module is as follows: Open the file and write header information: Use fopen to open the STL file filled_model.stl in the default path and write the file header solidmodel to mark the beginning of the file; Traverse the triangle patch and write data: For each triangle patch, get the coordinates of the three vertices corresponding to the patch. The indices of these vertices correspond to V_final through F_new; for each triangle, extract the three-dimensional coordinates of its three vertices (v1, v2, v3), calculate the normal vector, and use fprintf to write the normal vector and vertex data of each triangle; Write to the end and close the file: Write endsolid model at the end of the file to mark the end of the STL file, and then use fclose to close the file.

Citation Information

Patent Citations

  • Dynamic heart chamber segmentation method based on CTA image

    CN107330888A

  • Coronary artery CTA automatic postprocessing system based on artificial intelligence

    CN108765363A