CTA image-based carotid artery lumen geometric model construction system

By designing a carotid artery lumen geometric model construction system based on CTA images, the high cost and operational complexity problems caused by relying on commercial software in the prior art are solved, and efficient and accurate carotid artery geometric model construction is achieved, supporting fluid dynamic analysis in clinical medicine.

CN120086916AActive Publication Date: 2025-06-03ZHEJIANG UNIV

Patent Information

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

AI Technical Summary

Technical Problem

The existing carotid artery geometric model construction method relies on commercial software, which is costly, cumbersome in operation and legal risks, and cannot efficiently build an accurate carotid artery geometric model.

Method used

A carotid artery lumen geometric model construction system based on CTA images is designed, including data import, volume data cropping, interactive segmentation, 3D model construction, model processing, model cropping, boundary detection, entrance and exit filling and STL file export modules to realize a systematic model construction process.

Benefits of technology

This system simplifies the construction process of carotid geometric model, reduces costs, avoids legal risks, improves construction efficiency and accuracy, and supports fluid dynamic analysis and research in diseases such as atherosclerosis and aneurysms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120086916A_ABST
    Figure CN120086916A_ABST
Patent Text Reader

Abstract

The invention discloses a carotid artery lumen geometric model construction system based on a CTA image, relates to the technical field of image processing, and comprises a data import module, a volume data cutting module, an interactive carotid artery lumen segmentation module, a 3D model construction module, a model processing module, a model cutting module, a boundary detection module, an entrance and exit filling module, an STL file export module and the like. The modules are clear in division of labor and have detailed working processes. According to the method, the problems that an existing geometric modeling method depends on commercial software, cost is high, legal risks exist, the operation process is tedious, and the speed is low are solved, the carotid artery geometric model can be simply, conveniently, efficiently and accurately constructed, and powerful support is provided for carotid artery fluid dynamics analysis, research and diagnosis of diseases such as atherosclerosis and aneurysm.
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 specifically, to a system for constructing a geometric model of the carotid artery lumen based on CTA images. Background Art

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

[0003] Relying on commercial software: Medical image data (such as CTA images) usually need to be segmented and modeled with the help of commercial software (such as MIMICS), and then the model is refined using software such as Geomagic before the required geometric model can be obtained. This process requires multiple software to work together, which is not only costly but also faces legal compliance issues, such as the risk of using pirated software.

[0004] Complicated operation process: The existing segmentation and modeling processes are extremely complex, involving data transfer and processing between different software. Due to the complex structure of commercial software itself, even when dealing with a simple carotid artery model, the speed is relatively slow, and it cannot provide an efficient solution for related research and clinical applications.

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

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

[0007] To achieve the above object, the present invention adopts the following technical solutions:

[0008] A system for constructing a geometric model of the carotid artery lumen based on CTA images, comprising: a data import module, a volume data cropping module, an interactive carotid artery lumen segmentation module, a 3D model construction module, a model processing module, a model cropping module, a boundary detection module, an inlet / outlet filling module, and an STL file export module;

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

[0010] The volume data cropping module crops the imported three-dimensional volume data VolumeData according to the cropping range selected by the user to generate cropped sub-volume data;

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

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

[0013] The model processing module smooths the obtained preliminary three-dimensional geometric model;

[0014] The model cropping module crops the preliminary three-dimensional geometric model by interactively selecting a plane by the user;

[0015] The boundary detection module identifies the boundaries and holes of the preliminary three-dimensional geometric model by analyzing the boundaries of the mesh;

[0016] The inlet / outlet filling module fills the openings in the preliminary three-dimensional geometric model. By extracting the vertices of the boundary of the three-dimensional geometric model, calculating the plane, and filling the closed boundary region through the constrained Delaunay triangulation method, new patches are generated to fill the openings;

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

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

[0019] The 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 a folder containing DICOM files; After the user selects the folder, the system obtains the path of the folder 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 eligible files; During the reading process, the system extracts the meta-information in each DICOM file;

[0021] Process DICOM data: 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 multiple files according to InstanceNumber or SliceLocation and stacks them into three-dimensional volume data VolumeData;

[0022] Display data preview: After importing the data, the system will use orthosliceViewer to display slices of the 3D data; the user can view different cross-sections by sliding the yellow line in the figure;

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

[0024] Optionally, the working process of the volume data cropping module is as follows:

[0025] Obtain the cropping range: After the data is imported, the user sets the cropping range of the data by sliding the sliders at both ends of the xRangeSlider, yRangeSlider, and zRangeSlider on the graphical user interface;

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

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

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

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

