A model training method and a segmentation method for automatic segmentation of a chorioid plexus image
By employing preprocessing and training methods based on the Swin-UNETR network architecture, the problems of time-consuming, labor-intensive, and inaccurate ventricle cluster segmentation are solved, achieving higher segmentation accuracy and robustness.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- TIANJIN FIRST CENT HOSPITAL
- Filing Date
- 2026-03-31
- Publication Date
- 2026-07-07
AI Technical Summary
Existing vesicle cluster segmentation methods are time-consuming and laborious, and have limited accuracy and robustness. Traditional CNNs struggle to capture global contextual information when dealing with long-range dependencies, and UNet-based segmentation techniques show insufficient reliability in multi-center applications.
The Swin-UNETR network architecture is adopted. By preprocessing the dataset and generating ASBC distribution maps, anchor-branch skeleton linkage networks and grayscale enhanced intermediate images, the Swin Transformer architecture is used for training to capture multi-scale features of the images.
The Dice coefficient for vesicle bundle image segmentation was improved by 5-10%, enhancing the accuracy and robustness of the segmentation.
Smart Images

Figure CN122347677A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, specifically to a model training method and an automatic segmentation method for vesicle bundle images. Background Technology
[0002] Medical image segmentation is a key technology in medical image processing and analysis, with significant applications in disease diagnosis, treatment planning, and surgical navigation. Particularly in the diagnosis of brain diseases, accurate image segmentation is crucial for identifying lesion regions, quantifying lesion size, and assessing disease severity.
[0003] Traditional medical image segmentation methods mainly include threshold-based segmentation, region-based segmentation, edge-based segmentation, and morphology-based segmentation. These methods typically require manually designed features, have high image quality requirements, and struggle to handle complex anatomical structures and lesion morphologies.
[0004] With the development of deep learning technology, segmentation methods based on convolutional neural networks (CNNs) have gradually become mainstream. U-Net and its variants have achieved remarkable success in medical image segmentation tasks thanks to their encoder-decoder structure and skip connection mechanism. However, traditional CNNs have limitations in handling long-range dependencies and struggle to capture global contextual information.
[0005] In recent years, the Transformer architecture has made groundbreaking progress in the field of natural language processing thanks to its powerful self-attention mechanism, and has been gradually applied to computer vision tasks. UNETR (U-Net with Transformer) introduces the Transformer into medical image segmentation, capturing global features through the Transformer encoder and combining it with the CNN decoder for precise localization.
[0006] Current methods for choroid plexus segmentation primarily employ manual segmentation, which is time-consuming, labor-intensive, and prone to inconsistencies; or automated segmentation methods (such as FreeSurfer software and Gaussian Mixture Models (GMM)), but these methods have limited accuracy and robustness. Even UNet-based segmentation techniques have shown insufficient reliability in multi-center applications, hindering their clinical application. Summary of the Invention
[0007] The purpose of this invention is to provide a model training method for automatic segmentation of venous cluster images to at least solve one of the above-mentioned technical problems.
[0008] One aspect of the present invention provides a model training method for automatic segmentation of vein cluster images, the model training method for automatic segmentation of vein cluster images comprising:
[0009] Obtain the preprocessed dataset;
[0010] Construct the Swin-UNETR network architecture to be trained;
[0011] The Swin-UNETR network architecture to be trained is trained using a preprocessed dataset to obtain a trained model for automatic medical image segmentation.
[0012] Optionally, obtaining the preprocessed dataset includes:
[0013] Obtain the original dataset, which includes multiple original image data and pixel-level vesicle cluster labeled images corresponding to each original image data;
[0014] The original image data and pixel-level vein cluster labeled images are standardized to obtain a standardized dataset, which includes the standardized original image data and the standardized pixel-level vein cluster labeled images.
[0015] Enhancement processing is performed on each standardized original image data and each standardized pixel-level vein cluster labeled image to obtain an enhanced dataset, which includes the enhanced original image data and the deformed labeled image; the enhanced dataset serves as a preprocessed dataset.
[0016] Optionally, the enhancement processing of each standardized original image data and each standardized pixel-level vein cluster labeled image to obtain the enhanced dataset includes:
[0017] Each standardized raw image data and its corresponding standardized pixel-level vein cluster labeled image are processed as follows:
[0018] An ASBC distribution map is generated based on the standardized raw image data and its corresponding standardized pixel-level vesicle cluster labeled image.
[0019] Generate a core anchor point set based on the ASBC distribution map;
[0020] Generate an anchor-branch skeleton linkage network covering the branch structure of the vein cluster based on the core anchor point set;
[0021] Generate a grayscale enhanced intermediate image based on the anchor-branch skeleton linkage network;
[0022] Generate a spatial-grayscale double-enhanced image and a deformed labeled image based on the grayscale-enhanced intermediate image;
[0023] The enhanced original image data is generated based on the spatial-grayscale dual-enhanced image.
[0024] Optionally, generating the ASBC distribution map based on the standardized original image data and its corresponding standardized pixel-level vein cluster labeled image includes:
[0025] Generate a precise set of vein cluster pixels based on standardized pixel-level vein cluster labeled images;
[0026] The core reference points of the vein cluster are obtained based on the precise vein cluster pixel set;
[0027] Calculate the coordinates of the reference point based on the standardized raw image data;
[0028] Calculate the neighborhood branch association density of the vesicle cluster based on the standardized raw image data;
[0029] Calculate the core baseline correlation degree of the venule cluster based on standardized raw image data;
[0030] Calculate the grayscale structure matching degree of the vein clusters based on the standardized raw image data;
[0031] The final ASBC value of each pixel is generated based on the neighborhood branch association density of the choroid plexus, the core baseline association degree of the choroid plexus, and the gray-scale structure matching degree of the choroid plexus. The final ASBC values of each pixel form a distribution map of the choroid plexus directional anatomical spatial binding coefficient.
[0032] Optionally, generating the core anchor set based on the ASBC distribution map includes:
[0033] Obtain the ASBC filtering threshold;
[0034] Traverse all pixels in the ASBC distribution map and compare them with the corresponding pixels in the standardized pixel-level vein cluster annotation image. If the ASBC value of the pixel is greater than or equal to the ASBC screening threshold and the corresponding pixel value in the standardized annotation image is 1, then use it as the initial anchor point. Each initial anchor point forms an initial anchor point set, which includes the three-dimensional coordinates of each initial anchor point and the corresponding ASBC value.
[0035] The precise vein cluster pixel set is divided into vein cluster branch regions to obtain multiple uniformly distributed vein cluster branch sub-regions;
[0036] Traverse each branch sub-region, optimize the sub-region anchor point for each sub-region, and obtain the core anchor point corresponding to each branch sub-region.
[0037] The core anchor points corresponding to each branch sub-region are plotted and optimized to obtain the optimized core anchor points, which serve as the core reference points of the network cluster.
[0038] Optionally, the step of generating an anchor-branch skeleton linkage network covering the branch structure of the network cluster based on the core anchor point set includes:
[0039] Based on the standardized pixel-level vein cluster labeled image and the precise vein cluster pixel set, a three-dimensional branch skeleton point set of the vein cluster is generated, which includes the core skeleton pixels of all branches.
[0040] Calculate the branch density parameter for each core skeleton pixel to obtain a set of branch skeleton points with branch density parameters;
[0041] The initial binding connection set is obtained by binding some core skeleton pixels in each core skeleton pixel of the branch skeleton point set to each anchor point.
[0042] The initial binding connection set is optimized to obtain an optimized initial binding connection set;
[0043] An anchor-branch skeleton linkage network is constructed based on the optimized initial binding connection set. The anchor-branch skeleton linkage network includes a node set, an edge set, and linkage parameters. The node set includes core anchor points and sub-core skeleton pixels. The edge set includes binding connections and corresponding connection strengths.
[0044] Optionally, generating the grayscale enhanced intermediate image based on the anchor-branch skeleton linkage network includes:
[0045] With each core anchor point as the center, a dedicated branch influence domain is defined, thereby obtaining the branch influence domain of each core anchor point;
[0046] Based on the ASBC value, the influence domain of each branch is individually stratified into different association levels to obtain the stratification results for each branch's influence domain.
[0047] Based on the ASBC value of the anchor point and the binding connection strength in the anchor point-branch skeleton linkage network, calculate the grayscale adjustment amount of each associated layer in the influence domain of each branch, thereby obtaining the grayscale adjustment amount set of each branch influence domain.
[0048] Based on the grayscale adjustment set of each branch's influence domain, grayscale correlation progressive perturbation is performed on the standardized original image data to obtain the grayscale enhanced intermediate image.
[0049] Optionally, the step of generating a spatial-grayscale dual-enhanced image and a deformed annotated image based on the grayscale enhanced intermediate image includes:
[0050] Deformation driving points are selected from the core anchor points in the core anchor point set to obtain multiple deformation driving points. Each deformation driving point contains three-dimensional coordinates, deformation priority, and set offset and offset direction.
[0051] Calculate the uniform offset matrix of all pixels in the image based on the deformation driving points;
[0052] The grayscale enhancement intermediate image is spatially deformed based on the uniform offset matrix of all pixels in the image, thereby obtaining the spatially deformed grayscale enhancement intermediate image.
[0053] Spatial deformation is performed on the standardized pixel-level vein cluster annotation image based on the unified offset matrix of all pixels in the image, thereby obtaining the deformed annotation image.
[0054] Optionally, the step of generating enhanced original image data and enhanced pixel-level vein cluster labeled image based on the spatial-grayscale dual-enhanced image and the deformed labeled image includes:
[0055] Extract the texture extraction influence domain corresponding to each core anchor point, centered on the core anchor point;
[0056] Multi-dimensional texture features are extracted within each texture extraction influence domain, and branch texture primitives corresponding to each texture extraction influence domain are generated.
[0057] Mutate each branch texture primitive to obtain the reconstructed texture primitive corresponding to each branch texture primitive;
[0058] The reconstructed texture primitives are mapped back to the texture extraction influence domain, thereby generating a spatially-grayscale dual-enhanced image after texture reconstruction.
[0059] This application also provides an automatic segmentation method for vein cluster images, the automatic segmentation method for vein cluster images comprising:
[0060] Obtain the image to be segmented;
[0061] Obtain the trained model for automatic medical image segmentation obtained by the venous cluster image automatic segmentation method described above;
[0062] The image to be segmented is input into a trained model for automatic medical image segmentation to obtain the segmentation result.
[0063] Compared to the traditional UNETR method, the model training method for automatic segmentation of vesicle bundle images proposed in this application adopts the Swing Transformer architecture, which can more effectively capture multi-scale features of images and improve the Dice coefficient by 5-10%. Attached Figure Description
[0064] Figure 1 This is a schematic flowchart of a model training method for automatic segmentation of vein cluster images according to an embodiment of this application.
[0065] Figure 2 This is a comparative diagram of image segmentation using the model training method for automatic segmentation of vein cluster images proposed in this application and existing technologies.
[0066] Figure 3 This is a schematic diagram comparing the Dice similarity coefficients (DSC) of choroid plexus segmentation in 30 cases of 3D T1WI brain MRI images using different methods. Detailed Implementation
[0067] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions in the embodiments of this application will be described in more detail below with reference to the accompanying drawings. In the drawings, the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The described embodiments are some, but not all, embodiments of this application. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application. The embodiments of this application will be described in detail below with reference to the accompanying drawings.
[0068] like Figure 1 The model training methods shown for automatic segmentation of vesicle bundle images include:
[0069] Obtain the preprocessed dataset;
[0070] Construct the Swin-UNETR network architecture to be trained;
[0071] The Swin-UNETR network architecture to be trained is trained using a preprocessed dataset to obtain a trained model for automatic medical image segmentation.
[0072] In this embodiment, obtaining the preprocessed dataset includes:
[0073] Obtain the original dataset, which includes multiple original image data and pixel-level vesicle cluster labeled images corresponding to each original image data;
[0074] In this embodiment, the original image data is a multicenter brain 3D MRI original image (DICOM / NIfTI format, single channel, containing choroid plexus grayscale information); the pixel-level choroid plexus labeled image is a single-channel binary image, aligned 1:1 with the MRI image size and spatial coordinates;
[0075] The original image data and pixel-level vein cluster labeled images are standardized to obtain a standardized dataset, which includes the standardized original image data and the standardized pixel-level vein cluster labeled images.
[0076] In this embodiment, the original image data and pixel-level vein cluster labeled images are standardized to obtain a standardized dataset. The standardized dataset includes the standardized original image data and the standardized pixel-level vein cluster labeled images, including:
[0077] Channel dimension calibration: The original 3D MRI image and the pixel-level chordal cluster labeled image are processed separately, and the channel dimensions of both are adjusted to the foremost position (from H×W×D×C to C×H×W×D, C=1).
[0078] Coordinate System 1: The original 3D MRI images are converted to the RAS (Right-Anterior-Superior) coordinate system using a three-dimensional spatial mapping algorithm, and the same spatial mapping parameters are used for synchronous conversion of pixel-level venule-annotated images;
[0079] Gray-scale normalization: Only the original 3D MRI images are processed. The maximum and minimum gray values are calculated for each image. The pixel values are mapped to the 0-1 range using a linear mapping formula, preserving the high gray-scale features of choroidal bundles from 0.4 to 0.8. Pixel-level choroidal bundle labeled images retain the binary attribute of 0 / 1 and are not subjected to gray-scale processing.
[0080] Size standardization: The original 3D MRI images were adjusted to a fixed size of 176×256×256 using choroid plexus structure preservation interpolation.
[0081] Specifically, the method for interpolation that preserves the structure of vein bundles is as follows:
[0082] Preprocessing preparation: First, extract candidate regions of choroid plexus (pixels with gray values of 0.4~0.8) from the original 3D MRI image, record their three-dimensional coordinates, and form a choroid plexus pre-identification set;
[0083] Interpolation kernel definition: A structure-weighted trilinear interpolation kernel is used, and the kernel function weights consist of two parts:
[0084] Basic weights: based on the spatial distance from the pixel to the interpolation point (the closer the distance, the greater the weight);
[0085] Structure Preservation Weights: If a pixel belongs to the pre-identified set of vein clusters, the weight is multiplied by 1.3 (to enhance the interpolation accuracy of the vein cluster region); if it is a pixel at the edge of the vein cluster (containing 0.4~0.8 and other gray values in a 3×3×3 neighborhood), the weight is multiplied by an additional 1.2 (to prioritize the preservation of branch edge details).
[0086] Size mapping: Establish the coordinate mapping relationship between the original image and the target image (referring to the mapped 3D MRI image) according to the target size of 176×256×256. For each target pixel (xt, yt, zt), select a 4×4×4 neighboring pixel in the original image.
[0087] Grayscale calculation: The grayscale value of the target pixel is calculated using a self-created weighted formula.
[0088] ;
[0089] Among them, G i W represents the grayscale value of a neighboring pixel in the original 3D MRI image. dist,i Based on the distance weight, W struct,i Preserve weights for the structure;
[0090] Boundary processing: If the pixel mapping of the 3D MRI target image exceeds the boundary of the original 3D MRI image, structural continuation filling is used, that is, the gray value of the virtual pixel outside the boundary is equal to the gray value of the nearest chord cluster pre-identified pixel in the original 3D MRI image, to avoid boundary gray value distortion.
[0091] The vesicle bundle structure-preserving interpolation method of this application has the following advantages:
[0092] The structure preservation is highly targeted: the interpolation weights are strengthened only in the core and edge regions of the venule cluster. Compared with general trilinear interpolation, this can avoid branch blurring and breakage and accurately preserve the branch morphology of the venule cluster.
[0093] Stable grayscale features: After interpolation, the vein cluster region still maintains a grayscale distribution of 0.4~0.8, with a consistency of >97% with the grayscale features of the original image and no obvious shift;
[0094] Excellent multicenter adaptability: It can be compatible with 3D MRI raw images of different resolutions. After unifying them to 176×256×256, the structural differences between images are small.
[0095] A binary label interpolation method is used to synchronously adjust the pixel-level vein cluster labeled image. By combining nearest neighbor and linear interpolation, the continuity of branch edge labels is ensured and there are no invalid pixels.
[0096] In this embodiment, the specific method of binary label interpolation is as follows:
[0097] Region segmentation: For the original image with single-pixel-level vein cluster annotation, two types of regions are divided:
[0098] Vein cluster core region: pixel value = 1, and ≥ 8 pixels with a value of 1 in a 3×3×3 neighborhood;
[0099] Vein cluster edge region: pixel value = 1, and 1 to 7 pixels in a 3×3×3 neighborhood have a value of 1;
[0100] Background area: pixel value = 0 (no subdivision);
[0101] Interpolation strategy adaptation:
[0102] Vein cluster core region: Nearest neighbor interpolation is used to directly map the 1 value of the core region in the pixel-level vein cluster labeled original image to the corresponding coordinates in the pixel-level vein cluster labeled target image, ensuring that the core label is without deviation;
[0103] Vein cluster edge region: Linear interpolation and binarization constraints are adopted. First, the median value of the corresponding pixel in the pixel-level vein cluster labeled target image is calculated by linear interpolation. Then, it is binarized with a threshold of 0.5 (the median value ≥ 0.5 is 1, and < 0.5 is 0) to avoid jagged edge distortion.
[0104] Background area: Nearest neighbor interpolation is used to directly map the 0 values of the background area in the original image of pixel-level vein cluster annotation to the corresponding coordinates in the target image of pixel-level vein cluster annotation, ensuring a clean background;
[0105] Consistency check: The generated pixel-level vein cluster labeled target image is traversed and checked. If there are invalid pixels that are neither 0 nor 1, they are automatically replaced with the label value (0 or 1) of the nearest pixel.
[0106] The binary label interpolation method of this application has the following advantages:
[0107] No loss of label accuracy: The core area uses nearest neighbor interpolation, which preserves 100% of the original labeled ventricle range, and there are no false positive or false negative labels;
[0108] Excellent edge continuity: The edge region is smoothed by linear interpolation and binarization constraint, and the fit with the natural branching shape of the vein cluster is >95%, which is better than using nearest neighbor interpolation alone (which has obvious jagged edges).
[0109] No invalid data: Full-process mandatory binarization verification ensures that the final pixel-level vein cluster labeled target image contains only 0 and 1, fully meeting the supervision label requirements for model training.
[0110] After the above processing, standardized raw image data and standardized pixel-level vein cluster labeled images are obtained.
[0111] In this embodiment, the standardized original image data is a single-channel grayscale image with the same size as the standardized pixel-level choroid plexus annotation image. The image contains grayscale features of multiple types of brain tissue, with the grayscale values of the ventricular region concentrated in the range of 0.2-0.3, the grayscale values of the choroid plexus region concentrated in the range of 0.4-0.8, and the grayscale values of the background and other brain tissues distributed in the range of 0-1. The grayscale differences in this image are the key basis for subsequent identification of ventricular boundaries and calculation of core reference points.
[0112] Enhancement processing is performed on each standardized original image data and each standardized pixel-level vein cluster labeled image to obtain an enhanced dataset, which includes the enhanced original image data and the deformed labeled image; the enhanced dataset serves as a preprocessed dataset.
[0113] In this embodiment, the enhancement processing of each standardized original image data and each standardized pixel-level vein cluster labeled image to obtain the enhanced dataset includes:
[0114] Each standardized raw image data and its corresponding standardized pixel-level vein cluster labeled image are processed as follows:
[0115] An ASBC distribution map is generated based on the standardized raw image data and its corresponding standardized pixel-level vesicle cluster labeled image.
[0116] Generate a core anchor point set based on the ASBC distribution map;
[0117] Generate an anchor-branch skeleton linkage network covering the branch structure of the vein cluster based on the core anchor point set;
[0118] Generate a grayscale enhanced intermediate image based on the anchor-branch skeleton linkage network;
[0119] Generate a spatial-grayscale double-enhanced image and a deformed labeled image based on the grayscale-enhanced intermediate image;
[0120] The enhanced original image data is generated based on the spatial-grayscale dual-enhanced image.
[0121] In this embodiment, generating the ASBC distribution map based on the standardized original image data and its corresponding standardized pixel-level vein cluster labeled image includes:
[0122] Generate a precise set of vein cluster pixels based on standardized pixel-level vein cluster labeled images;
[0123] In this embodiment, generating a precise vein cluster pixel set based on a standardized pixel-level vein cluster labeled image includes:
[0124] Following the x-axis range from 0 to 175, the y-axis range from 0 to 255, and the z-axis range from 0 to 255, traverse all pixels (x, y, z) of the standardized labeled image one by one. For each pixel, determine its pixel value: if the pixel value is 1, record the three-dimensional coordinates (x, y, z) of that pixel and add it to the initial vesicle bundle pixel set S. init (Stored as a list, with each element being a triplet of (x, y, z); if the pixel value is 0, it is skipped and not included in the set.
[0125] The traversal order is fixed as an ascending sort of three-dimensional coordinates to ensure that no pixels are missed or counted repeatedly.
[0126] The initial vesicle cluster pixel set S is finally formed. init (Including the pixel coordinates of all pixels labeled as venules), and S init Total number of pixels N init .
[0127] Initialize unlabeled pixel set = S init Effectively connected pixel cluster set C cluster It is an empty set;
[0128] When the set of unlabeled pixels is not empty, perform the following operations:
[0129] Randomly select a pixel P0(x0,y0,z0) from the set of unlabeled pixels as the starting point;
[0130] Initialize the temporary cluster set = {P0}, and remove P0 from the set of unlabeled pixels;
[0131] Traverse each pixel P(x,y,z) in the temporary cluster set and find its 3×3×3 neighborhood (a three-dimensional space range centered on P, extending forward and backward by 1 pixel along the x, y, and z axes, containing a total of 26 neighboring pixels).
[0132] For each neighboring pixel, if the pixel belongs to the set of unlabeled pixels, add it to the temporary cluster set and remove it from the set of unlabeled pixels;
[0133] Repeat the neighborhood search and pixel addition operations as described above until no new pixels are added to the temporary cluster set;
[0134] Count the number of pixels in the temporary cluster set: if the number is ≥ 5, then include the set in the effective connected pixel cluster set C. cluster (denoted as C) cluster [k], where k is the cluster number); if the number is less than 5, the set is discarded.
[0135] Repeat until the set of unlabeled pixels is empty;
[0136] The core definition of a 3×3×3 neighborhood is that it extends by 1 pixel in each direction in three-dimensional space, with the target pixel as the center. The total number of pixels in the neighborhood is fixed at 26 (excluding the center pixel itself).
[0137] Thus, the set of valid connected pixel clusters C is obtained. cluster (Contains several clusters, each cluster is a set of pixel coordinates, and the number of pixels in the cluster is ≥5, corresponding to a complete branch segment of the venule).
[0138] Initialize precise vesicle cluster pixel set S choroid It is an empty set;
[0139] Traverse S init Each pixel P(x) in p ,y p ,z p Perform double verification on each pixel to clearly define the noise judgment criteria:
[0140] First verification: Calculate the local connectivity number and search for all pixels belonging to S within the 3×3×3 neighborhood of pixel P. init For each pixel P, count the number of these pixels; this number is the local connectivity number of pixel P.
[0141] Second verification: Calculate the distance to the nearest valid connected cluster for the set of valid connected pixel clusters C. cluster For each cluster, calculate the three-dimensional Euclidean distance (the square root of the sum of the squares of the differences in pixel coordinates) between pixel P and all pixels in that cluster. Select the minimum value from these distances as the distance from P to that cluster. Then select the minimum value from the distances from P to all clusters and denote it as the distance to the nearest valid connected cluster.
[0142] Noise Detection and Removal: If the local connectivity of pixel P is less than 2, and the distance from this pixel to the nearest valid connected cluster is greater than 3 pixels, then P is determined to be an isolated noise point and is not included in S. choroid If neither of these two conditions is met simultaneously, then the three-dimensional coordinates of P are added to S. choroid ;
[0143] After traversal is complete, remove S. choroid There may be duplicate coordinates in the process (to avoid duplicate records caused by logical redundancy during traversal).
[0144] In this embodiment, the precise vascular cluster pixel set S choroid Stored as a list, with elements being three-dimensional coordinates (x, y, z), possessing the following characteristics:
[0145] It only includes pixels with a value of 1 in the standardized labeled image that pass the double connectivity check;
[0146] The branching structure and core region of the vein cluster are fully preserved, and all isolated noise points (pixels with a local connectivity of less than 2 and more than 3 pixels away from the nearest effective connected cluster) have been completely removed;
[0147] It is fully aligned with the spatial coordinates of standardized annotated images and 3D MRI standardized images, and can be directly used for subsequent steps such as core reference point calculation and branch skeleton extraction.
[0148] The core reference points of the vein cluster are obtained based on the precise vein cluster pixel set;
[0149] In this embodiment, obtaining the core reference points of the vein cluster based on the precise vein cluster pixel set includes:
[0150] Calculate the coordinates of the reference point based on the standardized raw image data;
[0151] In this embodiment, calculating the reference point coordinates based on the standardized raw image data includes:
[0152] For S choroid Each pixel is assigned a ventricle branch weight W. branch :
[0153] W branch =S within the 3×3×3 neighborhood of this pixel choroid Number of pixels (local branch density) + 0.5 × (1 - normalized distance from the pixel to the nearest ventricular boundary), normalized distance = spatial distance from the pixel to the ventricular boundary ÷ maximum distribution radius of the choroid plexus (from S) choroid (The 3D bounding box is calculated).
[0154] Calculate the coordinates of the reference point using the following formula (focusing on the core region of the brain with high choroid plexus density and close to the ventricles):
[0155] ;
[0156] ;
[0157] ;
[0158] Among them, S choroid Total number of pixels N choroid The sum of the weights is obtained by iterating and counting, and is equal to the sum of all W values. branch The result of addition.
[0159] Calculate the neighborhood branch association density of the vesicle cluster based on the standardized raw image data;
[0160] In this embodiment, calculating the vesicle cluster neighborhood branch association density based on standardized raw image data includes:
[0161] Define the vein bundle relational neighborhood of pixel (x, y, z): a 5×5×5 three-dimensional region (x±2, y±2, z±2) centered on the pixel. Boundary pixels are filled using the vein bundle branch continuation method: the label value of the virtual pixel outside the boundary = the nearest S in that direction. choroid The pixel's labeled value, grayscale value = nearest S choroid The grayscale value of the pixel × 0.95 (simulating the branching trend of the ventricle).
[0162] For each pixel in the neighborhood (x) n ,y n ,zn Assign branch association weights W n :W n =1 - (3D Manhattan distance from pixel to center pixel ÷ 6) × (1 - pixel label value × 0.5), where 6 is the maximum Manhattan distance in the neighborhood, and the weight is additionally increased when the label value is 1 (vein cluster pixel) to adapt to branch association characteristics;
[0163] Within the statistical neighborhood of S choroid For each pixel, calculate its total weight ΣW n ;
[0164] F1 represents the core baseline correlation degree of the choroid plexus.
[0165] Calculate the core baseline correlation degree of the venule cluster based on standardized raw image data;
[0166] In this embodiment, calculating the core baseline correlation degree of the ventricle based on standardized raw image data includes:
[0167] Calculate the pixel (x, y, z) and the reference point of the ventricle core (P). x ,P y ,P z The distance of the ventricle-specific structure from D choroid :
[0168] ;
[0169] Set the baseline distance threshold D ref _ choroid :D ref _ choroid =S choroid The diagonal length of the 3D bounding box is multiplied by 0.5 (to adapt to the branch extension range of the vein cluster and avoid excessively wide correlation determination).
[0170] Calculate F2:
[0171] Ensure that F2 in the core area of the choroid plexus and the area near the ventricle is close to 1, and decreases smoothly in areas further away.
[0172] Calculate the D of the target pixel choroid :
[0173] For each target pixel (x, y, z) in the 3D MRI normalized image, substitute it into the above D... choroid The formula calculates the specific structural distance from the pixel to the core reference point, retaining two decimal places.
[0174] Calculate the baseline distance threshold D ref_choroid :
[0175] Traverse Schoroid Given all pixel coordinates, determine their maximum and minimum values on the x, y, and z axes to obtain the range of the 3D bounding box;
[0176] Substitute the formula for calculating the diagonal length of the 3D bounding box into the formula to calculate the diagonal length of the bounding box;
[0177] Multiplying the diagonal length Lbox of the 3D bounding box by 0.5, we get D. ref_choroid .
[0178] Calculate the F2 value:
[0179] D choroid With D ref_choroid Substituting into the F2 formula, the core reference correlation of the target pixel is calculated, with a value range of (0,1): when the target pixel is located in the core region of the ventricle, D choroid F2 approaches 0, and F2 approaches 1; when the target pixel is far from the core region of the ventricle, D... choroid As it increases, F2 approaches 0.
[0180] Calculate the grayscale structure matching degree of the vein clusters based on the standardized raw image data;
[0181] In this embodiment, press S choroid The grayscale values of pixels are divided into three groups (low grayscale group [0, 0.4], medium grayscale group (0.4, 0.6], and high grayscale group (0.6, 1]), of which the proportion of medium and high grayscale group is usually ≥70%;
[0182] Calculate the pixel percentage (α1, α2, α3) and average gray value (G1, G2, G3) for each group.
[0183] G choroid =α1×G1+α2×G2×1.3+α3×G3×1.6;
[0184] Calculate the local grayscale features G of pixel (x,y,z) loc The proportion of grayscale values of all pixels within its 5×5×5 neighborhood is calculated according to the above grouping rules (β1, β2, β3), G loc =β1×G1+β2×G2×1.3+β3×G3×1.6;
[0185] • Calculate the grayscale structure matching degree F3 of the vein cluster:
[0186] .
[0187] The final ASBC value of each pixel is generated based on the reference point coordinates, the correlation degree of the core reference of the ventricle, and the gray-scale structure matching degree of the ventricle. The final ASBC values of each pixel form the distribution map of the ventricle directional anatomical spatial binding coefficient.
[0188] In this embodiment, the final ASBC value of each pixel is generated based on the reference point coordinates, the core reference correlation degree of the ventricle, and the gray-scale structure matching degree of the ventricle. The final ASBC values of each pixel constitute the ventricle directional anatomical spatial binding coefficient distribution map, including:
[0189] The final ASBC value for each pixel is obtained using the following formula:
[0190] .
[0191] In this embodiment, generating the core anchor point set based on the ASBC distribution map includes:
[0192] Obtain the ASBC screening threshold T; specifically, select the ASBC distribution map corresponding to all 3D MRI normalized images, and iterate through each distribution map to find the ASBC threshold T. choroid For each pixel, calculate the mean ASBC value μ of these pixels; set the filtering threshold T = μ × 1.3;
[0193] Traverse all pixels in the ASBC distribution map and simultaneously compare them with the corresponding pixels in the standardized pixel-level vein cluster annotation image; if the ASBC value of the pixel is greater than or equal to the ASBC screening threshold, and the corresponding pixel value in the standardized annotation image is 1, then use it as the initial anchor point, and all the initial anchor points form the initial anchor point set A. init The initial anchor point set includes the three-dimensional coordinates of each initial anchor point and its corresponding ASBC value;
[0194] The precise vein cluster pixel set is divided into vein cluster branch regions to obtain multiple uniformly distributed vein cluster branch sub-regions;
[0195] In this embodiment, dividing the precise vein cluster pixel set into vein cluster branch regions to obtain multiple uniformly distributed vein cluster branch sub-regions includes:
[0196] With S choroid Establish a three-dimensional coordinate system with the three-dimensional centroid as the origin (x-axis along the left and right direction, y-axis along the front and back direction, z-axis along the up and down direction);
[0197] The choroid plexus region is divided into 20 uniform sub-regions according to the branch extension direction (the number of regions can be set as needed): First, it is divided into 4 layers along the z-axis (the main axis of ventricular distribution), and each layer is further divided into 5 uniform grids along the xy plane to ensure that each sub-region corresponds to a complete choroid plexus branch or core sub-region.
[0198] Traverse each branch sub-region, optimize the sub-region anchor point for each sub-region, and obtain the core anchor point corresponding to each branch sub-region; record the spatial range (x) of each sub-region. min -xmax ymin-y max z min -z max ) and the included S choroid Pixels, thereby obtaining 20 evenly distributed venation cluster branch sub-regions (each sub-region covers a branch or core area).
[0199] The core anchor points corresponding to each branch sub-region are plotted and optimized to obtain the optimized core anchor points, which serve as the core reference points of the network cluster.
[0200] Specifically, the three-dimensional spatial distance between the 20 core anchor points is calculated. If the distance between any two anchor points is less than 3 pixels (indicating excessive concentration), the anchor point with the higher ASBC value is retained, and the other anchor point is replaced with the candidate anchor point with the second highest ASBC value in its sub-region. This ensures that all core anchor points are evenly distributed and without clustering, thereby obtaining the optimized 20 core anchor points.
[0201] In this embodiment, the step of generating an anchor-branch skeleton linkage network covering the branch structure of the network cluster based on the core anchor point set includes:
[0202] Based on the standardized pixel-level vein cluster labeled image and the precise vein cluster pixel set, a three-dimensional branch skeleton point set of the vein cluster is generated, which includes the core skeleton pixels of all branches.
[0203] Based on the venule region (pixel value = 1) of the standardized labeled image, based on S choroid The spatial distribution of the choroid plexus region is divided into four levels along the z-axis (the main axis of ventricular distribution) (corresponding to branches at different ventricular locations).
[0204] Perform layer-by-layer shrinkage at each level: remove pixels from the region surface toward the center, removing only one 3×3×3 neighboring pixel belonging to S at each stage. choroid Edge pixels, retain ≥2 S in the neighborhood choroid The core pixel of a pixel; when shrinking to the point where no more pixels can be removed from the layer, the remaining pixels are retained as branch skeleton fragments of that layer;
[0205] Integrating the skeleton fragments of four levels, and verifying their connectivity in three-dimensional space (merging adjacent skeleton fragments if the distance is less than 2 pixels), a complete three-dimensional branch skeleton of the ventricle is formed, and the three-dimensional coordinates (x, y, z) of each skeleton pixel are recorded. skeleton ,y skeleton ,z skeleton ), forming the branch skeleton point set S skeleton Finally, the three-dimensional branch skeleton point set S of the ventricle is obtained. skeleton (Including the core skeleton pixels of all branches).
[0206] Calculate the branch density parameter for each core skeleton pixel to obtain a set of branch skeleton points with branch density parameters;
[0207] In this embodiment, calculating the branch density parameter for each core skeleton pixel to obtain a branch skeleton point set with the branch density parameter includes:
[0208] A branch density parameter is assigned to each skeleton point to quantify the density of the branch at that point, serving as the basis for calculating the connection strength.
[0209] Traversing the branch skeleton point set S skeleton Each skeleton point (x) sk ,y sk ,z sk A 3×3×3 density statistical neighborhood is defined with this point as the center;
[0210] Statistically, pixels belonging to the precise vein cluster set S within the neighborhood are counted. choroid The number of pixels, denoted as N. dense ;
[0211] Calculate the branch density parameter D sk :D sk =N dense ÷9 (9 is the number of two-dimensional pixels in the 3×3×3 neighborhood on the z-axis fixed layer, adapting to the branch radial distribution characteristics), with a value range of [0,1].
[0212] Finally, obtain the branch skeleton point set S with branch density parameters. skdense (Each skeleton point contains three-dimensional coordinates + branch density parameter D) sk Core branch region skeleton point D sk ≈1, branch tip D sk ≈0.3).
[0213] The initial binding connection set is obtained by binding some core skeleton pixels in each core skeleton pixel of the branch skeleton point set to each anchor point.
[0214] In this embodiment, a portion of the core skeleton pixels in each core skeleton pixel of the branch skeleton point set are bound to each anchor point to obtain the initial binding connection set, including:
[0215] Based on spatial distance and correlation strength, construct exclusive binding connections between anchor points and skeleton points:
[0216] Iterate through each anchor A in the core anchor set i (i=1-20), extract its three-dimensional coordinates (x) a ,y a ,z a ) and ASBC value AISi ;
[0217] Calculate anchor point A i With S skdense The three-dimensional spatial distances of all skeleton points are used to filter out the three closest skeleton points (to avoid the vulnerability of linkage caused by a single connection), and they are denoted as Sk1, Sk2, and Sk3.
[0218] Calculate the branch association strength S for each bound connection. strength :
[0219] S strength =AIS i ×Skd (Skd is the branch density parameter D of the corresponding skeleton point) sk The value range is [0,1]. The higher the strength, the closer the connection between the anchor point and the skeleton point.
[0220] Record information for 3 binding connections for each anchor point: (Anchor point A) i Coordinates, Skeleton point Sk coordinates, Branch correlation strength S strength This forms the initial binding connection set C_init (containing 20 anchor points × 3 connections = 60 binding connections, each connection with an association strength parameter).
[0221] The initial binding connection set is optimized to obtain an optimized initial binding connection set;
[0222] In this embodiment, optimizing the initial binding connection set to obtain an optimized initial binding connection set includes:
[0223] Eliminate invalid connections and balance connection distribution to ensure that the interconnected network covers all branches of the ventricle:
[0224] Invalid connection removal: If the branch association strength S of a certain bound connection is... strength If the connection is less than 0.2 (too weak) or the spatial distance between the anchor point and the skeleton point is greater than 5 pixels (crossing a non-branch region), then the connection is removed.
[0225] Branch coverage verification: Press S skeleton The branch distribution is divided into three categories: lateral ventricle branches, third ventricle branches, and fourth ventricle branches. Each category of branches is checked for binding connections. If a certain category of branches has no connection, the point with the highest branch density is selected from the skeletal points of that branch, and a supplementary connection is established with the nearest anchor point. The supplementary connection S... strength =0.3 (basic correlation strength);
[0226] Balanced connection distribution: If a single skeleton point is bound to more than 3 anchor points (over-concentration), only the 3 connections with the highest association strength are retained, and the rest are discarded. The final optimized set of bound connections, C, is obtained. opt(Includes 55-60 valid binding connections, covering all branches of the vascular bundle).
[0227] An anchor-branch skeleton linkage network is constructed based on the optimized initial binding connection set. The anchor-branch skeleton linkage network includes a node set, an edge set, and linkage parameters. The node set includes core anchor points and sub-core skeleton pixels. The edge set includes binding connections and corresponding connection strengths.
[0228] In this embodiment, constructing the anchor-branch skeleton linkage network based on the optimized initial binding connection set includes:
[0229] By integrating nodes and connections, a complete anchor-branch skeleton network is formed, providing structural constraints for subsequent disturbances.
[0230] Define the node set of the interconnected network: including 20 core anchor points (node type = anchor point, carrying ASBC value) and S skdense All skeleton points (node type = skeleton point, carrying branch density parameter D) sk );
[0231] Define the edge set of the interconnected network: using the optimized binding connection set C opt For each edge, there is a corresponding branch association strength S. strength ;
[0232] Associative parameter integration: Add an additional spatial constraint coefficient K to each edge. const K const =1 - (spatial distance between the two ends of the edge ÷ 10), with a value range of [0.5, 1]. The closer the distance, the stronger the constraint, to avoid excessive deformation in the future.
[0233] A data structure for the interconnected network is formed: All information is integrated in the format of node ID-coordinate-attribute and edge ID-start node-end node-association strength-spatial constraint coefficient, ensuring it can be used in subsequent perturbation steps. Finally, the anchor-branch skeleton interconnected network is obtained (including node set, edge set, and complete parameters; total number of nodes = 20 + S). skdense (Pixel count, edge set is an optimized binding connection, possessing dual attributes of branch association strength and spatial constraint).
[0234] In this embodiment, the anchor-branch skeleton linkage network includes two types of nodes (core anchor points and branch skeleton points) and 55-60 effective binding connections. Each edge carries the branch association strength S. strength Spatial constraint coefficient K const Adapts to the linkage requirements of the branch structure of the vein cluster;
[0235] Auxiliary output data: Branch skeleton point set S skeleton A skeleton point set S with density parametersskdense (Providing a structural reference for subsequent spatial disturbances);
[0236] In this embodiment, generating the grayscale enhanced intermediate image based on the anchor-branch skeleton linkage network includes:
[0237] Using each core anchor point as the center, a dedicated branch influence domain is defined to obtain the branch influence domain of each core anchor point; specifically, the 20 core anchor points in the core anchor point set of the network cluster are traversed, and the three-dimensional coordinates (x, y, z) of each anchor point are extracted. a ,y a ,z a );
[0238] Centered on this coordinate, an 8×8×8 three-dimensional cube region is defined as the branch influence region (range: x). a ±4, y a ±4, z a ±4);
[0239] If the branch influence domain exceeds the boundary of the 3D MRI normalized image (x∈[0,175], y∈[0,255], z∈[0,255]), the influence domain is cropped to the image boundary to ensure no out-of-bounds areas. Ultimately, 20 branch influence domains are obtained, each corresponding to a core anchor point, with a defined spatial extent (xm). in -x max y min -y max z min -z max All of them fall within the 3D MRI standardized images.
[0240] Based on the ASBC value, the influence domain of each branch is individually stratified into different association levels to obtain the stratification results for each branch's influence domain.
[0241] In this embodiment, the association level is stratified separately for each branch's influence domain based on the ASBC value, thereby obtaining the stratification results for each branch's influence domain, including:
[0242] Traverse the influence domain of each branch and extract the ASBC values of all pixels within that influence domain in the ASBC distribution map.
[0243] Calculate the average ASBC of all pixels within the influence region, denoted as ASBC. avg ;
[0244] According to ASBC avg Divide into three levels of association:
[0245] Highly correlated layer: ASBC avg ≥0.8 corresponds to the core branch region of the choroid plexus;
[0246] Intermediate correlation layer: 0.5≤ASBC avg <0.8 corresponds to the transition region of choroid plexus branches;
[0247] Low-association layer: ASBC avg <0.5 corresponds to the edge of the choroid plexus branch and the weakly correlated region;
[0248] Record the spatial range (set of pixel coordinates) of the three-level association hierarchy within the influence domain of each branch. Finally, obtain the hierarchical results for each of the 20 branch influence domains, with each influence domain containing the spatial range of high, medium, and low association regions and their corresponding ASBCs. avg value.
[0249] Based on the ASBC value of the anchor point and the binding connection strength in the anchor point-branch skeleton linkage network, calculate the grayscale adjustment amount of each associated layer in the influence domain of each branch, thereby obtaining the grayscale adjustment amount set of each branch influence domain.
[0250] In this embodiment, based on the anchor point ASBC value and the binding connection strength in the anchor point-branch skeleton linkage network, the grayscale adjustment amount of each associated layer within the influence domain of each branch is calculated, thereby obtaining the grayscale adjustment amount set for each branch influence domain, including:
[0251] By combining the anchor point ASBC value and connection strength, the grayscale adjustment amount of each layer is calculated to ensure that the disturbance fits the characteristics of the vein cluster:
[0252] For each branch's influence domain, extract the ASBC value of its corresponding core anchor point, and the connection strength of all bound connections of that anchor point in the linkage network. Take the average of the connection strengths as the mean linkage strength S. avg ;
[0253] Extract the grayscale values of all pixels within the influence domain of this branch, and calculate the grayscale mean G. domain ;
[0254] Calculate the grayscale adjustment amount according to the association level (self-created progressive adjustment logic):
[0255] Highly correlated layer: Adjustment amount ΔG1 = (core anchor point grayscale value - G) domain ) × 0.2 × S avg ;
[0256] Mid-linked layer: Adjustment amount ΔG2 = (core anchor point grayscale value - G) domain ) × 0.15 × S avg ;
[0257] Low-association layer: Adjustment amount ΔG3 = (core anchor point grayscale value - G) domain )×0.1×S avg ;
[0258] All adjustments were limited to the range of [-0.2, 0.2] to avoid excessive grayscale value perturbation that could lead to distortion of anatomical features. Finally, the grayscale adjustment amounts (ΔG1, ΔG2, ΔG3) corresponding to the high, medium, and low-level associated regions within the influence domains of the 20 branches were obtained.
[0259] Based on the grayscale adjustment set of each branch's influence domain, grayscale correlation progressive perturbation is performed on the standardized original image data to obtain the grayscale enhanced intermediate image.
[0260] In this embodiment, the standardized original image data is subjected to gray-level correlation progressive perturbation based on the gray-level adjustment set of each branch's influence domain, thereby obtaining a gray-level enhanced intermediate image, including:
[0261] Apply grayscale perturbation to the 3D MRI normalized images according to the stratified adjustment amount, while keeping the labeled images unchanged:
[0262] Traverse the three-layered associated regions of each branch's influence domain, for each pixel (x, y, z) within the region:
[0263] If a pixel belongs to a highly correlated layer, its grayscale value is adjusted as follows: Adjusted grayscale value = Original grayscale value + ΔG1;
[0264] If a pixel belongs to the intermediate correlation layer, its gray value is adjusted as follows: Adjusted gray value = Original gray value + ΔG2;
[0265] If a pixel belongs to a low correlation layer, its grayscale value is adjusted as follows: Adjusted grayscale value = Original grayscale value + ΔG3;
[0266] After adjustment, the grayscale values of all pixels are clamped to the range of [0,1] (set to 0 if below 0, and set to 1 if above 1) to ensure consistent grayscale attributes; the standardized pixel-level vein cluster labeled image is only used to provide anatomical structural references. This perturbation does not involve changes in spatial location, so the original binary labels remain unchanged.
[0267] In this embodiment, generating a spatial-grayscale dual-enhanced image and a deformed annotated image based on the grayscale enhanced intermediate image includes:
[0268] Deformation driving points are selected from the core anchor points in the core anchor point set to obtain multiple deformation driving points. Each deformation driving point contains three-dimensional coordinates, deformation priority, and set offset and offset direction.
[0269] By selecting key driving points from the core anchor points, a power source is provided for spatial deformation, ensuring that the deformation conforms to the branching structure of the vein cluster:
[0270] Traverse the 20 core anchor points in the core anchor point set of the network cluster, extract the ASBC value of each anchor point, and the connection strength of all bound connections of the anchor point in the anchor point-branch skeleton linkage network.
[0271] For each core anchor point, the priority is calculated as deformation priority = ASBC value × connection strength. The higher the priority, the more significant the impact of the anchor point on the branching structure of the plexus.
[0272] The 20 core anchor points are sorted from high to low according to deformation priority, and 5 core anchor points from the top 10 are randomly selected as deformation driving points to avoid excessive concentration of driving points in a single branch.
[0273] For each deformation driving point, perform the following operations:
[0274] Extract the branch skeleton points associated with the driving point from the anchor point-branch skeleton linkage network to determine the extension direction of the branch skeleton;
[0275] Set the offset direction of this drive point: strictly perpendicular to the extension direction of its associated branch skeleton (to avoid stretching along the skeleton direction and causing the branch to break).
[0276] Set the offset of the driving point: randomly select a value in the range of 0.8-2.2 pixels and record it as Δd (offset in the x direction Δdx, offset in the y direction Δdy, offset in the z direction Δdz); summarize the three-dimensional coordinates, deformation priority, offsets in the x / y / z directions, and offset directions of the five deformation driving points to form a deformation driving parameter table.
[0277] Calculate the uniform offset matrix of all pixels in the image based on the deformation driving points;
[0278] In this embodiment, calculating the uniform offset matrix of all pixels in the image based on the deformation driving points includes:
[0279] Based on the connection relationships and constraint parameters of the linkage network, the deformation parameters of the driving points are passed, and the uniform offset of all pixels in the grayscale enhanced intermediate image and the standardized labeled image is calculated to ensure that the offset rules of the two are consistent.
[0280] Iterate through the 5 deformation driving points in the deformation driving parameter table, and perform the following operations for each driving point:
[0281] Extract the x, y, and z offsets (Δdx, Δdy, Δdz) of the driving point.
[0282] Extract all binding connections corresponding to the driving point from the anchor-branch skeleton linkage network, and obtain the connection strength and spatial constraint coefficient K of each binding connection. const ;
[0283] According to the propagation path of the bound connection, the offset of the driving point is propagated to the associated branch skeleton point. The propagation formula is: Branch skeleton point x-direction offset Δnodex = Δdx × connection strength × K const The y-direction offset of the branch skeleton point Δnodey = Δdy × connection strength × K const The z-direction offset of the branch skeleton point Δnodez = Δdz × connection strength × K const ;
[0284] For all nodes in the anchor-branch skeleton linkage network (including 20 core anchor points and all branch skeleton points), if a node is simultaneously associated with multiple deformation driving points, the final offset is calculated by weighted average: final offset of node in the x direction = Σ (Δnodex transmitted by each driving point × corresponding connection strength) ÷ Σ connection strength corresponding to each driving point; the same applies to the y and z directions, ensuring that the node offset calculation rules are consistent.
[0285] Calculate the precise vesicle cluster pixel set S choroid Offsets of all pixels: For the i-th deformation driving point, the three-directional offsets of its associated branch skeleton node j are calculated using the following formula:
[0286] ;
[0287] in, These are the x / y / z direction offsets passed from the i-th driving point to the j-th node, respectively.
[0288] The binding connection strength between the i-th driving point and the j-th node (value range [0,1], from the anchor-branch skeleton linkage network edge set); The spatial constraint coefficient between the i-th driving point and the j-th node (value range [0.5, 1], from the anchor-branch skeleton linkage network edge set);
[0289] If node j is associated with multiple deformation driving points, the weighted average of the offsets transmitted by all driving points is taken as the final offset of the node, with the weights being the corresponding connection strengths.
[0290] ;
[0291] in, This represents the final x / y / z offset of the j-th node; The total number of deformation driving points associated with the j-th node; The sum of connection strengths of all driving points associated with the j-th node;
[0292] For S choroid Any pixel p (coordinates (x) in the array p ,yp ,z p Select the three nearest linked network nodes to the pixel (denoted as j=1,2,3), and calculate the pixel offset using the distance-weighted method:
[0293] ;
[0294] in, This represents the offset of pixel p in the x / y / z directions; The normalized distance from pixel p to the j-th nearest node is calculated as follows:
[0295] ;
[0296] Let p be the three-dimensional Euclidean distance from pixel p to the j-th nearest node;
[0297] Calculate non-S choroid Pixel offset (background / weakly correlated region):
[0298] For grayscale enhancement intermediate images that do not belong to S choroid Any background pixel b (coordinates (x) b ,y b ,z b The offset is calculated using the distance decay method.
[0299] ;
[0300] in, This represents the offset in the x / y / z directions of the background pixel b; S is the closest pixel to the background pixel b choroid Pixel offset; For background pixel b to the nearest S choroid The three-dimensional Euclidean distance of a pixel;
[0301] Traverse all pixels (176×256×256) of the grayscale enhancement intermediate image, sorted by pixel type (S choroid The offsets are calculated for inner pixels and background pixels, and finally integrated into a unified offset matrix M for the entire image pixels. offset .
[0302] The matrix size is the same as the image, and the matrix elements are triples (Δx, Δy, Δz), i.e.: M offset [x,y,z]=(Δx,Δy,Δz) where (x,y,z) are the image pixel coordinates, and Δx / Δy / Δz are the three-directional offsets corresponding to that pixel.
[0303] The grayscale enhancement intermediate image is spatially deformed based on the uniform offset matrix of all pixels in the image, thereby obtaining the spatially deformed grayscale enhancement intermediate image.
[0304] In this embodiment, the intermediate grayscale image is spatially deformed based on a uniform offset matrix of all pixels to obtain the spatially deformed intermediate grayscale image, including:
[0305] Create an intermediate image with grayscale enhancement I enh A blank 3D image container (denoted as I) with identical size, number of channels, and coordinate system. deform ), used to store the deformed image data; initialize I deform All pixels in the image have a grayscale value of 0, and the specific values are subsequently filled in by interpolation calculation.
[0306] Traverse the grayscale enhancement intermediate image I in the order of x-axis → y-axis → z-axis. enh For all pixels (coordinates (x, y, z)), perform the following operation for each pixel:
[0307] Extract offsets: from the unified offset matrix M of pixels across the entire image. offset Read the three-directional offset corresponding to the current pixel, i.e., M offset [x,y,z]=(Δx,Δy,Δz);
[0308] Calculate the new coordinates after deformation: Based on the original coordinates and the offset, calculate the target coordinates (new coordinates) of the pixel after deformation, using the following formula:
[0309] ;
[0310] ;
[0311] ;
[0312] New coordinate boundary verification and offset correction: Because the new coordinates may exceed the grayscale enhancement intermediate image I enh The pixel range (x∈[0,175], y∈[0,255], z∈[0,255]) needs to be subject to boundary constraints to ensure... All fall within the valid range:
[0313] If x new <0: Correct Δx=Δ x - x new (i.e. x) new (corrected to 0)
[0314] If x new >175: Correction Δ x =Δx - (x new - 175);
[0315] y new z new When the value exceeds the range, correct it using the same logic described above, ultimately ensuring that x... new ∈[0,175]、y new ∈[0,255]、z new ∈[0,255];
[0316] Save the original coordinates (x, y, z) and the corrected offset (Δx) of the current pixel. corr ,Δy corr ,Δz corr ) and the final new coordinates (x) new ,y new ,z new This serves as a set of grayscale adjustment values, used for subsequent grayscale value interpolation.
[0317] The final new coordinates (x) for each pixel new ,y new ,z new The grayscale value is calculated using trilinear interpolation (to meet the continuous grayscale transition requirements of 3D images). The specific logic is as follows:
[0318] Determine the interpolation neighborhood: because x new ,y new ,z new It may be a non-integer (because the offset is a real number), so we need to find the 8 nearest integer coordinate pixels around it (i.e., those containing (x) in 3D space). new ,y new ,z new The smallest cube with 8 vertices, denoted as V. a,b,c (Where a=0,1; b=0,1; c=0,1), the vertex coordinates are calculated as follows:
[0319] ;in, This indicates rounding down. V represents rounding up. 0,0,0 The coordinates of V0,0,1 are (x0, y0, z0), and the coordinates of V0,0,1 are (x0, y0, z1), and so on down to V. 1,1,1 (Coordinates (x1, y1, z1));
[0320] Extracting grayscale values from neighboring pixels: from grayscale enhancement intermediate image I enh The original grayscale values corresponding to the 8 vertices are read and denoted as:
[0321] ;
[0322] Calculate the interpolation weights: Based on the distances between the new coordinates and the eight vertices, calculate the interpolation weights for each vertex, specifically as follows:
[0323] ;
[0324] in The normalized weight (value range [0,1]) represents the proportion by which the new coordinates deviate from the smallest integer coordinate of the corresponding axis;
[0325] Perform trilinear interpolation to calculate the new grayscale value: interpolate stepwise in the order of x→y→z to finally obtain the new coordinates (x... new ,y new ,z new The grayscale value G new The complete formula is:
[0326] ;
[0327] ;
[0328] ;
[0329] ;
[0330] ;
[0331] ;
[0332] ;
[0333] Gray value range constraint: The calculated G new Clamp to the range [0,1] (if G) new If Gnew is less than 0, set it to 0; if Gnew > 1, set it to 1 (to avoid grayscale value overflow that could cause image distortion).
[0334] G is obtained by interpolation for each pixel. new Assigned to the deformed image container I deform The corresponding coordinates, i.e., I deform [x new ,y new ,z new ]=G new Finally, the intermediate image with enhanced grayscale after spatial deformation (i.e., I) is obtained. deform ).
[0335] Spatial deformation is performed on the standardized pixel-level vein cluster annotation image based on the unified offset matrix of all pixels in the image, thereby obtaining the deformed annotation image.
[0336] In this embodiment, the standardized pixel-level vein cluster annotation image is spatially deformed based on a unified offset matrix of all pixels to obtain the deformed annotation image, including:
[0337] Traverse I in the order of x-axis → y-axis → z-axis label All pixels (coordinates (x, y, z)) undergo coordinate deformation exactly the same as the grayscale enhancement intermediate image, which will not be elaborated here.
[0338] Finally, the original pixel coordinates (x, y, z) and the corrected offset (Δx) are obtained and saved. corr ,Δy corr ,Δzcorr), final new coordinates (x new ,y new ,z new ), and the label value L of the original pixel. ori =I label [x,y,z].
[0339] Based on the label attributes and coordinate mapping relationship of the original pixels, for I label_deform (Compared to the original standardized labeled image I) label A blank 3D binary image container with identical size, number of channels, coordinate system, and data type is used. All pixels within the container are initialized to 0, and subsequent label values are filled in using coordinate mapping to ensure the binary attributes remain unchanged. Labels are assigned to the new coordinates without interpolation (labeling is discrete binary) to ensure accurate labeling.
[0340] Single original pixel mapping scenario: If the new coordinates (x) new ,y new ,z new This corresponds to only one original pixel (x, y, z):
[0341] If the original pixel (x,y,z)∈S choroid (i.e. L) ori If =1), then set I label_deform [x new ,y new ,z new ]=1;
[0342] If the original pixel is (x, y, z) S choroid (i.e. L) ori If =0), then keep I label_deform [x new ,y new ,z new ]=0.
[0343] Multiple original pixel mapping scenarios: If multiple original pixels are mapped to the same new coordinate (x...new ,y new ,z new (Coordinate overlap occurs because the offset is a real number):
[0344] Calculate the label values of all original pixels in the mapping, and take the maximum value as the label value of the new coordinate, i.e., I. label_deform [x new ,y new ,z new ]=max{L ori,1 ,L ori,2 ,...,L ori,n (n is the number of original pixels mapped);
[0345] Scenes without original pixel mapping: If the new coordinates (x) new ,y new ,z new No original pixel mapping (an extreme case caused by boundary correction):
[0346] Find the original pixel (x) closest to the new coordinates near ,y near ,z near Assign its label value to the new coordinates, i.e., the deformed labeled image I. label_deform [x new ,y new ,z new ]=I label [x near ,y near ,z near ];
[0347] Nearest pixel search rule: Calculate the three-dimensional Euclidean distance between the new coordinates and the original pixels in the surrounding 3×3×3 neighborhood, and take the pixel corresponding to the minimum value.
[0348] In this embodiment, the process of generating enhanced original image data and enhanced pixel-level vein cluster annotation images based on the spatial-grayscale dual-enhanced image and the deformed annotated image includes:
[0349] Extract the texture extraction influence domain corresponding to each core anchor point, centered on the core anchor point;
[0350] In this embodiment, extracting the texture extraction influence domain corresponding to each core anchor point, centered on the core anchor point, includes:
[0351] Centered on each core anchor point, a fixed-size 3D cube influence domain is defined to ensure coverage of complete vein cluster branch texture fragments around the anchor point; boundary overrun issues are handled simultaneously to ensure that the entire influence domain falls within the effective range of the image.
[0352] Specifically, initialize the set of influence domains: create an empty set D. texture This is used to store the texture extraction influence domain information corresponding to 20 anchor points, with each element being a quadruple {a, x}. min ,x max ,y min ,y max ,z min ,z max} (a is the anchor point number, x min / x max (Equal to the coordinate boundary of the influence domain).
[0353] Calculate the influence domain boundary point by anchor point: Traverse P in the order of anchor point index a=1 to 20. core For each anchor point Pa(xa,ya,za) in the array, perform the following operations:
[0354] Define the influence domain size: A 6×6×6 three-dimensional cube influence domain is defined centered on the anchor point. The initial coordinate boundary calculation formula is as follows:
[0355] ;
[0356] ;
[0357] ;
[0358] Boundary out-of-bounds correction: Check if the initial boundary exceeds I. dual If the pixel coordinates exceed the specified range, the image will be cropped according to the image boundaries. The correction rule is as follows:
[0359] ;
[0360] ;
[0361] ;
[0362] Record the influence domain information: Store the corrected anchor point number and coordinate boundary information into set D. texture This ensures that each influence domain is a valid three-dimensional spatial region.
[0363] From the influence region extracted from each texture, those belonging to S are selected. choroid The pixel region (i.e., the region of the vein cluster itself) is excluded from the background pixels to form a precise core texture extraction area, providing a unique effective range for subsequent texture primitive extraction.
[0364] Specifically, initialize the core texture extraction region set: create an empty set A. coreEach element is a tuple {a, Sa} (a is the anchor point number, and Sa is the set of pixel coordinates of the core texture extraction area corresponding to the a-th influence domain).
[0365] Filtering pixels by influence domain: Traversing D texture Each influence region (anchor point number a, coordinate boundary x) min x max y min y max z min z max ), perform the following operations:
[0366] Initialize pixel subset S a It is an empty set;
[0367] Traverse all pixels within the influence region in the order x→y→z, with pixel coordinates denoted as (x... p ,y p ,z p ), satisfying x p ∈[x min ,x max ]、y p ∈[y min ,y max ]、z p ∈[z min ,z max ];
[0368] Pixel attribution determination: For each pixel (x p ,y p ,z p ), verify whether it belongs to the precise vein cluster pixel set S choroid If (x p ,y p ,z p )∈S choroid Then add the coordinate to subset S a If it does not belong to this category, skip it.
[0369] Subset validity check: Statistical S a The number of pixels, if the number is ≥10 (ensuring sufficient texture features are included), then {a,S a Store in set A core If the number is less than 10, it is determined that there is no valid texture in the affected area, the corresponding anchor point is discarded and a spare anchor point is added.
[0370] In this embodiment, the texture extraction influence region includes:
[0371] Texture extraction influence domain set D textureIt contains complete information on 20 effective influence domains, each with a clear anchor point correspondence and coordinate boundaries, and all of them fall within I. dual Within the effective pixel range, there are no out-of-bounds areas.
[0372] Core texture extraction region set A core It contains 20 core texture extraction regions, each corresponding to an influence region, with each region being S. choroid A subset of pixels that only covers the vein cluster branch texture region and has no background interference; the number of pixels is ≥10, which meets the feature quantity requirements for subsequent texture primitive extraction.
[0373] Anchor point-texture region mapping table: records the relationship between 20 core anchor points and their corresponding core texture extraction regions, including anchor point coordinates, influence domain boundaries, number of pixels in the core texture region, etc., providing a basis for parameter tracing in subsequent steps.
[0374] Multi-dimensional texture features are extracted within each texture extraction influence domain, and branch texture primitives corresponding to each texture extraction influence domain are generated.
[0375] In this embodiment, multi-dimensional texture features are extracted within each texture extraction influence domain, and branch texture primitives corresponding to each texture extraction influence domain are generated, including:
[0376] Multi-dimensional texture features are extracted from the core texture extraction area to construct complete branch texture primitives, providing raw materials for reconstruction.
[0377] Traverse the 20 core texture extraction regions and perform the following operations on a single core texture extraction region:
[0378] Extract the grayscale values of all pixels within the region and calculate the three-dimensional gradient vector (G) of each pixel. x G y G z ): G x G represents the grayscale difference between adjacent pixels in the x-direction. y G represents the grayscale difference between adjacent pixels in the y-direction. z This represents the grayscale difference between adjacent pixels in the z-direction.
[0379] Pixels with gray values higher than 1.2 times the average gray value of the region are selected as gray value peaks. The three-dimensional coordinates of all gray value peaks are recorded to form a gray value peak position matrix.
[0380] The core texture extraction area is divided into 3×3×3 sub-blocks, and the S values within each sub-block are calculated. choroid The arrangement direction of pixels (the angle between the pixel arrangement and the extension direction of the branch skeleton) forms a branch arrangement matrix;
[0381] Extract the ASBC value distribution corresponding to this region and calculate the mean ASBC value within the region. texture , as the association strength label of the texture primitive;
[0382] Integrating the 3D gradient vector set, grayscale peak position matrix, branch arrangement matrix, and correlation strength label, the branch texture primitives of this core texture extraction area are formed, denoted as Primitve. i (i=1-20, corresponding to the influence domain of 20 core anchor points);
[0383] Extract texture primitives from all 20 core texture extraction areas sequentially, ensuring that each primitive contains complete texture feature information.
[0384] Finally, a set of 20 branch texture primitives is obtained (each branch texture primitive contains a set of three-dimensional gradient vectors, a gray-level peak position matrix, a branch arrangement matrix, and an association intensity label), which accurately depicts the local texture characteristics of the vein cluster.
[0385] Mutate each branch texture primitive to obtain the reconstructed texture primitive corresponding to each branch texture primitive;
[0386] In this embodiment, mutating each branch texture primitive to obtain the reconstructed texture primitive corresponding to each branch texture primitive includes:
[0387] Obtain the set S of branch skeletons of the venule cluster skeleton and the set of normalized extension direction vectors for each skeleton pixel {d norm}
[0388] In this embodiment, the set S of venule branch skeletons is obtained. skeleton and the set of normalized extension direction vectors for each skeleton pixel {d norm} can be obtained in the following way:
[0389] Traverse S choroid Each pixel P(x) in p ,y p ,z p ), calculate S in its 3×3×3 neighborhood. choroid Number of pixels N neigh ;
[0390] Execute refined judgment: If N neigh Satisfying 3≤N neigh If pixel P is ≤24 (preserving connectivity) and is a middle pixel (not an edge endpoint) of a vesicle region, then retain the pixel and add S. skeleton ;
[0391] Repeat the above determination until S skeleton S within a 3×3×3 neighborhood of each pixelskeleton If the number of pixels is ≤6 (meeting the skeleton standard of single pixel width), the venule branch skeleton is obtained.
[0392] For S skeleton Each skeleton pixel Ps(x) s ,y s ,z s Find the other skeleton pixels in its 3×3×3 neighborhood, and denote the neighborhood skeleton pixel set S. s_neigh ;
[0393] If S s_neig If it contains 2 pixels (non-endpoints), then calculate from P s The mean of the vectors pointing to two neighboring pixels is used as the skeleton extension direction vector d=(d x ,d y ,d z );
[0394] If S s_neigh If it contains 1 pixel (endpoint), then calculate from P s The vector pointing to the neighboring pixels serves as the skeleton extension direction vector of the endpoint;
[0395] Normalized direction vector: ,in,
[0396] , ensure d norm It is a unit vector. The final result is the set S of the branch skeletons of the ventricle cluster. skeleton and the set of normalized extension direction vectors for each skeleton pixel { Each of these coordinates corresponds one-to-one with the spatial coordinates of the core texture extraction area.
[0397] Traverse primitives and extract features: Traverse the 20 branch texture primitives {Primitive} in order of anchor point index a=1 to 20. a}, extract the set of three-dimensional gradient vectors {G} for each primitive. x,y,z}, Gray-scale peak position matrix M peak Branching matrix M arrange Association Strength Label ASBC texture And store it as a temporary feature dictionary.
[0398] Set the mutation constraint threshold:
[0399] 3D gradient vector variation threshold: ±15% (ensuring the gradient direction is consistent with the original texture, only adjusting the gradient magnitude);
[0400] Grayscale peak position fine-tuning threshold: ±1 pixel (fine-tuning along the branch extension direction to avoid peaks deviating from the texture structure);
[0401] Branch arrangement direction adjustment threshold: ±5° (to ensure that the arrangement trend is compatible with the overall branch structure);
[0402] Extracting ASBC weighted correction coefficients: for each primitive a Based on its association strength label ASBC texture Calculate the correction factor K corr The formula is:
[0403] ;
[0404] In this embodiment, ASBC texture The value range is [0,1], therefore K corr Value range [0.9, 1.1]; ASBC texture The higher K is corr The closer it is to 1, the higher the proportion of original texture features retained, ensuring that the texture variation in the core area is lower and conforms to anatomical characteristics.
[0405] For each core texture extraction region, locate the skeleton pixels within its spatial range and extract the corresponding normalized extension direction vector. This serves as the directional basis for fine-tuning the position of the grayscale peak.
[0406] Variation in the magnitude of the three-dimensional gradient vector:
[0407] Primitive a Each three-dimensional gradient vector (G) within x G y G z ), calculate the mutated gradient vector according to the following formula ( ):
[0408] ;
[0409] ;
[0410] ;
[0411] Parameter definition: Use independent random numbers, taking values from {-1, 1}, to ensure that the gradient magnitude variation direction is random in each direction; maintain the value after variation. The ratio is consistent with the original gradient vector, ensuring that the texture edge direction remains unchanged.
[0412] From the matched skeleton pixel data, read the normalized branch skeleton extension direction vector of the current core texture extraction region. ;
[0413] grayscale peak position matrix Each peak pixel coordinate ( ), calculate the fine-tuned coordinates ( ):
[0414] ;
[0415] ;
[0416] ;
[0417] The value is a random number, ranging from {-1, 1}. The fine-tuning distance is fixed at 1 pixel to ensure that the peak position is always within the texture structure.
[0418] For the branching permutation matrix M arrange For each sub-block in the image, the arrangement angle θ (the angle between the sub-block pixel arrangement direction and the skeleton extension direction) is calculated, and the corrected angle θ′ is calculated:
[0419] ;
[0420] Parameter definition: The result is a random number, ranging from {-1, 1}; it is then validated after correction. Check if it is within the range of [0°, 90°] (the arrangement angle is the angle between the sub-block and the branch skeleton). If it exceeds the range, take the boundary value to ensure that the angle conforms to the anatomical logic.
[0421] The three types of features after mutation are adjusted according to the correction coefficient K. corr Weighted integration balances the diversity of variations with the preservation of original texture features to generate reconstructed texture primitives.
[0422] The specific steps are as follows:
[0423] Feature weighting adjustment: For each mutated feature, adjust the weighting by a correction factor K. corr The weighted adjustment is performed using the following formula:
[0424] Weighted gradient vector of mutation:
[0425] Fine-tuning the peak position weighting: (Coordinate weighting is proportionally scaled to avoid excessive offset);
[0426] Adjusted arrangement angle weighting: ;
[0427] Reconstructing texture primitives: a set of weighted and corrected 3D gradient vectors Gray-scale peak position matrix Branching matrix The strength of the association with the original primitive. Integrate and generate reconstructed texture primitives Each reconstructed primitive has a feature structure that is completely consistent with the original primitive, ensuring compatibility with subsequent reverse mappings.
[0428] The reconstructed texture primitives are mapped back to the texture extraction influence domain, thereby generating a spatially-grayscale dual-enhanced image after texture reconstruction.
[0429] For ease of description, we assume 20 reconstructed texture primitives (denoted as P1-P20): each primitive contains 3 types of core data, and the corrected gradient vector (G) x ''、G y ''、G z ''), grayscale peak coordinates (M peak Correction factor K corr (Values range from 0.9 to 1.1, calculated from the ASBC mean).
[0430] 20 texture extraction influence regions (denoted as D1-D20): each D a It corresponds to P a A 3D cube region with clearly defined coordinate boundaries (x min -x max y min -y max z min -z max ), and it falls entirely within the effective range of I.
[0431] In this embodiment, P a With D a By ensuring a one-to-one correspondence between anchor point numbers, all objects are aligned using the same coordinate system (RAS) with no misalignment.
[0432] In this embodiment, mapping the reconstructed texture primitives back to the texture extraction influence domain to generate a spatially-grayscale dual-enhanced image after texture reconstruction includes:
[0433] Binding primitives and pixels in the affected domain: Matching by sequence number: P1 corresponds to D1, P2 corresponds to D2... P20 corresponds to D20, establishing a one-to-one association.
[0434] Pixel classification: For each D a All pixels (x, y, z) within the vesicle cluster are divided into two categories: core pixels (belonging to the vesicle cluster precise pixel set S) choroid ), binding P a Gradient vectors and peak data; edge pixels (in D) a Inside but not in S choroid Only bind P a The gradient vector.
[0435] Calculate the new grayscale value after replacement:
[0436] Define key parameter: G ori = The original grayscale value of pixel (x,y,z) in image I; W = Distance weight (0.8 for core pixels and 0.5 for edge pixels to balance original and reconstructed features).
[0437] Unified calculation formula:
[0438] ;
[0439] ;
[0440] Perform texture replacement and boundary smoothing:
[0441] Initialize a new image: Create and Completely identical blank image I new Copy first All pixels (preserving original features).
[0442] Replace pixels within the influence domain: For each pixel (x, y, z) within Da, G new (x, y, z) is assigned to I new (x,y,z); pixels outside the influence domain remain unchanged.
[0443] Boundary smoothing: for D a For the boundary pixels, perform fusion again and calculate the fused grayscale value:
[0444] ( It is D a The original grayscale values of externally adjacent pixels are used to eliminate replacement traces. Finally, a spatially-grayscale dual-enhanced image (IG) is generated after texture reconstruction. new The size and coordinate system are consistent with the original image, and the vein patterns and textures are both diverse and natural.
[0445] See Figure 2 , Figure 2 This paper compares the effects of manual and automatic segmentation of venule clusters in T1WI thin-slice images (transverse and coronal views). Red represents manual segmentation, and green represents automatic segmentation. The method described in this application achieves significant overlap with the results of manual segmentation; compared to existing technologies, it is closer to true manual segmentation (manual segmentation is the gold standard).
[0446] The enhancement processing described above on each standardized original image data and each standardized pixel-level vein cluster labeled image has the following advantages:
[0447] Regarding the precise vein cluster pixel set section:
[0448] This method employs a dual quantization verification rule based on local connectivity and the distance to the nearest effective cluster. It sets a noise judgment criterion of a local connectivity number less than 2 and a distance to the nearest effective cluster greater than 3 pixels. This addresses the core pain point of existing technologies (single connectivity threshold method and fixed distance screening method) that result in an imbalance between noise removal and preservation of the network cluster branch structure. These methods either use overly strict thresholds to mistakenly delete normal pixels at the end of branches, or use lenient thresholds to leave isolated, labeled noise. This achieves zero noise residue and zero missing branch structure, ensuring that all subsequent operations based on the network cluster region use a precise and noise-free pixel set S. choroid Based on.
[0449] The quantification standard for valid clusters is defined as connected clusters with 5 or more pixels. Combined with a standardized connectivity labeling algorithm for a 3D 3×3×3 neighborhood (26 adjacent pixels), this overcomes the reproducibility problem of existing technologies that lack a unified standard for selecting valid ventricle cluster regions and rely on subjective judgment. The results of execution vary greatly between different laboratories, making it impossible to form a unified benchmark. This achieves the technical effect of unified parameters throughout the process and consistent execution results across devices and personnel, laying a stable and reliable regional foundation for subsequent pixel-level operations.
[0450] Regarding the full-image pixel uniform offset matrix:
[0451] The design employs a three-level offset weighted transmission link. The offset transmission path involves the deformation driving point first acting on the anchor branch skeleton linkage network, then being transmitted from the linkage network to the vein cluster pixels, and finally extending to the background pixels. The entire process is driven by connection strength constraints to transmit weights, and spatial constraint coefficients to limit the deformation amplitude. This approach overcomes the anatomical distortion problems caused by existing technologies (global elastic deformation, random driving point deformation) which lack hierarchical driving and result in excessive stretching, compression, or even breakage of vein cluster branches. Traditional solutions directly apply the driving point to all pixels, ignoring the fine structural characteristics of the vein cluster. This approach achieves the technical effect of vein cluster branch deformation conforming to physiological topological laws, controllable deformation amplitude, and structural integrity.
[0452] The innovative distance exponential decay offset calculation strategy for background pixels solves the problem of excessive background distortion and damage to the overall anatomical rationality of the image caused by the use of the same deformation rules for the background and vein cluster regions in existing technologies. It achieves the technical effect of precise deformation of the vein cluster region and smooth transition of the background region with increasing distance, ensuring that the overall image looks natural and the anatomical structure is not distorted.
[0453] A unified pixel offset matrix matching the image size at a 1:1 ratio is constructed for the entire image. The grayscale image and the labeled image share the same matrix for deformation. This overcomes the core pain point of existing technologies where the offset is calculated separately for the image and the label, and spatial misalignment between the label and the image is caused by slight differences in parameters. Traditional processes have a high label misalignment rate, resulting in huge errors in subsequent training and analysis. This technology achieves 100% synchronization of image label deformation and no spatial misalignment, completely eliminating subsequent errors caused by label misalignment.
[0454] Regarding techniques for enhancing the spatial deformation portion of intermediate images with grayscale enhancement:
[0455] This paper employs a trilinear interpolation algorithm to calculate new coordinate grayscale values for 3D images. Combined with coordinate boundary verification and real-time offset correction rules, the offset is corrected if the coordinates exceed the image range, forcing the coordinates to fall back into the valid range. This solves the problems of jagged grayscale transitions and loss of edge pixels due to existing technologies (nearest neighbor interpolation, no boundary verification). Nearest neighbor interpolation is prone to blocky distortion, and the lack of boundary verification will lead to the loss of edge pixel information. This paper achieves the technical effect of natural and smooth grayscale transition after deformation, no jagged distortion, and complete preservation of all pixel information.
[0456] This invention initializes a deformed image container with the same size, coordinate system, and data type as the original image, overcoming the problems of mismatched deformed image attributes, the need for manual format conversion, and low process efficiency in existing technologies. Traditional solutions often ignore the consistency of data type and coordinate system, requiring repeated adjustments and adaptations. This invention achieves the technical effect of allowing deformed images to be directly connected to subsequent processing steps without additional format conversion, and improving the overall efficiency by more than 30%.
[0457] For the synchronized deformation portion of the standardized labeled image:
[0458] Strictly adhering to the principle of complete consistency with the grayscale image deformation logic, it reuses the same coordinate calculation, boundary verification, and offset correction rules without any parameter modification. This solves the problems of existing technologies where the annotation image is designed with its own deformation logic, the deformation is not synchronized with the grayscale image, and the label misalignment rate is high. It achieves the technical effect of one-to-one correspondence between the annotation and the spatial position of the grayscale image, and 100% synchronous deformation accuracy.
[0459] To address the characteristics of binary annotation, a label assignment rule is designed that takes the maximum value for multi-pixel mapping and takes the nearest pixel for no mapping. This is combined with structural verification that the difference in connectivity is less than or equal to 1 and the volume change rate is less than or equal to 5%. This avoids the drawbacks of existing technologies (direct interpolation annotation) such as fuzzy binary labels, missing or incorrect labels in vein cluster regions, and destruction of topological structure. The result is a technical effect of 100% retention of vein cluster labels, no missing or incorrect labels, and complete and distortion-free branch topology.
[0460] Regarding the texture extraction influence domain delineation and core texture region selection:
[0461] A standardized 6×6×6 three-dimensional influence domain is defined with the core anchor point as the center. Boundary over-limit clipping is performed simultaneously. Combined with the validity check that the number of core texture pixels in the influence domain is greater than or equal to 10, the problem of existing technology's texture extraction range is not standardized, the range is too large and mixed with background noise, and the range is too small and the feature quantity is insufficient. The technical effect is that each influence domain falls within the effective range of the image and contains sufficient texture features without background pollution.
[0462] Based on a precise set of vein cluster pixels, core texture pixels belonging only to the vein cluster region are accurately selected from the influence domain. This overcomes the pain points of existing technologies that directly extract texture from the influence domain, are prone to background pixel mixing, and result in low texture primitive purity and high noise. The technology achieves the effect that the extracted texture primitives are 100% true textures of vein cluster branches, without background noise pollution, and have extremely high feature purity.
[0463] For the preliminary part of branch skeleton extraction:
[0464] A 3D skeleton extraction algorithm employing neighborhood pixel number constraints and iterative refinement refines the venule region to a single pixel width through multiple iterations. This addresses the issues of lost skeleton dimensions, poor connectivity, and broken branches in existing technologies (2D skeleton extraction without iterative refinement). 2D extraction ignores Z-axis information, and the lack of iterative refinement results in a coarse skeleton that fails to reflect the true branch direction. This algorithm achieves a 3D skeleton extraction effect with a single pixel width, complete connectivity, and branch direction consistent with the physiological structure of the venule.
[0465] The normalized extension direction vector of each skeleton pixel is calculated to fill the logical gap in the existing technology where texture primitive mutations are not supported by anatomical structure and are only blindly and randomly adjusted. This enables the subsequent texture primitive mutations to be precisely fine-tuned along the skeleton extension direction, and the mutations to conform to anatomical rules rather than random changes that are detached from the structure.
[0466] Regarding the mutation part of the branch texture primitive:
[0467] For three core features of texture primitives—gradient vector, peak position, and arrangement angle—differentiated and precise mutation rules are designed. The gradient amplitude is ±15%, the peak position is ±1 pixel along the skeleton, and the angle is ±5°. This solves the problems of texture mutation distortion, feature destruction, and insufficient diversity in existing technologies (overall stretching and compression mutation). Traditional schemes are prone to texture structure collapse due to overall mutation, or the mutated texture is monotonous and lacks distinguishability. This achieves the technical effect of mutated textures with both diversity and reasonable anatomy, and complete preservation of core features.
[0468] Based on the ASBC mean of the texture region, a weighted correction coefficient is calculated to achieve a differentiated strategy of low variation in the core region with high ASBC correlation and high variation in the edge region with low correlation. This overcomes the shortcomings of existing technologies where uniform variation ignores the differences in the core and edge structures of the ventricle and does not conform to physiological characteristics. It achieves the technical effect of matching the degree of variation with the physiological importance of the region, stabilizing the core structure, and diversifying the edge structure.
[0469] The algorithm performs three-dimensional verifications: gradient direction, peak density, and arrangement consistency. The gradient principal direction angle is less than or equal to 10°, the peak quantity difference is less than or equal to 20%, and the average arrangement angle difference is less than or equal to 5°. This solves the problem of textures deviating from their original features and excessive distortion after mutation in existing technologies. Traditional solutions lack a verification step, which can easily lead to excessive mutation. This algorithm achieves the technical effect of ensuring that the core features of the mutated texture primitives are consistent with those of the original primitives without excessive distortion.
[0470] Regarding the reconstructed texture primitives:
[0471] The core and edge pixel grayscale calculation rules are integrated, and the definitions and value ranges of all parameters are clarified. The core pixel W=0.8 and the edge pixel W=0.5. This solves the problems of complex and cumbersome formulas, ambiguous parameters, and large deviations in the results of different people in the existing technology. It achieves the technical effect of standardized formulas, clear parameters, and direct substitution for calculation by ordinary technicians, with execution deviation approaching zero.
[0472] By adopting a weight allocation strategy of 70% for original grayscale and 30% for reconstructed features, and combined with a boundary linear fusion formula, this method solves the problems of abrupt changes in texture replacement boundaries and deviations of replaced textures from the original image features in existing technologies. Traditional solutions result in abrupt transitions between replaced textures and the original image, or complete separation from the original features. This method achieves a technical effect where the boundary transitions are natural after texture replacement, the grayscale mean change rate is less than or equal to 3%, and there are no obvious visual differences.
[0473] By adopting a one-to-one mapping rule of anchor point number binding, the reconstructed texture primitives are precisely bound to the corresponding texture extraction influence domain. This solves the problems of inaccurate binding, cross-region mismatch, and texture pollution in existing technologies, and achieves the technical effect of accurately mapping texture features to the target area, without cross-region mismatch replacement, and with 100% mapping accuracy.
[0474] In this embodiment, the Swin-UNETR network architecture to be trained in this application includes three parts: encoder, decoder, and skip connections.
[0475] The encoder part adopts the Swing Transformer architecture, which includes four stages, each containing multiple Swing Transformer blocks. The Swing Transformer blocks use a shifted window self-attention mechanism to effectively capture local and global features through window partitioning and shifting operations.
[0476] The decoder uses a convolutional neural network architecture, which includes four stages. Each stage is upsampled through transposed convolution and then concatenated with the feature maps of the corresponding stage in the encoder.
[0477] Skip connections are used to fuse features from the encoder and decoder while preserving detailed information about the image.
[0478] Network training:
[0479] Network training using an improved Dice loss function:
[0480] ① DiceCELoss is used as the loss function, combined with Dice loss and cross-entropy loss;
[0481] ② Use the AdamW optimizer to optimize parameters;
[0482] ③ Set the learning rate to 1e-4 and the weight decay to 1e-5;
[0483] ④ A sliding window inference strategy is used for model evaluation.
[0484] In the task of segmenting choroid plexus in brain MRI images, the specific implementation of this invention is as follows:
[0485] Network parameter settings:
[0486] Input image size: 176×256×256, training crop size: 96×96×32
[0487] Number of input channels: 1, Number of output channels: 2 (background and vein clusters), Feature size: 24, Number of attention heads: (3, 6, 12, 24), Window size: 7, Dropout rate: 0.0
[0488] Training parameter settings: Maximum number of iterations: 10000, evaluation interval: 500 iterations, batch size: 1 (adjustable according to GPU memory), learning rate: 1e-4, weight decay: 1e-5
[0489] The specific implementation code is as follows:
[0490] model = SwinUNETR(
[0491] in_channels=1,
[0492] out_channels=2,
[0493] patch_size=2,
[0494] depths=(2, 2, 2, 2),
[0495] num_heads=(3, 6, 12, 24),
[0496] window_size=7,
[0497] feature_size=24,
[0498] drop_rate=0.0,
[0499] attn_drop_rate=0.0,
[0500] dropout_path_rate=0.0,
[0501] use_checkpoint=False,
[0502] spatial_dims=3,
[0503] ).to(device).
[0504] The model training method for automatic segmentation of vein bundle images proposed in this application has the following advantages:
[0505] (1) Improved segmentation accuracy: Compared with the traditional UNETR method, the present invention adopts the Swing Transformer architecture, which can more effectively capture multi-scale features of the image and improve the Dice coefficient by 5-10%;
[0506] (2) Reduce computational complexity: By using the shift window self-attention mechanism, the amount of computation and memory usage are reduced, and the training speed is improved by more than 30%;
[0507] (3) Enhanced generalization ability: Improved data augmentation strategies and regularization methods enable the model to have better generalization performance on different datasets;
[0508] (4) Improved processing efficiency: Supports end-to-end segmentation of high-resolution 3D medical images without the need for complex preprocessing.
[0509] This application also provides an automatic segmentation method for ventricle cluster images (Swin-UNETR-ASBC method; for a comparison of its performance with other methods in terms of segmentation similarity coefficient Dice, please refer to [link to relevant documentation]). Figure 3 The automatic segmentation method for vesicle cluster images includes:
[0510] Obtain the image to be segmented;
[0511] Obtain the trained model for automatic medical image segmentation obtained by the venous cluster image automatic segmentation method described above;
[0512] The image to be segmented is input into a trained model for automatic medical image segmentation to obtain the segmentation result.
[0513] exist Figure 3In the figure, UNETR, UNet, GMM, and Freesurfer are existing methods; the box plot represents the DSC distribution, the scatter points are the measured values of each sample, and the connecting lines represent the DSC changes of the same sample under different methods; the segmentation accuracy of the method in this application is significantly better than that of existing methods.
[0514] Although the present invention has been described in detail above with general descriptions and specific embodiments, modifications or improvements can be made to it, which will be obvious to those skilled in the art. Therefore, all such modifications or improvements made without departing from the spirit of the present invention fall within the scope of protection claimed by the present invention.
Claims
1. A model training method for automatic segmentation of vein bundle images, characterized in that, The model training method for automatic segmentation of vesicle bundle images includes: Obtain the preprocessed dataset; Construct the Swin-UNETR network architecture to be trained; The Swin-UNETR network architecture to be trained is trained using a preprocessed dataset to obtain a trained model for automatic medical image segmentation.
2. The model training method for automatic segmentation of vein bundle images as described in claim 1, characterized in that, The process of obtaining the preprocessed dataset includes: Obtain the original dataset, which includes multiple original image data and pixel-level vesicle cluster labeled images corresponding to each original image data; The original image data and pixel-level vein cluster labeled images are standardized to obtain a standardized dataset, which includes the standardized original image data and the standardized pixel-level vein cluster labeled images. Enhancement processing is performed on each standardized original image data and each standardized pixel-level vein cluster labeled image to obtain an enhanced dataset, which includes the enhanced original image data and the deformed labeled image; the enhanced dataset serves as a preprocessed dataset.
3. The model training method for automatic segmentation of venous cluster images as described in claim 2, characterized in that, The enhancement processing of each standardized original image data and each standardized pixel-level vein cluster labeled image to obtain the enhanced dataset includes: Each standardized raw image data and its corresponding standardized pixel-level vein cluster labeled image are processed as follows: An ASBC distribution map is generated based on the standardized raw image data and its corresponding standardized pixel-level vesicle cluster labeled image. Generate a core anchor point set based on the ASBC distribution map; Generate an anchor-branch skeleton linkage network covering the branch structure of the vein cluster based on the core anchor point set; Generate a grayscale enhanced intermediate image based on the anchor-branch skeleton linkage network; Generate a spatial-grayscale double-enhanced image and a deformed labeled image based on the grayscale-enhanced intermediate image; The enhanced original image data is generated based on the spatial-grayscale dual-enhanced image.
4. The model training method for automatic segmentation of venous bundle images as described in claim 3, characterized in that, The process of generating the ASBC distribution map based on the standardized original image data and its corresponding standardized pixel-level vein cluster labeled image includes: Generate a precise set of vein cluster pixels based on standardized pixel-level vein cluster labeled images; The core reference points of the vein cluster are obtained based on the precise vein cluster pixel set; Calculate the coordinates of the reference point based on the standardized raw image data; Calculate the neighborhood branch association density of the vesicle cluster based on the standardized raw image data; Calculate the core baseline correlation degree of the venule cluster based on standardized raw image data; Calculate the grayscale structure matching degree of the vein clusters based on the standardized raw image data; The final ASBC value of each pixel is generated based on the neighborhood branch association density of the choroid plexus, the core baseline association degree of the choroid plexus, and the gray-scale structure matching degree of the choroid plexus. The final ASBC values of each pixel form a distribution map of the choroid plexus directional anatomical spatial binding coefficient.
5. The model training method for automatic segmentation of vein bundle images as described in claim 4, characterized in that, The generation of the core anchor point set based on the ASBC distribution map includes: Obtain the ASBC filtering threshold; Traverse all pixels in the ASBC distribution map and compare them with the corresponding pixels in the standardized pixel-level vein cluster annotation image. If the ASBC value of the pixel is greater than or equal to the ASBC screening threshold and the corresponding pixel value in the standardized annotation image is 1, then use it as the initial anchor point. Each initial anchor point forms an initial anchor point set, which includes the three-dimensional coordinates of each initial anchor point and the corresponding ASBC value. The precise vein cluster pixel set is divided into vein cluster branch regions to obtain multiple uniformly distributed vein cluster branch sub-regions; Traverse each branch sub-region, optimize the sub-region anchor point for each sub-region, and obtain the core anchor point corresponding to each branch sub-region. The core anchor points corresponding to each branch sub-region are plotted and optimized to obtain the optimized core anchor points, which serve as the core reference points of the network cluster.
6. The model training method for automatic segmentation of venous cluster images as described in claim 5, characterized in that, The step of generating an anchor-branch skeleton linkage network covering the branch structure of the vein cluster based on the core anchor point set includes: Based on the standardized pixel-level vein cluster labeled image and the precise vein cluster pixel set, a three-dimensional branch skeleton point set of the vein cluster is generated, which includes the core skeleton pixels of all branches. Calculate the branch density parameter for each core skeleton pixel to obtain a set of branch skeleton points with branch density parameters; The initial binding connection set is obtained by binding some core skeleton pixels in each core skeleton pixel of the branch skeleton point set to each anchor point. The initial binding connection set is optimized to obtain an optimized initial binding connection set; An anchor-branch skeleton linkage network is constructed based on the optimized initial binding connection set. The anchor-branch skeleton linkage network includes a node set, an edge set, and linkage parameters. The node set includes core anchor points and sub-core skeleton pixels. The edge set includes binding connections and corresponding connection strengths.
7. The model training method for automatic segmentation of venous cluster images as described in claim 6, characterized in that, The process of generating grayscale enhanced intermediate images based on anchor-branch skeleton linkage mesh includes: With each core anchor point as the center, a dedicated branch influence domain is defined, thereby obtaining the branch influence domain of each core anchor point; Based on the ASBC value, the influence domain of each branch is individually stratified into different association levels to obtain the stratification results for each branch's influence domain. Based on the ASBC value of the anchor point and the binding connection strength in the anchor point-branch skeleton linkage network, calculate the grayscale adjustment amount of each associated layer in the influence domain of each branch, thereby obtaining the grayscale adjustment amount set of each branch influence domain. Based on the grayscale adjustment set of each branch's influence domain, grayscale correlation progressive perturbation is performed on the standardized original image data to obtain the grayscale enhanced intermediate image.
8. The model training method for automatic segmentation of venous bundle images as described in claim 7, characterized in that, The process of generating a spatial-grayscale dual-enhanced image and a deformed annotated image based on the grayscale-enhanced intermediate image includes: Deformation driving points are selected from the core anchor points in the core anchor point set to obtain multiple deformation driving points. Each deformation driving point contains three-dimensional coordinates, deformation priority, and set offset and offset direction. Calculate the uniform offset matrix of all pixels in the image based on the deformation driving points; The grayscale enhancement intermediate image is spatially deformed based on the uniform offset matrix of all pixels in the image, thereby obtaining the spatially deformed grayscale enhancement intermediate image. Spatial deformation is performed on the standardized pixel-level vein cluster annotation image based on the unified offset matrix of all pixels in the image, thereby obtaining the deformed annotation image.
9. The model training method for automatic segmentation of vein cluster images as described in claim 8, characterized in that, The process of generating enhanced original image data and enhanced pixel-level vein cluster labeled images based on the spatial-grayscale dual-enhanced image and the deformed labeled image includes: Extract the texture extraction influence domain corresponding to each core anchor point, centered on the core anchor point; Multi-dimensional texture features are extracted within each texture extraction influence domain, and branch texture primitives corresponding to each texture extraction influence domain are generated. Mutate each branch texture primitive to obtain the reconstructed texture primitive corresponding to each branch texture primitive; The reconstructed texture primitives are mapped back to the texture extraction influence domain, thereby generating a spatially-grayscale dual-enhanced image after texture reconstruction.
10. An automatic segmentation method for venule cluster images, characterized in that, The automatic segmentation method for vesicle cluster images includes: Obtain the image to be segmented; Obtain a trained model for automatic medical image segmentation obtained by the automatic segmentation method for venous cluster images according to any one of claims 1 to 9; The image to be segmented is input into a trained model for automatic medical image segmentation to obtain the segmentation result.