Automatic initialization method of blood vessel wall buffer and port particle from nii_gz coronary mask
By automatically initializing the blood vessel wall buffer and port particles from the nii.gz coronary mask, the problem of complex manual preprocessing and poor repeatability in the existing technology is solved, and standardized SPH solver input is realized, which improves the reliability and efficiency of simulation.
Patent Information
- Application Number
- CN202611304096.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-26
- Publication Date
- 2026-11-06
AI Technical Summary
Existing technologies cannot automatically generate the multiple types of particles required by the coronary SPH solver directly from the nii.gz coronary mask. Manual preprocessing is complex and has poor repeatability, and lacks quality control for coordinate consistency and port integrity.
An automatic initialization method is provided, which includes reading the nii.gz coronary artery mask file, performing preprocessing and cleaning, extracting the centerline and ports, automatically filling blood particles, generating wall and buffer particles, performing unified label encoding and quality control, and generating the SPH solver input file.
This method achieves standardized particle input from the nii.gz coronary artery mask to the SPH solver, reducing manual costs, improving coordinate accuracy and simulation repeatability, and ensuring port stability and wall constraint integrity.
Smart Images

Figure CN123052259A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of medical image processing and automated software modeling technology, and in particular to an automatic initialization method for generating blood vessel wall buffers and port particles from nii_gz coronary artery masks. Background Technology
[0002] Coronary artery SPH (Smoothed Particle Dynamics) blood flow simulation requires converting medical image segmentation results into particle data that can be directly read by the solver. For the nii.gz coronary artery mask commonly used in hospitals and algorithms, if only voxel labels are available and blood particles, wall particles, inlet / outlet particles, and buffer particles are missing, a large amount of manual preprocessing is still required.
[0003] Existing workflows typically involve first converting the mask to an STL or surface mesh, then manually trimming the ports, specifying the inlet and outlet, and generating wall or volume particles. While publicly available documentation and tools support NIfTI / nii.gz image reading, affine coordinate processing, medical mask cleaning, centerline or isosurface extraction, SPH wall particles, and inflow / outflow boundary particles, a fully automated, integrated workflow from coronary artery mask to various types of SPH particles and solver initialization files has not yet been established.
[0004] Based on this, existing methods have at least the following shortcomings: the NIfTI reading tool can only read image data and coordinate information, and cannot directly generate the multiple types of particles required by the coronary SPH solver; general SPH inflow and outflow boundary methods cannot automatically identify coronary ports and generate port particles and buffer particles; traditional coronary CFD preprocessing is mainly based on surface meshes, which is difficult to directly serve the initialization of meshless SPH particles; manual port trimming, wall expansion and buffer settings have poor repeatability, and the existing process lacks an automatic quality control closed loop for coordinate consistency, port integrity, wall layer number, isolated particles and solver format. Summary of the Invention
[0005] The problem to be solved by this invention is to provide an automatic initialization method for generating blood vessel wall buffers and port particles from a nii_gz coronary artery mask, so that the coronary artery SPH solver can directly obtain normalized particle input from the segmentation mask, reduce manual preprocessing costs, and improve coordinate accuracy, port stability, wall constraint integrity and batch simulation repeatability.
[0006] This invention employs the following technical solution: an automatic initialization method for generating blood vessel wall buffers and port particles from a nii_gz coronary artery mask, comprising the following steps:
[0007] S1. Read the coronary artery nii.gz mask file, parse the file, and convert the voxel coordinates to physical coordinates;
[0008] S2. Perform preprocessing on the coronary artery mask, including mask cleaning and isotropic resampling;
[0009] S3. Extract the centerline, centerline radius, blood flow direction, vessel topology and endpoint set from the preprocessed coronary artery mask, and identify the inlet end, outlet end and branch end, and output the bifurcation topology and port set;
[0010] S4. Based on the target SPH particle spacing dp, voxel distance field and lumen boundary, automatically fill the coronary artery lumen region with blood particles and initialize the physical properties of the blood particles.
[0011] S5. Based on the coronary artery mask boundary voxels, distance field isosurfaces or surface meshes, generate vessel wall particles and expand one or more layers of wall particles outward along the wall normal.
[0012] S6. Fit the port cross-sectional plane at the inlet and outlet ends, calculate the port center, port normal, port area and port radius, and generate inlet port particles and outlet port particles on the port cross-section;
[0013] S7. Generate buffer particles outward along the normal direction of each port;
[0014] S8. Write the blood particles, wall particles, inlet particles, outlet particles, and buffer particles into a unified label encoding and data structure;
[0015] S9. Perform initialization quality control, including particle number, particle spacing uniformity, port closure, port normal consistency, wall layer number, isolated particles, topological connectivity, coordinate units, and solver format checks.
[0016] S10. If quality control fails, return to step S2 and output the failure location, failure type, and correction suggestions; if quality control passes, export the SPH solver input file, visualization file, JSON configuration, and initialization report.
[0017] Furthermore, step S1 specifically includes:
[0018] S101. Read the coronary artery nii.gz mask file and NifTI header information;
[0019] S102. Perform data and coordinate analysis, including data arrays, affine matrices, voxel spacing, orientation information, qform / sform information, and image units;
[0020] S103. Convert voxel coordinates to physical coordinates;
[0021] S104. Perform direction and consistency verification.
[0022] Furthermore, in step S2, the preprocessing includes threshold binarization, maximum connected component preservation, hole filling, spur removal, narrow segment preservation, as well as bifurcation connectivity repair and isotropic resampling.
[0023] Further, in step S4, blood particles are automatically and uniformly filled into the coronary artery lumen voxel or distance field according to the target particle spacing dp, specifically including:
[0024] S401, Constructing particle lattices for cavity distance scenarios;
[0025] S402, Screening valid candidate points in the lumen;
[0026] S403. Automatically fill the coronary artery lumen region with blood particles and initialize physical properties, including the mass, density, volume, velocity, and fluid tag of the blood particles;
[0027] S404, Write particle data.
[0028] Furthermore, step S5 specifically includes:
[0029] S501, Extract the boundary voxels of the coronary artery mask, the isosurface of the distance field, or the surface mesh;
[0030] S502. Calculate and correct the outward normal of the wall;
[0031] S503, Expanding wall particles by layer
[0032] S504, Write the wall label and constraint parameters.
[0033] Furthermore, in step S7, the buffer particles are used for inlet particle replenishment, outlet particle deletion, boundary pressure / velocity assignment, or RCR / Windkessel (impedance model for port outflow boundary) boundary adaptation.
[0034] Furthermore, in step S8, the unified tag encoding and data structure includes at least particle type encoding, basic physical characteristic field, and normal and port association field, represented as type, position, normal, port_id, wall_id, mass, density, volume, and state.
[0035] Furthermore, the blood particles are sampled using regular lattices, hexagonal close-packed lattices, dithered lattices, or distance field constraints; the wall particles are sampled from boundary voxels, marching cube surfaces, distance field isosurfaces, or STL meshes.
[0036] The present invention also provides: an electronic device, comprising:
[0037] One or more processors;
[0038] A storage device on which one or more programs are stored;
[0039] When the one or more programs are executed by the one or more processors, the one or more processors implement the aforementioned automatic initialization method.
[0040] The present invention also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps in the aforementioned automatic initialization method.
[0041] Compared with the prior art, the present invention, employing the above technical solution, has the following technical effects:
[0042] 1. The method of this invention directly generates SPH particle input from the nii.gz coronary artery mask, reducing the steps of STL pruning and manual port setting, and simultaneously generates blood particles, wall particles, port particles and buffer particles to ensure the integrity of the solver input.
[0043] 2. This invention reduces RAS / LPS (Medical Image Spatial Orientation Convention) or millimeter / voxel unit errors through affine coordinate analysis and unit checking, improves inlet / outlet boundary stability through centerline endpoint and port plane fitting, supports solver direct identification of fluid, wall, inlet, outlet, buffer, and ghost particles through unified label encoding, and outputs failure location through quality control reports. It is suitable for batch automated simulation and AI training data generation in hospitals. Attached Figure Description
[0044] Figure 1 This is a flowchart of the automatic initialization method of the present invention;
[0045] Figure 2 This is a schematic diagram of the nii.gz mask reading and coordinate transformation of the present invention;
[0046] Figure 3 This is a schematic diagram of coronary artery mask cleaning and centerline topology in this invention;
[0047] Figure 4 This is a schematic diagram of the automatic blood particle filling method of the present invention;
[0048] Figure 5 This is a schematic diagram of the generation and normal outward expansion of blood vessel wall particles according to the present invention;
[0049] Figure 6 This is a schematic diagram illustrating the generation of port particles and buffer particles in this invention;
[0050] Figure 7 This is a schematic diagram of the particle tag encoding and data structure of the present invention;
[0051] Figure 8 This is a schematic diagram of the initialization quality control and output interface of the present invention. Detailed Implementation
[0052] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of the application will be further described in detail below with reference to the accompanying drawings. The described embodiments are only a part of the embodiments involved in this invention. All non-innovative embodiments based on these embodiments by other researchers in the art are within the protection scope of this invention. Furthermore, the step numbers in the embodiments of this invention are only set for ease of explanation and do not limit the order of the steps. The execution order of each step in the embodiments can be adaptively adjusted according to the understanding of those skilled in the art.
[0053] This invention provides an automatic initialization method for generating blood vessel wall buffers and port particles from a nii_gz coronary artery mask. The overall process is as follows: Figure 1 As shown, it includes:
[0054] S1. Read the coronary artery mask and coordinate information from nii.gz.
[0055] Specifically, such as Figure 2 As shown, the process of reading and transforming the nii.gz mask includes: reading the coronary artery nii.gz mask file and the NifTI head shape system; parsing the data and coordinate information, including: parsing the data array, affine matrix, voxel spacing, orientation information, qform / sform (NIfTI spatial affine coordinate definition) information and image units; converting the voxel coordinates to physical coordinates; and performing orientation and unit consistency verification.
[0056] S2, Mask Cleaning and Isotropic Resampling;
[0057] S3, centerline, topology and port identification.
[0058] Specifically, such as Figure 3 As shown, the process of coronary artery mask cleaning and centerline topology is as follows:
[0059] First, preprocessing is performed on the coronary artery mask, including threshold binarization, maximum connected component preservation, hole filling, spur removal, stenosis preservation, bifurcation connectivity restoration, and isotropic resampling.
[0060] Then, resampling is performed to extract the centerline, centerline radius, blood flow direction, vessel topology, and endpoint set from the preprocessed coronary artery mask, and to identify the inlet, outlet, and branch ends.
[0061] Finally, output the branch topology and port set.
[0062] S4. Automatic filling and property initialization of blood particles.
[0063] Specifically, such as Figure 4 As shown, the process of automatically and uniformly filling blood particles within the coronary artery lumen voxel or distance field according to the target particle spacing dp includes:
[0064] First, a voxel lattice with a cavity distance field is constructed. Based on the target SPH particle spacing dp, voxel distance field and cavity boundary, effective candidate points for the cavity are screened.
[0065] Then, blood particles are automatically filled into the coronary artery lumen region and physical properties, including the mass, density, volume, velocity, and fluid tag of the blood particles, are initialized.
[0066] Finally, write the fluid labels and particle data.
[0067] S5, wall particles and outer layer generation.
[0068] Specifically, such as Figure 5 As shown, the process of particle generation and normal outward expansion in the blood vessel wall includes:
[0069] Extract the mask boundaries or isosurfaces, and calculate and correct the outward normals of the walls;
[0070] Based on the coronary artery mask boundary voxels, distance field isosurfaces or surface meshes, blood vessel wall particles are generated, and the wall particles are expanded outward according to the number of layers.
[0071] Finally, write the wall label and constraint parameters.
[0072] S6, Port Plane Fitting and Port Particle Generation;
[0073] S7, buffer zone particle normal extension.
[0074] Specifically, such as Figure 6 As shown, the generation process of port particles and buffer particles includes:
[0075] Determine the centerline endpoints and candidate ports, and fit the port cross-sectional planes at the inlet and outlet ends;
[0076] Calculate the port center, port normal, port area, and port radius; identify the inlet and outlet; perform normal identification; and generate inlet port particles and outlet port particles on the port cross-section.
[0077] Buffer particles are generated outward along the normal direction of each port. These buffer particles are used for inlet particle replenishment, outlet particle deletion, boundary pressure / velocity assignment, or boundary adaptation.
[0078] S8, Unified Tag and Initialization Data Writing.
[0079] Specifically, such as Figure 7 As shown, blood particles, wall particles, inlet particles, outlet particles, and buffer particles are written into a unified label encoding and data structure, and the type encoding, basic physical characteristic field, normal and port association field are determined.
[0080] Preferably, the unified label encoding and data structure includes at least the fields of type, position, normal, port_id, wall_id, mass, density, volume, and state.
[0081] S9. Initialize quality control;
[0082] S10. Export solver input and initialization report.
[0083] Specifically, such as Figure 8 As shown,
[0084] First, count the number of various particles, perform initial quality control, and check the coordinates, ports, number of wall layers, and particle spacing.
[0085] Then, isolated particles and anomalous ports are located and quality control is performed;
[0086] If the quality control fails, return to S2 and output the failure location, failure type, and correction suggestions;
[0087] When quality control is passed, export the SPH solver input file, visualization file, JSON configuration, and initialization report.
[0088] Specifically, in this invention, blood particles can be sampled using regular lattices, hexagonal close-packed lattices, dithered lattices, or distance field constraints; wall particles can be sampled from boundary voxels, marching cube surfaces, distance field isosurfaces, or STL meshes.
[0089] Furthermore, in one embodiment of the present invention, the LAD single-vessel coronary artery mask initialization is performed using the method of the present invention.
[0090] Input the LAD segmentation nii.gz mask, the system reads the affine and voxel spacing, and converts the mask into physical coordinates.
[0091] After filling the maximum connected component and the hole, the center line is extracted, the near-end entrance and far-end exit are identified, blood particles are filled at dp=0.2 mm, double-layer wall particles and entrance / exit buffer particles are generated, and finally particles.vtk, particles.csv and case.json are output.
[0092] In another embodiment of the present invention, multi-branch coronary artery mask initialization is performed using the method of the present invention.
[0093] The system takes a coronary artery mask containing LAD, LCX and branch exits as input, identifies one entrance and multiple exits based on the centerline topology, fits the port cross section and generates port particles, generates buffer particles along the normal of each port, and assigns port_id to each port to initialize the multi-branch coronary artery mask.
[0094] In another embodiment of the present invention, the method of the present invention is used for quality control failure localization.
[0095] When the number of particles at a certain exit port is insufficient or the buffer is not connected to the main domain, the system outputs the port number, failure coordinates, port area, number of particles, and suggested repair actions, including increasing the port search radius, extending the buffer, or re-executing the centerline endpoint correction.
[0096] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. An automatic initialization method of blood vessel wall buffer and port particles from nii_gz coronary mask, characterized in that, Includes the following steps: S1. Read the coronary artery nii.gz mask file, parse the file, and convert the voxel coordinates to physical coordinates; S2. Perform preprocessing on the coronary artery mask, including mask cleaning and isotropic resampling; S3. Extract the centerline, centerline radius, blood flow direction, vessel topology and endpoint set from the preprocessed coronary artery mask, and identify the inlet end, outlet end and branch end, and output the bifurcation topology and port set; S4. Based on the target SPH particle spacing, voxel distance field and lumen boundary, automatically fill the coronary artery lumen region with blood particles and initialize the physical properties of the blood particles. S5. Based on the coronary artery mask boundary voxels, distance field isosurfaces or surface meshes, generate vessel wall particles and expand one or more layers of wall particles outward along the wall normal. S6. Fit the port cross-sectional plane at the inlet and outlet ends, calculate the port center, port normal, port area and port radius, and generate inlet port particles and outlet port particles on the port cross-section; S7. Generate buffer particles outward along the normal direction of each port; S8. Write the blood particles, wall particles, inlet particles, outlet particles, and buffer particles into a unified label encoding and data structure; S9. Perform initialization quality control, including particle number, particle spacing uniformity, port closure, port normal consistency, wall layer number, isolated particles, topological connectivity, coordinate units, and solver format checks. S10. When quality control fails, return to step S2 and output the failure location, failure type, and correction suggestions. When quality control is passed, export the SPH solver input file, visualization file, JSON configuration, and initialization report.
2. The automatic initialization method according to claim 1, characterized in that, Step S1 specifically includes: S101. Read the coronary artery nii.gz mask file and NifTI header information; S102. Perform data and coordinate analysis, including data arrays, affine matrices, voxel spacing, orientation information, qform / sform information, and image units; S103. Convert voxel coordinates to physical coordinates; S104. Perform direction and consistency verification.
3. The automatic initialization method according to claim 1, characterized in that, In step S2, the preprocessing includes threshold binarization, maximum connected component preservation, hole filling, spur removal, narrow segment preservation, bifurcation connectivity repair, and isotropic resampling.
4. The automatic initialization method according to claim 1, characterized in that, In step S4, blood particles are automatically and uniformly filled into the coronary artery lumen voxel or distance field according to the target particle spacing dp, specifically including: S401, Constructing particle lattices for cavity distance scenarios; S402, Screening valid candidate points in the lumen; S403. Automatically fill the coronary artery lumen region with blood particles and initialize physical properties, including the mass, density, volume, velocity, and fluid tag of the blood particles; S404, Write particle data.
5. The automatic initialization method according to claim 1, characterized in that, Step S5 specifically includes: S501, Extract the boundary voxels of the coronary artery mask, the isosurface of the distance field, or the surface mesh; S502. Calculate and correct the outward normal of the wall; S503, Expanding wall particles by layer S504, Write the wall label and constraint parameters.
6. The automatic initialization method according to claim 1, characterized in that, In step S7, the buffer particles are used for inlet particle replenishment, outlet particle deletion, boundary pressure / velocity assignment, or RCR / Windkessel boundary adaptation.
7. The automatic initialization method according to claim 1, characterized in that, In step S8, the unified tag encoding and data structure includes at least particle type encoding, basic physical property field, and normal and port association field, represented as type, position, normal, port_id, wall_id, mass, density, volume, and state.
8. The automatic initialization method according to claim 1, characterized in that, The blood particles are sampled using regular lattices, hexagonal close-packed lattices, dithered lattices, or distance field constraints; the wall particles are sampled from boundary voxels, marching cube surfaces, distance field isosurfaces, or STL meshes.
9. An electronic device, characterized in that, include: One or more processors; A storage device on which one or more programs are stored; When the one or more programs are executed by the one or more processors, the one or more processors implement the automatic initialization method as described in any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed by a processor, implements the steps of the automatic initialization method according to any one of claims 1 to 8.