[0030] Threshold adjustment and mask update: The user adjusts the thresholds through the thLow and thHigh input boxes, and after clicking the "Update Threshold" button, the system regenerates the mask mask according to the new thresholds;

[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; this seed point will be used as the starting point for region growing, and the system uses the breadth-first search method to perform region growing according to the position of the seed point and the current mask 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 the 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 the mask to the minimum bounding box of the mask;

[0033] Mask preview: During all operations, the user always views the current mask situation in the 3D view in the lower right corner;

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

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

[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 according to the set threshold and returns the face and vertex data on the surface; the generated face data and vertex data will be used to construct the 3D geometry;

[0037] Simplify the 3D surface: Use the reducepatch function to simplify the surface with a 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 figure window to display the 3D model, and allow the user to interactively view different perspectives of the model.

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

[0041] Default smoothing: The module first performs default smoothing, specifically using the SurfaceSmooth function to perform iterative smoothing on 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, a interface window pops up, and in this window, the 3D drawing area on the left and the operation panel on the right are divided; use the patch function to display the model data after the default smoothing in the 3D drawing area on the left;

[0043] Global smoothing operation: The user adjusts the smoothing parameter through the global smoothing factor slider and clicks the "Global Smoothing" button; the system uses the patchSmooth function to smooth the current model based on the weighted average method according to the global smoothing factor set by the user and updates the vertex data; after the processing is completed, the figure window will update the model display;

[0044] Mesh simplification operation: The user adjusts the simplification degree through the mesh simplification ratio slider and clicks 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 will be displayed in real time in the graphics window;

[0045] Recovery and export: If the user is not satisfied with the editing result, click the "Restore Original Mesh" button to restore the model data to the initial state; and click the "Export Mesh (F,V) to Workspace" button to export the finally edited model data to the MATLAB workspace.

[0046] Optionally, the working process of the model clipping module is as follows:

[0047] Initialize the graphical interface: When the clipping module is activated, a interface will pop up first, and the interface contains two areas:

[0048] Left display area: Used to display the 3D geometric model, and the initial display of the mesh is drawn through the patch function. The vertex data and face data of the mesh are used to generate the model;

[0049] Right operation panel: Contains four input boxes for the user to input the coordinates of the four points required for the clipping plane, and provides buttons of "Determine Plane", "Clip Model", and "Reverse Clip Model";

[0050] Plane definition and creation:

[0051] User inputs four points of the plane: Initially, the four points (point1, point2, point3, point4) of the clipping plane are predefined; after the user clicks the "Determine Plane" button, the system will calculate the equation of the plane based on the four points and draw the plane in the left display area;

[0052] Plane equation calculation: Through the selected four points, first calculate the normal vector of the plane, and then use the normal vector and the selected point to calculate the plane equation;

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

[0054] Clip the model:

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

[0056] Reverse clipping:

[0057] The function of the "Reverse Clipping" button is the opposite of normal clipping; after the user clicks this button, the system will perform the same steps as clipping, but will retain the part opposite to the clipping model; the result of the reverse clipping operation will also update F_final and V_final and be saved to the workspace.

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

[0059] Extract the information of all edges from the mesh F_final through the detect_mesh_boundary_and_holes function; sort and de-duplicate all edges to obtain independent boundary edges; by traversing the independent boundary edges, connect adjacent vertices in sequence until returning to the starting point to form a complete boundary; sort in descending order according to the number of vertices of the boundary, print the number of detected boundaries, and at the same time 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: Obtain the vertex index loopIdx of each boundary and extract the coordinates loopVerts of the boundary vertices from the global vertex set V_final;

[0062] Calculate the best-fit plane: Determine the direction vector and normal vector in the plane by calculating the centroid of the boundary vertices and using principal component analysis to calculate the main direction 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 constrained Delaunay triangulation on the 2D projected point set and map it back to the global coordinates: After screening the valid triangles for the constrained Delaunay triangulation of the 2D projected point set, map the vertex indices of the 2D triangles back to the global vertex coordinates V_final to obtain new patches and fill the polygons;

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

[0066] Display the result: Use the graphical interface to display the filled mesh.

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

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

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

[0070] Write the tail and close the file: Write endsolidmodel at the end of the file to indicate 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 with the prior art, the present invention discloses a system for constructing a carotid lumen geometric model based on CTA images, which includes modules such as data import, volume data cropping, interactive carotid lumen segmentation, 3D model construction, model processing, model cropping, boundary detection, inlet and outlet filling, and STL file export. Each module has a clear division of labor and a detailed workflow. The present invention solves the problems of existing geometric modeling methods relying on commercial software, high cost, legal risks, cumbersome operation processes, and slow speed, and can simply, efficiently, and accurately construct a carotid geometric model, providing strong support for the research and diagnosis of carotid hemodynamic analysis of diseases such as atherosclerosis and aneurysms. Brief Description of the Drawings

[0072] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only the embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained according to the provided drawings without creative efforts.

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

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

[0075] Figure 3 It is a schematic diagram of the preview of the cropped CTA data slice provided by the present invention;

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

[0077] Figure 5 Schematic diagram of the STL model for display export provided by the present invention;

[0078] Figure 6 Schematic diagram of the model processing interface provided by the present invention;

[0079] Figure 7 Schematic diagram of the model clipping interface provided by the present invention;

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

[0081] Figure 9 Schematic diagram of the original model and the boundary plane filling result provided by the present invention. Detailed implementation manners

[0082] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0083] An embodiment of the present invention discloses a carotid artery lumen geometric model construction system based on CTA images, including: 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 a user-specified folder and converts it into three-dimensional volume data;

[0085] The volume data clipping module clips the imported three-dimensional volume data VolumeData according to the clipping range selected by the user to generate clipped sub-volume data;

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

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

[0088] The model processing module smooths the obtained preliminary three-dimensional geometric model;

[0089] The model clipping module clips the preliminary three-dimensional geometric model by interactively selecting a plane 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 grid;

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

[0092] STL file export module, which converts the processed 3D geometric model data according to the STL file format and saves it in ASCII encoding.

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

[0094] Data import module

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

[0096] 1.1 User selects the DICOM folder

[0097] First, the user triggers the folder selection operation through 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 DICOM files. After the user selects the folder, the system will obtain the path of the folder and save it in the variable folderPath.

[0098] 1.2 Read 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 will list and read all eligible files. During the reading process, the system will extract the meta-information in each DICOM file, such as PixelSpacing, SliceThickness, etc., and save them in VolumeInfo.

[0100] 1.3 Process DICOM data

[0101] After the DICOM data is read, 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 multiple files according to InstanceNumber or SliceLocation and stack them into 3D volume data VolumeData.

[0102] 1.4 Display data preview

[0103] After importing the data, the system will use orthosliceViewer to display the slices of the 3D data (as Figure 2 shown). In this way, users can intuitively view the imported CTA data, and users can view different cross-sections by sliding the yellow line in the figure.

[0104] 1.5 Update interface controls

[0105] The system dynamically updates the slider controls (xRangeSlider, yRangeSlider, zRangeSlider) on the main interface (as Figure 1 shown) according to the size of the imported VolumeData (i.e., the number of rows, columns, and slices of the data). These sliders are used to set the data cropping range respectively, and 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 cropping interval.

[0106] Volume data cropping module

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

[0108] 2.1 Obtain the cropping range

[0109] After the data is imported, the user sets the cropping range of the data by sliding the sliders at both ends of xRangeSlider, yRangeSlider, and zRangeSlider on the graphical user interface. These sliders correspond to the x-axis (columns), y-axis (rows), and z-axis (slices) directions of the data respectively. These values will be saved in the xRange, yRange, and zRange variables.

[0110] 2.2 Crop the volume data

[0111] After the user sets the cropping range, the system uses the user-set xRange, yRange, and zRange to crop VolumeData to obtain the sub-volume data subVolume. subVolume is the cropped sub-volume data, which contains the area selected by the user. It is a subset of VolumeData, and its size is determined by the cropping range set by the user.

[0112] 2.3 Display the cropping result

[0113] The system uses orthosliceViewer to display the sub-volume data subVolume. As Figure 3 shown, users can view the multi-slice view of subVolume, which is convenient for intuitively observing the data.

[0114] Interactive carotid lumen segmentation module

[0115] The main function of the interactive carotid lumen segmentation module is to automatically and manually segment the carotid lumen based on the sub-volume data subVolume through user interaction. This module combines techniques such as threshold segmentation, manual editing of masks, and region growing, and provides a real-time 3D preview function to facilitate users to precisely adjust and modify the 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 the sub-volume data subVolume. The system pops up a new interface (as Figure 4 shown). First, on the left side of the interface, the data is initially binarized according to the initial thresholds thLow and thHigh to display the initial mask mask. At this time, all voxels in the sub-volume data subVolume that meet the threshold range will be marked as true, and the rest will be false. The operation area is on the upper right corner of the interface, and the 3D mask view can be previewed in the lower right corner of the interface, and users can rotate and view it.

[0118] 3.2 Threshold adjustment and mask update

[0119] The user adjusts the thresholds through the thLow and thHigh input boxes. After clicking the "Update Threshold" button, the system regenerates the mask mask according to the new thresholds. The updated mask will be displayed on the current slice, and the 3D mask view will also be updated synchronously.

[0120] 3.3 Manual editing of masks

[0121] When the user hopes to finely adjust the automatic segmentation result, they can enter the manual editing mode through the "Manually Add Mask" or "Manually Erase Mask" buttons. The system allows the user to add or erase mask areas on the current slice by freehand drawing.

[0122] The freehand drawn area will be immediately applied to the current slice and the 3D view will be updated. Through manual editing, users can precisely adjust the segmentation result.

[0123] 3.4 3D region growing

[0124] By clicking the "Region Growing" 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 the breadth-first search (BFS) method to perform region growing based on the position of the seed point and the current mask, obtaining the entire region connected to the seed point.

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

[0126] The updated segmentation result can continue to be manually edited for the mask and 3D region growing operations multiple times until the user is satisfied with the effect.

[0127] 3.5 Crop to Mask

[0128] When the user is satisfied with the segmentation result, they can click the "Crop to Mask" button to crop the volume data and the mask to the minimum bounding box of the mask. The cropping operation will reduce the size of the data to the smallest region that contains all true voxels, thereby removing the redundant blank regions and reducing the computational load for subsequent processing.

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

[0130] 3.6 3D Mask Preview

[0131] Throughout all operations, the user can always view the current mask situation in the 3D view at the lower right corner. This view generates a 3D isosurface to help the user intuitively see the three-dimensional effect of the mask. If the mask region is empty, the system will display a prompt message in the 3D view.

[0132] 3.7 Export and End

[0133] The user can export the segmentation result (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 by other modules.

[0134] 3D Model Building Module

[0135] This module can convert the three-dimensional mask data ExportedMask into a model suitable for three-dimensional modeling and simulation and export it as an STL file.

[0136] 4.1 Generate 3D Surface:

[0137] Extract the surface mesh from the three-dimensional mask data ExportedMask using the isosurface function. The isosurface function calculates the isosurface (surface) of the three-dimensional 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 three-dimensional geometry. F: Face data (Faces) of the three-dimensional surface, indicating that each triangular face is connected by three vertices. V: Vertex data (Vertices), indicating the three-dimensional coordinates of each vertex on the surface.

[0138] 4.2 Simplify the three-dimensional surface:

[0139] Since the isosurface function may generate very complex surface meshes with excessive faces and vertices, these meshes usually need to be simplified. Using the reducepatch function, the surface is simplified with a reduction ratio (such as 0.5, retaining 50% of the faces) to obtain the simplified face data F2 and the simplified vertex data V2. The reducepatch function can effectively reduce the redundant faces, maintain the basic shape of the surface, and optimize subsequent calculations and storage.

[0140] 4.3 Save the simplified three-dimensional model as an STL file:

[0141] Use the stlwrite function to save the simplified three-dimensional surface data in the STL file format. 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 pop up a new graphics window to display the three-dimensional model (as Figure 5 shown). And allow 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 three-dimensional geometric model obtained through the previous steps to eliminate the irregularities and noises on the model surface and improve the geometric shape. The specific process and key variable descriptions are as follows:

[0146] 5.1 Default smoothing

[0147] The module initially defaults to smooth processing. Specifically, it uses the SurfaceSmooth function to iteratively smooth the input V2 and F2. The core idea is to utilize the neighborhood information of each vertex, adjust the vertex positions by calculating the normal vectors and area weights of adjacent faces, making the overall mesh tend to be smooth and reducing local sharpness and noise. A damping factor (DampingFactor) is adopted during the process to suppress oscillations and ensure that the vertex movement is within the allowed range until the preset displacement tolerance (default 0.02) is met or the maximum number of iterations (default 100 times) is reached. After the processing is completed, the smoothed vertex data V_smoothed is obtained.

[0148] 5.2 Manual Processing

[0149] After the module defaults to smooth processing, a pop-up interface window (as shown in Figure 6 ) is presented. In this window, a 3D drawing area is divided on the left side and an operation panel is on the right side. In the operation panel, sliders and buttons for setting parameters such as global smoothness and mesh simplification are provided. The patch function is used to display the model data (F2, V_smoothed) after default smooth processing in the 3D drawing area on the left side.

[0150] 5.3 Global Smooth Operation

[0151] The user adjusts the smoothness parameter through the global smooth factor slider and clicks the "Global Smooth" button. The system uses the patchSmooth function to smooth the current model based on the weighted average method according to the global smooth factor set by the user 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 Operation

[0154] The user adjusts the simplification degree through 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 will be displayed in real-time in the graphics window.

[0157] 5.5 Restoration and Export

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

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

[0160] Model Clipping Module

[0161] This module clips a 3D geometric model by interactively selecting a plane by the user. The user can define a plane by specifying four points, and then use this plane to divide or clip the model into the required parts. This module provides three functions: determining the plane, clipping the model, and reverse clipping the model. The operation results will be updated and displayed in real time in the graphical interface on the left.

[0162] 6.1. Initialize the Graphical Interface

[0163] When the clipping module is activated, an interface will first pop up (as Figure 7 shown). The interface contains two areas:

[0164] Left Display Area: 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] Right Operation Panel: Contains four input boxes for the user to input the coordinates of the four points required for the clipping plane, and provides buttons for "Determine Plane", "Clip Model", and "Reverse Clip Model".

[0166] 6.2. Plane Definition and Creation

[0167] User Input of Four Points of the Plane: Initially, the four points (point1, point2, point3, point4) of the clipping plane are predefined. The user can modify the coordinate values of these points. After the user clicks the "Determine Plane" button, the system will calculate the equation of the plane based on the four points and draw the plane in the left display area.

[0168] Calculation of the Plane Equation: Through the selected four points, first calculate the normal vector of the plane, and then use the normal vector and the selected point 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 the constant term.

[0169] Drawing the Plane: According to the calculated plane equation, use the meshgrid function to generate a mesh in the area where the plane is located, and calculate the z value of each point in this area. Then use the surf function to draw the plane.

[0170] 6.3. Clip the Model

[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 Cropping Triangles

[0173] Calculate the signed distance from each vertex of each triangle to the plane.

[0174] Use the clipPolygonWithPlane function to crop the polygon. This function processes each vertex according to the plane position. If a vertex is above the plane, keep the vertex; otherwise, interpolate and calculate the intersection point according to the intersection formula and add it to the cropped polygon, and then convert the polygon into multiple triangles.

[0175] 6.3.2 Judging the Retained Part

[0176] For each vertex, calculate its signed distance to the plane. Through this distance, judge whether the vertex is above or below the plane. If the distance is greater than or equal to zero, it means the vertex is above the plane; otherwise, it is below the plane. If it is the "Crop" button, keep the part above the plane.

[0177] Multiple croppings can be performed by setting different planes.

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

[0179] 6.4. Reverse Cropping

[0180] The function of the "Reverse Crop" button is the opposite of normal cropping. After the user clicks this button, the system will perform the same steps as cropping, but will keep the part opposite to the cropped model. The result of the reverse cropping operation will also update F_final and V_final and save them 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 triangular mesh, this module can accurately find the topological structures of all boundaries and holes and return a list of boundaries and holes.

[0183] Extract the information of all edges from the mesh F_final through the detect_mesh_boundary_and_holes function. Sort and remove duplicates from these edges to obtain independent boundary edges. By traversing these independent edges, connect adjacent vertices in sequence until returning to the starting point to form a complete boundary. Only boundaries containing at least three different vertices are considered valid boundaries. The valid boundaries are added to the boundaries list. Sort the list in descending order according to the number of vertices in the boundary. boundaries is a list containing all valid boundaries, and each boundary is represented by a set of vertex indices. Print the number of detected boundaries and pop up a graphics window to view the detected boundaries (as Figure 8 shown). The vertex coordinates of each boundary are drawn with different colors (red, green, blue, etc.) and line widths (2).

[0184] The correct model will contain 3 boundaries: one entrance and two exits of the carotid artery.

[0185] Entrance and exit filling module

[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: Obtain 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 Calculate the best - fitting plane: Determine the in - plane direction vector and normal vector by calculating the centroid of the boundary vertices and using principal component analysis (PCA) to calculate the main direction of the plane. PCA provides a plane where the first two principal components (direction vectors) define the in - plane direction and the third principal component is the normal vector. These direction vectors will be used to project points in three - dimensional space onto the plane.

[0189] 8.3 Project three - dimensional vertices into the plane: Project each boundary vertex relative to the plane, calculate its two - dimensional coordinates, and generate a set of two - dimensional coordinates uv.

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

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

[0192] 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 set of patches 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 patches are highlighted in red (as Figure 9 shown).

[0195] STL File Export Module

[0196] This module is used to convert the processed 3D mesh data (including vertex and patch information) into the 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 (the current working folder) and write the file header solidmodel, indicating the start of the file.

[0199] 9.2 Traverse the triangular patches and write the data:

[0200] For each triangular patch (each row in F_new), obtain the three vertex coordinates corresponding to the patch. The indices of these vertices correspond to V_final through F_new. For each triangle, extract the three - dimensional coordinates (v1, v2, v3) of its vertices. Calculate the normal vector and use fprintf to write the normal vector and vertex data of each triangle.

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

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

[0203] In this specification, each embodiment is described in a progressive manner. The key point of each embodiment is to illustrate the differences from other embodiments. For the same or similar parts among the embodiments, reference can be made to each other. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and reference can be made to the method part for the relevant parts.

[0204] The foregoing description of the disclosed embodiments enables those skilled in the art to practice or use the present invention. Various modifications to these embodiments will be readily apparent to those 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. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded 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 clipping module, interactive carotid artery lumen segmentation module, 3D model building module, model processing module, model clipping 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 folder specified by the user and converts it into three-dimensional volume data; The volume data clipping module clips the imported three-dimensional volume data VolumeData according to the clipping range selected by the user to generate clipped sub-volume data; The interactive carotid lumen segmentation module automatically and manually segments the carotid lumen based on sub-volume data through user interaction; The 3D model building module extracts surface meshes from the segmented data, generates three-dimensional surface data, and then builds a preliminary three-dimensional geometric model; A model processing module is used to smooth the obtained preliminary three-dimensional geometric model; Model clipping module, which clips the preliminary 3D geometric model through the user's interactive selection of planes; The boundary detection module 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 three-dimensional geometric model by extracting the vertices of the boundary of the three-dimensional geometric model, 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 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 to allow the user to select a folder containing DICOM files. After the user selects a folder, the system obtains the path of the folder 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 meta information in each DICOM file; Processing DICOM data: After the DICOM data is read, 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 multiple files according to InstanceNumber or SliceLocation and stack them into three-dimensional volume data VolumeData; 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 according to 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 at both ends of xRangeSlider, yRangeSlider, and zRangeSlider on the graphical user interface; Crop volume data: After the user sets the crop range, the system uses the xRange, yRange and zRange set by the user to crop VolumeData to obtain the sub-volume data subVolume; Display clipping 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; the seed point will be used as the starting point for region growing, and the system uses the breadth-first search method to grow the region according to 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 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: In 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 building module is: 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 according to 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 a simplified ratio to obtain simplified face data F2 and 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 the user 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: Default smoothing: The module first performs default smoothing, specifically using 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 through 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 processing is complete, the graphics window will update the model display; Mesh simplification operation: The user adjusts the simplification degree through the mesh simplification ratio slider and clicks 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 will be displayed in real time in the graphics window; Restore and export: If the user is not satisfied with the editing result, 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 contains 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 input the coordinates of the four points required for the clipping plane, and also provides "Confirm Plane", "Clipping Model", and "Reverse Clipping Model" buttons; Plane definition and creation: The user inputs four points of 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 equation of the plane based on the four points and draws the plane in the left display area; Plane equation calculation: By selecting four points, first calculate the normal vector of the plane, and then use the normal vector and the selected points to calculate the plane equation; Drawing 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 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 opposite to 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.

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 through the detect_mesh_boundary_and_holes function; sort and deduplicate all edges to obtain independent boundary edges; traverse the independent boundary edges and connect adjacent vertices in sequence until returning to the starting point to form a complete boundary; sort the boundary in descending order according to 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 inlet and outlet filling module is as follows: Extract boundary vertices: Get the vertex index loopIdx of each boundary, and extract the coordinates loopVerts of the boundary vertices 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 principal 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 projection point set, filter out valid triangles, map the vertex index of the two-dimensional triangle back to the global vertex coordinate V_final, 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 the 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 indexes 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

  • Aorta image intelligent processing system and method

    CN110910374A

  • Neurosurgery image three-dimensional reconstruction method based on surface drawing

    CN118710812A

  • Anatomical and functional assessment of coronary artery disease using machine learning

    US20210158541A1

Cited By

  • Automatic pretreatment method for constructing fluid domain grid based on blood vessel wall facets

    CN121304977A