Adaptive segmentation method and system for lesion area in seminal vesiculoscopic images
Through synchronous acquisition and posture correction, geometric distortions in seminal vesicle mirror images were eliminated, and key geometric features were used to adaptively adjust the resampling and optimize the lesion segmentation network, the artifact problem caused by thick layer sampling was solved, the continuity and geometric accuracy of lesion boundaries were achieved, and the accuracy of biopsy and treatment was improved.
Patent Information
- Application Number
- CN202510779499.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-12
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2045-06-12
AI Technical Summary
The prior art geometric distortion and artifact problems caused by thick layer sampling in seminal vesicle imaging affect the continuity of lesion boundaries and the three-dimensional reconstruction accuracy, resulting in inaccuracy of biopsy positioning and photodynamic dosage planning.
Eliminate geometric bias through synchronous acquisition and pose correction, adaptively adjust resampling strategies using key geometric features, optimize lesion segmentation networks in combination with smooth regularity and geometric constraints, generate continuous boundary models and dynamically superimpose them to real-time frame streams.
Output smooth and continuous images within the strict time window, enhancing the perception of tiny pathological changes, inhibiting motion blur and spot artifacts, maintaining clear details of the lesions, and improving the accuracy of biopsy path planning and photodynamic dose scheduling.
Smart Images

Figure CN120298272B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of medical image processing, and more particularly to a method and system for adaptively segmenting lesion areas in seminal vesiculoscopic images. Background Art
[0002] Laparoscopic imaging provides real-time quantitative support for the detection of seminal vesicle lesions. To shorten the examination time, the operator advances the camera along the long axis of the seminal vesicle, often using thick transverse slices. This continuously acquires video frames and constructs a near-three-dimensional view during the procedure. The operator hopes to quickly locate congestion, fibrosis, or micronodules using adaptive segmentation masks, thereby guiding the biopsy needle approach and energy knife trajectory. This scenario places high demands on the accuracy of three-dimensional reconstruction and the integrity of lesion boundaries, as measurement errors directly affect sampling depth and treatment dose.
[0003] Thick-slice sampling at an angle to the long axis of the seminal vesicle results in anisotropic voxels with in-plane resolution much higher than inter-slice resolution. Interpolation algorithms must stitch surfaces across long distances, and inter-slice errors accumulate at the edges, manifesting as jagged artifacts. Adaptive segmentation networks receive distorted data, resulting in faults and holes. This significantly increases lesion volume deviations, leading to shifts in biopsy positioning and photodynamic dose planning. Adaptive segmentation methods for lesion regions in seminal vesiculoscopic images must suppress this artifact within a strict time window; otherwise, real-time navigation cannot remain reliable.
[0004] In order to solve the above problems, a technical solution is now provided. Summary of the Invention
[0005] In order to overcome the above-mentioned defects of the prior art, an embodiment of the present invention provides a method and system for adaptive segmentation of lesion areas for seminal vesiculoscopic images, which eliminates the geometric deviation caused by thick layer sampling through synchronous acquisition and posture correction, and then uses key geometric features to adaptively adjust the resampling strategy, effectively weakening the inter-layer artifacts and resolution imbalance problems, and further optimizes the lesion segmentation network through smoothing regularization and geometric constraints to ensure the continuity and geometric accuracy of the lesion boundary. Finally, the precise lesion mask is dynamically superimposed on the real-time frame stream, providing a quantitative basis for biopsy path planning and photodynamic dose scheduling; it is completed within a strict time window, outputting smooth and continuous images, enhancing the operator's perception of subtle pathological changes, and adapting to a variety of endoscopic equipment at the same time, suppressing motion blur and spot artifacts, and keeping the lesion details clear, so as to solve the problems raised in the above-mentioned background technology.
[0006] To achieve the above object, the present invention provides the following technical solutions:
[0007] The method for adaptively segmenting lesion areas in seminal vesiculoscopic images is characterized by comprising the steps of:
[0008] S1: The acquisition end synchronously obtains thick-slice cross-sectional frames and pose matrices, and writes the frame sequence together with the sequence number-pose mapping table into the cache;
[0009] S2: Inversely infer the cross-section tilt angle based on the pose matrix, construct an affine correction operator, align the coordinate system of each frame to the cross-section reference plane, and output the correction frame sequence;
[0010] S3: Extract two key geometric features reflecting slice-wise scale imbalance and contour continuity from the corrected frame sequence, and fuse the feature results to form a comprehensive consistency index. When the index meets the standard, perform block anisotropic compensation resampling; otherwise, perform cubic spline resampling and output an isotropic volume data stack.
[0011] S4: Slice smoothing regularization is applied to the isotropic volume data stack, and the surface normal similarity and curvature penalty strategy are combined to fine-tune the lesion segmentation network to generate a continuous boundary model;
[0012] S5: Apply the continuous boundary model to the real-time correction frame stream, and superimpose the non-fracture lesion mask on the display channel according to the sequence number-pose mapping table.
[0013] In a preferred embodiment, step S1 includes the following:
[0014] The acquisition end synchronously acquires video frames and their corresponding transformation matrices through thick-layer cross-sectional sampling. The video frames are cross-sectional images captured at different positions when the lens advances along the long axis of the seminal vesicle during seminal vesiculoscopy, and the transformation matrix describes the position and orientation of the lens in three-dimensional space. The video frames are bound to the transformation matrix through timestamp matching to ensure temporal consistency between the two. The video frames are arranged into a frame sequence in the order of acquisition, and a unique serial number is assigned to each frame. A serial number-pose mapping table in the form of key-value pairs of serial numbers and transformation matrices is constructed. The frame sequence and serial number-pose mapping table are stored in the cache.
[0015] In a preferred embodiment, step S2 includes the following:
[0016] The rotation matrix of each frame is extracted according to the transformation matrix in the serial number-pose mapping table, and the angle between the lens optical axis direction vector and the global longitudinal axis direction vector is calculated to determine the cross-sectional tilt angle; an affine correction operator is constructed according to the cross-sectional tilt angle, and the cross-sectional direction is corrected by the rotation matrix and the translation vector is retained to maintain the spatial position; the affine correction operator is applied to each frame in the frame sequence for coordinate transformation, and bilinear interpolation is used to calculate the pixel values of the corrected image to generate a spatially consistent corrected frame sequence.
[0017] In a preferred embodiment, step S3 further includes the following:
[0018] Key geometric features include the global layer-wise anisotropic gradient difference and the global curvature continuity deviation. The global layer-wise anisotropic gradient difference and the global curvature continuity deviation are normalized and fused into a comprehensive consistency index. Finally, based on the comparison between the comprehensive consistency index and the standard threshold, conventional cubic spline resampling or block anisotropic compensation resampling is adaptively selected to generate an isotropic volume data stack.
[0019] In a preferred embodiment, step S3 further includes the following:
[0020] For adjacent frames in the correction frame sequence, the layer-wise gradient is calculated by dividing the pixel value difference by the physical spacing between layers and normalized. At the same time, the in-plane gradient amplitude is calculated for each frame and normalized. Then, the logarithm of the ratio of the layer-wise gradient to the in-plane gradient amplitude is calculated as the layer-wise anisotropic gradient difference, and the average value of all adjacent frame pairs is taken to generate the global layer-wise anisotropic gradient difference.
[0021] In a preferred embodiment, step S3 further includes the following:
[0022] The contour points of each frame are extracted through edge detection and the local curvature is calculated. The contour point pairs of adjacent frames are matched and the exponential average of the curvature difference is calculated as the curvature continuity deviation. The average value of all adjacent frame pairs is taken to generate the global curvature continuity deviation.
[0023] In a preferred embodiment, step S4 includes the following contents:
[0024] A Gaussian smoothing filter is applied to each slice of the isotropic volume data stack along the depth direction, and the smoothing regularization loss of the accumulated second-order rate of change is calculated. The smoothing regularized 3D volume data is generated by gradient descent. The smoothing regularized 3D volume data is input into the pre-trained lesion segmentation network to generate an initial segmentation mask. The lesion boundary surface is extracted, and the normal vector similarity and the square accumulation of local curvature of adjacent point pairs are calculated. The normal similarity loss and curvature penalty loss are defined and weightedly combined with the cross-entropy loss. The lesion segmentation network is fine-tuned by gradient descent to generate an optimized segmentation mask. The optimized segmentation mask is subjected to the isosurface extraction algorithm to generate a triangular mesh model. The continuous boundary model is generated by optimizing the normal consistency loss by Laplace smoothing and the accumulation of the complement of the dot product of the normal vectors of adjacent patches.
[0025] In a preferred embodiment, step S4 includes the following contents:
[0026] The second-order rate of change is the acceleration rate of spatial change calculated by the difference between adjacent pixel values.
[0027] In a preferred embodiment, step S5 includes the following contents:
[0028] For each frame in the thick-layer cross-sectional frame stream acquired in real time, the pose matrix is synchronously obtained and the cross-sectional tilt angle is calculated. A real-time affine correction operator is constructed to align the real-time frame to the cross-sectional reference plane to generate a real-time correction frame stream. According to the spatial difference between the pose matrix of the real-time correction frame stream and the pose matrix of the training data recorded in the serial number-pose mapping table, the closest training frame is matched, the relative pose transformation is calculated, and the vertex set of the continuous boundary model is applied with the relative pose transformation to generate a real-time boundary model. The real-time boundary model is projected onto a two-dimensional plane and filled to generate a lesion mask. The lesion mask is superimposed on the real-time correction frame to generate an enhanced display frame and sent to the display channel.
[0029] The adaptive segmentation system for lesion areas in seminal vesiculoscopic images includes: data acquisition module, posture correction module, feature fusion module, segmentation optimization module and real-time superposition module;
[0030] Data acquisition module: The acquisition end synchronously obtains thick-slice cross-sectional frames and pose matrices, and writes the frame sequence together with the sequence number-pose mapping table into the cache;
[0031] Posture correction module: infers the cross-section tilt angle based on the pose matrix, constructs an affine correction operator, aligns the coordinate system of each frame to the cross-section reference plane, and outputs a corrected frame sequence;
[0032] Feature fusion module: Extracts two key geometric features reflecting slice-wise scale imbalance and contour continuity from the corrected frame sequence, fuses the feature results to form a comprehensive consistency index. When the index meets the standard, it performs block anisotropic compensation resampling; otherwise, it performs cubic spline resampling and outputs an isotropic volume data stack.
[0033] Segmentation Optimization Module: This module applies slice smoothing regularization to the isotropic volume data stack, combines surface normal similarity with curvature penalty strategy to fine-tune the lesion segmentation network, and generates a continuous boundary model.
[0034] Real-time overlay module: The continuous boundary model is applied to the real-time correction frame stream, and the seamless lesion mask is superimposed on the display channel according to the sequence number-pose mapping table.
[0035] The technical effects and advantages of the method and system for adaptively segmenting lesion areas in seminal vesiculoscopic images of the present invention are as follows:
[0036] The present invention eliminates the geometric deviation caused by thick layer sampling through synchronous acquisition and posture correction, and then uses key geometric features to adaptively adjust the resampling strategy, effectively reducing the inter-layer artifacts and resolution imbalance problems. It further optimizes the lesion segmentation network through smoothing regularization and geometric constraints to ensure the continuity and geometric accuracy of the lesion boundary. Finally, the precise lesion mask is dynamically superimposed on the real-time frame stream, providing a quantitative basis for biopsy path planning and photodynamic dose scheduling. The entire process is completed within a strict time window, outputting smooth and continuous images, enhancing the operator's perception of subtle pathological changes, and adapting to a variety of endoscopic equipment. It suppresses motion blur and spot artifacts, keeps lesion details clear, and provides efficient and accurate technical support for the diagnosis and treatment of seminal vesicle lesions. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 Schematic diagram of the process of the adaptive segmentation method of lesion area for seminal vesiculoscopic images of the present invention.
[0038] Figure 2 Schematic diagram of the structure of the adaptive segmentation system for lesion areas in seminal vesiculoscopic images of the present invention. DETAILED DESCRIPTION
[0039] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0040] Example 1: Figure 1 The present invention provides a method for adaptively segmenting lesion areas in seminal vesiculoscopic images, comprising:
[0041] S1: The acquisition end synchronously obtains thick-slice cross-sectional frames and pose matrices, and writes the frame sequence together with the sequence number-pose mapping table into the cache.
[0042] S2: Inversely infer the cross-sectional tilt angle based on the pose matrix, construct an affine correction operator, align the coordinate system of each frame to the cross-sectional reference plane, and output the corrected frame sequence.
[0043] S3: Two key geometric features reflecting slice-wise scale imbalance and contour continuity are extracted from the corrected frame sequence, and the feature results are fused to form a comprehensive consistency index. When the index meets the standard, block anisotropic compensation resampling is performed; otherwise, cubic spline resampling is performed to output an isotropic volume data stack.
[0044] S4: Slice smoothing regularization is applied to the isotropic volume data stack, and the surface normal similarity and curvature penalty strategy are combined to fine-tune the lesion segmentation network to generate a continuous boundary model.
[0045] S5: Apply the continuous boundary model to the real-time correction frame stream, and superimpose the non-fracture lesion mask on the display channel according to the sequence number-pose mapping table.
[0046] During laparoscopic examinations, physicians use laparoscopic images to detect lesions in the vesicle (such as congestion, fibrosis, or micronodules) to guide biopsy and treatment. Because laparoscopic examinations must be completed within a limited timeframe, operators typically employ thick-slice transverse sampling techniques, advancing the camera along the long axis of the vesicle to rapidly acquire video frames and construct a near-three-dimensional view. However, due to the thick sampling slices and their angled orientation relative to the long axis, this approach results in inter-slice resolution significantly lower than in-plane resolution, resulting in anisotropic voxels. These voxels produce jagged artifacts during 3D reconstruction, particularly at lesion boundaries, impairing accurate segmentation and localization of lesion contours, directly reducing the accuracy of biopsy needle approach and treatment dose planning. To address this issue, the present invention proposes an adaptive lesion region segmentation method for laparoscopic images. By simultaneously acquiring thick-slice transverse frames and a pose matrix, followed by subsequent processing, geometric distortion is suppressed, enabling continuous output of lesion contours and providing quantitative support for real-time navigation. Step S1, the foundation of the entire method for data acquisition and preprocessing, aims to ensure data integrity and consistency during subsequent pose correction and resampling.
[0047] The purpose of step S1 is to synchronously acquire thick-slice cross-sectional frames and pose matrices through the acquisition end during the seminal vesiculoscopy, construct a frame sequence and sequence number-pose mapping table, and write it into the cache, providing a reliable data foundation for subsequent steps. The following is a detailed description of the specific processing logic:
[0048] Step S1 includes the following contents:
[0049] S1.1, Data Collection:
[0050] During the seminal vesiculoscopy process, the acquisition end continuously acquires video frames using thick-slice cross-sectional sampling. Video frames are cross-sectional images captured at different locations as the lens advances along the long axis of the seminal vesicle. Each frame represents two-dimensional image data of a specific cross-section of the seminal vesicle. To facilitate subsequent processing, each frame is assigned a unique serial number and arranged in the order of acquisition. Simultaneously, the acquisition end records the spatial pose information of each frame, describing the position and orientation of the lens in three-dimensional space. Spatial pose information is represented in the form of a transformation matrix, which contains a translation vector describing the lens position and a rotation matrix describing the lens orientation. Each set of transformation matrices corresponds one-to-one to the corresponding video frame, and together they describe the geometric position of that frame in space.
[0051] Thick-slice cross-sectional sampling captures video frames and records their spatial pose information, providing the necessary data foundation for subsequent spatial correction and 3D reconstruction. Thick-slice sampling enables rapid acquisition of continuous image data, shortening inspection time and improving efficiency. Recording spatial pose information provides a precise spatial reference for each frame, enabling subsequent steps to accurately restore the spatial relationship between video frames and suppress geometric distortion caused by sampling angle deviations, thereby improving the usability and accuracy of image data.
[0052] S1.2, Data Synchronization:
[0053] To ensure temporal consistency between video frames and their corresponding spatial pose information, the acquisition end uses timestamp matching to bind each frame to its corresponding transformation matrix. Timestamp matching involves recording the generation time of each frame and transformation matrix during the acquisition process and ensuring their correspondence by comparing the timestamps. This synchronization mechanism avoids data misalignment caused by acquisition delays or device response variations, ensuring that each frame's spatial pose information fully matches its image content.
[0054] S1.3, frame sequence and mapping table construction:
[0055] The captured video frames are arranged in chronological order to form a frame sequence. This frame sequence reflects the continuous image data acquired as the camera advances along the long axis of the seminal vesicle. Each frame is assigned a unique sequence number and associated with its corresponding transformation matrix to construct a sequence number-to-pose mapping table. This sequence number-to-pose mapping table is organized as key-value pairs, where the key is the video frame number and the value is the corresponding transformation matrix. This structured design facilitates rapid retrieval of spatial pose information based on the video frame number in subsequent steps.
[0056] S1.4, data is written to the cache:
[0057] The constructed frame sequence and sequence-to-pose mapping table are stored in a cache. During storage, the frame sequence is arranged in acquisition order, and the sequence-to-pose mapping table is organized as key-value pairs to ensure temporal consistency in data access. The cache serves as a temporary storage unit, providing immediately available data for subsequent processing.
[0058] Step S1 synchronously acquires thick-slice cross-sectional sampling video frames and their corresponding transformation matrices through the acquisition end, constructs a frame sequence and a sequence number-pose mapping table, and ultimately stores them in a cache, ensuring that the spatial position of each frame can be accurately tracked. This effectively suppresses geometric distortion caused by sampling angle deviation, creating the conditions for high-precision lesion segmentation and 3D reconstruction. The frame sequence and sequence number-pose mapping table in the cache are directly used in subsequent steps to infer the cross-sectional tilt angle and coordinate system alignment.
[0059] Step S1 synchronously acquires thick-layer cross-sectional frames and pose matrices through the acquisition end, and constructs a frame sequence and a sequence number-pose mapping table, which are stored in the cache. These data provide the basis for original images and spatial positioning for subsequent processing, ensuring the spatial consistency of the image sequence in real-time navigation. However, due to the angle between the lens and the long axis of the seminal vesicle during the thick-layer sampling process, the acquired cross-sectional frames are not completely perpendicular to the long axis of the seminal vesicle, resulting in anisotropic voxels and jagged artifacts, which directly affect the accuracy of three-dimensional reconstruction and the integrity of the lesion boundary. To solve this problem, step S2 focuses on inferring the section tilt angle based on the pose matrix and performing coordinate system correction, outputting the corrected frame sequence, and laying a geometric consistency foundation for the subsequent resampling of step S3 and lesion segmentation of step S4.
[0060] Step S2 includes the following contents:
[0061] S2.1, reverse cross-section inclination angle
[0062] In the process of inferring the cross-sectional tilt angle, the transformation matrix recorded in the serial number-pose mapping table is first used to extract the rotation matrix corresponding to each frame. The rotation matrix describes the orientation of the lens in three-dimensional space, where the third column vector represents the direction vector of the lens optical axis in the global coordinate system. Assuming that the long axis of the seminal vesicle is approximately the longitudinal axis direction of the global coordinate system, that is, the up and down direction, the cross-sectional reference plane is defined as the horizontal plane perpendicular to the long axis of the seminal vesicle. Next, the angle between the lens optical axis direction vector and the global longitudinal axis direction vector is calculated and defined as the cross-sectional tilt angle. In the specific calculation, first calculate the ratio of the projection component of the lens optical axis direction vector in the global longitudinal axis direction to the modulus of the lens optical axis direction vector to obtain the cosine value of the angle, and then determine the size of the cross-sectional tilt angle through the inverse cosine operation.
[0063] The purpose of inferring the cross-sectional tilt angle is to quantify the degree of tilt of each cross-sectional frame due to lens posture deviation. In seminal vesiculoscopy, the ideal cross-sectional plane should be perpendicular to the long axis of the seminal vesicle. However, in practice, there is an angle between the lens optical axis and the long axis of the seminal vesicle, resulting in tilt of the acquired cross-sectional plane and, in turn, geometric distortion. By accurately calculating the cross-sectional tilt angle, a key parameter can be provided for subsequent coordinate system correction. This quantitative method ensures the accuracy of the correction process, effectively supports the subsequent steps to eliminate geometric distortion, and lays the foundation for three-dimensional reconstruction and lesion segmentation.
[0064] S2.2, construct the affine correction operator:
[0065] In the process of constructing the affine correction operator, a coordinate transformation operator is designed according to the cross-section tilt angle of each frame to correct the posture deviation of the frame.
[0066] First, the direction of the rotation axis is determined. By calculating the cross product of the lens optical axis vector and the global longitudinal axis vector, a vector perpendicular to the plane formed by the two is obtained. This vector is the rotation axis. Next, based on the negative value of the cross-sectional tilt angle (to offset the original tilt), a rotation matrix is generated to adjust the orientation of the lens coordinate system to be parallel to the transverse reference plane. This rotation matrix is then combined with the translation vector of the transformation matrix in the index-pose mapping table to construct the complete affine rectification operator, where the translation vector maintains the spatial position of the frame in the global coordinate system.
[0067] The purpose of constructing an affine correction operator is to eliminate the tilt of each frame's cross-section caused by lens pose deviation through coordinate transformation. The rotation matrix ensures that the cross-section orientation is consistent with the cross-section reference plane, while the preservation of the translation vector prevents frame position shifts in space. This method effectively corrects the geometric distortion caused by lens pose and generates spatially consistent image data. The corrected frame sequence provides a reliable geometric foundation for subsequent processing, helping to improve the accuracy of 3D reconstruction and lesion segmentation.
[0068] S2.3, Coordinate system alignment:
[0069] During the coordinate system alignment process, the corresponding affine correction operator is applied to each frame in the frame sequence for spatial transformation. Specifically, the two-dimensional image pixels of each frame are regarded as points in three-dimensional space, and their depth values are assumed to be zero. These points are rotated and translated by the affine correction operator to obtain the corrected three-dimensional coordinates, and then these coordinates are projected back to the two-dimensional plane. Since the transformed coordinate values are usually non-integer, the bilinear interpolation method is used to calculate the pixel values of the corrected image to ensure that the image details and quality are preserved. Finally, the cross-section of each frame is spatially aligned to a unified cross-section reference plane.
[0070] The purpose of coordinate alignment is to eliminate geometric distortion caused by lens sampling angle deviation and generate a spatially consistent image sequence. Through precise coordinate transformation, the corrected frame sequence is unified on the transverse reference plane, eliminating image misalignment caused by lens pose differences. This spatial consistency significantly improves the geometric reliability of the frame sequence, supporting subsequent resampling and lesion segmentation. The corrected image sequence enhances the accuracy of 3D reconstruction and ensures the integrity and continuity of lesion boundaries.
[0071] Step S2 completes the spatial correction of the thick-slice cross-sectional frame sequence through three sub-steps: inversely inferring the section tilt angle, constructing an affine correction operator, and aligning the coordinate system. The corrected frame sequence eliminates the geometric inconsistency caused by the angle between the lens optical axis and the long axis of the seminal vesicle. In the scenario of adaptive segmentation of the lesion area in the seminal vesiculoscopic image, this step ensures that subsequent resampling is based on a unified cross-sectional reference plane, thereby improving the balance of the layer scale and the continuity of the contour. Ultimately, step S2 provides a high-quality geometric foundation for the lesion segmentation network to generate a continuous boundary model, significantly enhancing the accuracy and reliability of the processing results.
[0072] Step S2 uses pose correction to infer the cross-sectional tilt angle using the pose matrix and construct an affine correction operator to align the spatial coordinate system of the thick-slice transverse frame sequence to the transverse reference plane, outputting a corrected frame sequence. This process effectively eliminates geometric distortion caused by lens pose deviation, laying a foundation for spatial consistency for subsequent 3D reconstruction. However, due to the inherent low inter-slice resolution of thick-slice sampling, the corrected frame sequence still exhibits anisotropic voxels with in-plane resolution far higher than the slice resolution. This resolution imbalance easily leads to inter-slice error accumulation in 3D interpolation, especially forming jagged artifacts at lesion boundaries, which in turn affects the accuracy of the adaptive segmentation network. To address this issue, step S3 aims to construct a comprehensive consistency index by extracting key geometric features reflecting slice-wise scale imbalance and contour continuity. Based on this index, a resampling strategy is adaptively selected to generate an isotropic volume data stack, providing high-quality 3D data support for subsequent lesion segmentation.
[0073] Step S3 includes the following contents:
[0074] S3.1, extract the global layer-wise anisotropic gradient difference:
[0075] To extract the global layer-wise anisotropic gradient difference, we first calculate the layer-wise gradient for adjacent frames in the calibrated frame sequence to characterize the variation in pixel intensity between frames. The layer-wise gradient is calculated by subtracting the pixel values at the same location in adjacent frames. The resulting difference is then normalized by dividing it by the physical spacing between adjacent frames to reflect the magnitude of the gradient variation in real space.
[0076] Next, the in-plane gradient is calculated for each frame in the correction frame sequence. Specifically, the horizontal gradient and vertical gradient are obtained by differentiating the pixel values in the horizontal and vertical directions, respectively. The squares of the horizontal gradient and the vertical gradient are then added and the square root is taken to calculate the in-plane gradient amplitude, which is then divided by the in-plane pixel spacing for normalization.
[0077] Subsequently, the ratio of the layer-wise gradient to the in-plane gradient amplitude is calculated, and the natural logarithm of the ratio is taken to amplify the difference between the two and stabilize the numerical range, thereby obtaining the layer-wise anisotropic gradient difference for each pair of adjacent frames.
[0078] Finally, the layer-wise anisotropic gradient differences of all adjacent frame pairs in the corrected frame sequence are summed and averaged to generate the global layer-wise anisotropic gradient difference.
[0079] Extracting the layer-wise anisotropic gradient difference aims to quantify the degree of imbalance between the layer-wise and in-plane resolutions of the corrected frame sequence. Thick layer sampling results in lower inter-layer resolution than in-plane resolution, making the layer-wise gradient usually smaller than the in-plane gradient. This imbalance reduces the quality of 3D reconstruction. By calculating the ratio of the layer-wise gradient to the in-plane gradient and taking its natural logarithm, the sensitivity to resolution imbalance can be enhanced, thereby accurately capturing its degree. This feature provides a key basis for the subsequent fusion of features to form a comprehensive consistency index, which helps to adaptively adjust the resampling strategy and improve the resolution consistency and overall quality of 3D data.
[0080] For example, to help understand, the global layer-wise anisotropic gradient difference can be obtained as follows:
[0081] enter:
[0082] Correction frame sequence , where each frame is the rectified two-dimensional image with size , the pixel position is recorded as .in Indicates the width of the image, Indicates the height of the image.
[0083] deal with:
[0084] Layer-wise gradient calculation:
[0085] For adjacent frames and , calculate the layer gradient to characterize the change of pixel intensity between frames. Define the layer gradient for: ;in Represents a frame In position The pixel value of is the physical distance between layers of adjacent frames, which is used to normalize the gradient value to reflect the real spatial variation.
[0086] In-plane gradient calculation:
[0087] Frame Apply the Sobel operator to calculate the horizontal gradient and vertical gradient , and then calculate the gradient amplitude within the surface : ;in is the in-plane pixel spacing, used to normalize the in-plane gradient.
[0088] Layer-wise anisotropy gradient difference:
[0089] Layer-wise anisotropy gradient difference It is used to quantify the imbalance between the gradient in the layer and the in-plane gradient. It is defined as the ratio of the two and then takes the logarithm to amplify the difference and stabilize the value range: ;in is a small positive number (e.g. ) to avoid the denominator being zero; adding 1 to the logarithm operation ensures that the result is non-negative.
[0090] Global calculation:
[0091] For all adjacent frame pairs calculate , take the average value as the global layer-wise anisotropic gradient difference .
[0092] Output:
[0093] Global layer-wise anisotropic gradient difference .
[0094] Purpose:
[0095] Quantization correction frame sequence The degree of imbalance in layer-wise and in-plane resolution provides a basis for subsequent comprehensive consistency indicators.
[0096] S3.2, Extract curvature continuity deviation:
[0097] To extract the curvature continuity deviation, an edge detection algorithm is first applied to each frame in the corrected frame sequence to extract a set of points along the contour line. Subsequently, for each contour point, the local curvature is approximated based on the second-order differences of its adjacent points to characterize the contour's curvature. The calculation method involves taking the coordinates of the contour point and its preceding and following adjacent points, calculating the second-order differences, and normalizing them to obtain the local curvature value. Next, a nearest neighbor matching approach is used to establish correspondence between contour points in adjacent frames. The difference in curvature values between pairs of corresponding contour points is calculated to obtain the curvature difference. The curvature differences of all corresponding pairs of contour points are then summed and averaged. This average is then subjected to an exponential operation and subtracted by 1 to amplify significant curvature changes. This generates the curvature continuity deviation for each pair of adjacent frames. Finally, the curvature continuity deviations of all pairs of adjacent frames in the corrected frame sequence are summed and averaged to generate the global curvature continuity deviation.
[0098] Extracting curvature continuity deviation aims to evaluate the degree of contour continuity in the corrected frame sequence in the layer direction. In an ideal three-dimensional space, the lesion contour should be continuous and smooth, but thick layer sampling may lead to discontinuities in the inter-layer contour, which manifests as sudden changes in the curvature value. By calculating the curvature difference of corresponding contour points between adjacent frames and performing exponential operations, the sensitivity to discontinuities can be enhanced and the degree of deviation in contour continuity can be effectively quantified. This feature provides a supplementary basis for the subsequent fusion of features to form a comprehensive consistency index, ensuring that the resampling strategy can be optimized for the contour continuity problem and improve the geometric consistency of the three-dimensional data.
[0099] For example, to help understand the curvature continuity deviation, you can use the following method:
[0100] enter:
[0101] Correction frame sequence .
[0102] deal with:
[0103] Contour extraction:
[0104] For each frame Apply the Canny edge detection algorithm to extract the contour line set ,in Coordinates of the contour points , Frame The total number of contour points.
[0105] Curvature calculation:
[0106] For the outline Point on , local curvature is calculated based on the second-order difference of adjacent points : ;in and for If the adjacent points before and after are boundary points, unilateral difference adjustment is adopted.
[0107] Curvature continuity deviation:
[0108] In adjacent frames and The corresponding point pairs are determined by contour point matching (such as nearest neighbor matching) . Calculate the curvature difference: ;
[0109] Curvature continuity deviation It is defined as the mean of the curvature differences of corresponding pairs of points and then exponentially amplified to amplify significant changes: ;
[0110] in To match the number of pairs, the exponentiation operation minus 1 ensures that the result starts at zero.
[0111] Global calculation:
[0112] For all adjacent frame pairs calculate , take the average value as the global curvature continuity deviation .
[0113] Output:
[0114] Global curvature continuity deviation .
[0115] Purpose:
[0116] Evaluate the corrected frame sequence The continuity of the contour in the upper layer provides a supplementary basis for the comprehensive consistency index.
[0117] S3.3, fusion features to form a comprehensive consistency index:
[0118] To generate a comprehensive consistency index from these features, the global layer-wise anisotropic gradient difference and global curvature continuity deviation are first normalized using a minimum-maximum process to unify their dimensions and numerical ranges. Next, a weighted fusion of these normalized global layer-wise anisotropic gradient difference and global curvature continuity deviation is performed to generate a comprehensive consistency index. This fusion process comprehensively accounts for the effects of resolution imbalance and contour discontinuities.
[0119] S3.4, Adaptive Resampling:
[0120] In the adaptive resampling process, the comprehensive consistency index is first compared with the preset standard threshold to determine the resampling strategy to be adopted.
[0121] If the comprehensive consistency index is less than or equal to the standard threshold, indicating that the layer consistency is good, conventional cubic spline resampling is used; otherwise, block anisotropic compensation resampling is used.
[0122] In conventional cubic spline resampling, the required interpolation points in the slice direction are calculated based on the in-plane resolution. The corrected frame sequence is then interpolated using the cubic spline interpolation method to generate an isotropic volume data stack. In block-wise anisotropic compensation resampling, the corrected frame sequence is divided into multiple sub-blocks along the slice direction. For each sub-block, the local slice-wise anisotropic gradient difference and local curvature continuity deviation are calculated, and then a local comprehensive consistency index is generated. The local resampling rate is determined based on the local comprehensive consistency index. Subsequently, local interpolation is performed on each sub-block, and finally the interpolation results of all sub-blocks are spliced to generate a global isotropic volume data stack.
[0123] Adaptive resampling aims to dynamically select an appropriate interpolation strategy based on comprehensive consistency metrics to optimize slice resolution and generate high-quality 3D data. When slice consistency is good, conventional cubic spline resampling can quickly generate isotropic volume data stacks. When consistency is poor, block anisotropic compensation resampling can more finely address resolution imbalance and contour discontinuities by locally adjusting the resampling rate. This feature improves the flexibility and accuracy of resampling, ensuring that the generated isotropic volume data stacks have high-quality geometric consistency and resolution uniformity, providing a reliable 3D data foundation for subsequent lesion segmentation.
[0124] Step S3 constructs a comprehensive consistency index by extracting layer-wise anisotropic gradient differences and curvature continuity deviations, and adaptively selects a resampling strategy based on this index, successfully generating an isotropic volume data stack. In the adaptive segmentation scenario of lesion areas in seminal vesiculoscopic images, this step addresses the issues of insufficient inter-layer resolution and artifacts caused by thick-layer sampling by quantifying key geometric features and dynamically adjusting processing methods, effectively improving the quality and consistency of the three-dimensional data. The generated isotropic volume data stack provides high-quality three-dimensional data support for the subsequent lesion segmentation network, ensuring the geometric consistency and continuity of lesion boundaries, thereby enhancing the accuracy of biopsy navigation and dose planning.
[0125] Step S3 constructs a comprehensive consistency index by extracting the layer-wise anisotropic gradient difference and curvature continuity deviation, and adaptively selects the resampling strategy based on this index to generate an isotropic volume data stack. This process effectively alleviates the problems of insufficient inter-layer resolution and artifacts caused by thick-layer sampling, providing a high-quality three-dimensional data foundation for subsequent lesion segmentation. However, relying solely on the resolution balance of isotropic volume data stacks cannot fully meet the requirements for accurate lesion boundary segmentation, especially when faced with complex lesion morphology (such as congestion, fibrosis, or micronodules) and noise interference in seminal vesiculoscopic images. The segmentation results are prone to faults or holes, affecting the accuracy of biopsy navigation and dose planning. Therefore, step S4 requires further optimization of data smoothness and fine-tuning of the segmentation network on the isotropic volume data stack to generate a continuous and geometrically accurate lesion boundary model.
[0126] Step S4 includes the following contents:
[0127] S4.1, apply slice smoothing regularization:
[0128] In the process of applying slice smoothing regularization, a Gaussian smoothing filter is first applied to each slice of the isotropic volume data stack along the depth direction to reduce the impact of in-plane noise on subsequent lesion segmentation. The kernel size of the Gaussian smoothing filter is determined according to the in-plane resolution to strike a balance between smoothing effect and detail preservation. Next, for the slices processed by the Gaussian smoothing filter, the second-order rate of change of the pixel value in space is calculated, that is, the acceleration rate of spatial change is calculated by the difference between adjacent pixel values. Then, the squares of the second-order rate of change of all slices are accumulated and defined as the smoothing regularization loss, which is used to measure the degree of smooth transition of pixel values between slices. After that, the smoothing regularization loss is gradually reduced by repeatedly adjusting the pixel values of each slice in the isotropic volume data stack. This adjustment process is based on the optimization idea of gradient descent, and ultimately generates smoothing regularized three-dimensional volume data.
[0129] Through the use of Gaussian smoothing filters and second-order rate of change constraints, inter-layer artifacts and in-plane noise are suppressed, thereby improving the smoothness and stability of 3D volume data. The Gaussian smoothing filter reduces noise interference by weighted averaging pixel values; the accumulation of squares of the second-order rate of change acts as a smoothing regularization loss to limit sharp changes in pixel values in space, ensuring smooth transitions between slices and reducing artifacts caused by thick-slice sampling. This provides stable input data for the subsequent lesion segmentation network, significantly improving the accuracy and continuity of lesion segmentation results and laying a solid foundation for subsequent steps.
[0130] S4.2, fine-tuning the lesion segmentation network:
[0131] During the fine-tuning of the lesion segmentation network, the smoothed and regularized 3D volume data is first fed into the pre-trained lesion segmentation network to generate an initial segmentation mask, which is used to mark the lesion and background regions. Next, the lesion boundary surface is extracted from the initial segmentation mask, and the normal vector of each point on this surface is calculated. Subsequently, the similarity between the normal vectors of adjacent pairs of points on the surface is calculated by taking the complement of the dot product of the normal vectors, defined as the normal similarity loss, which measures the continuity of the normal vectors of adjacent regions. Simultaneously, the local curvature of each point on the surface is calculated, and the curvature value is determined by the positional change of adjacent points. The squared sum of all curvature values is defined as the curvature penalty loss to limit sharp changes in the boundary surface. The cross-entropy loss calculated based on the annotated data is then weighted together with the normal similarity loss and the curvature penalty loss to form the total loss. Finally, the parameters of the lesion segmentation network are repeatedly adjusted to gradually reduce the total loss. This optimization process, based on the principle of gradient descent, results in the fine-tuned lesion segmentation network and the optimized segmentation mask.
[0132] Geometric constraints are introduced through normal similarity loss and curvature penalty loss to optimize the smoothness and continuity of lesion boundaries. Normal similarity loss reduces discontinuities in boundary surfaces by limiting the differences in normal vectors between adjacent regions; curvature penalty loss smoothes boundary surfaces and reduces jagged artifacts by constraining changes in curvature values. This improves the geometric accuracy of segmentation results, effectively reducing discontinuities and holes in the segmentation results in complex lesion morphologies and noise-influenced scenarios found in seminal vesiculoscopic images, and provides a high-quality foundation for subsequent generation of continuous boundary models.
[0133] S4.3, Generate a continuous boundary model:
[0134] To generate a continuous boundary model, an isosurface extraction algorithm is first applied to the optimized segmentation mask to generate a triangular mesh model of the lesion area, consisting of a set of vertices and a set of patches. Next, the triangular mesh model undergoes Laplace smoothing, iteratively updating vertex positions so that each vertex moves toward the average position of its adjacent vertices to smooth the surface and reduce jagged artifacts. Subsequently, the normal vector of each patch in the triangular mesh model is calculated. The complement of the dot product of the normal vectors of adjacent patches is accumulated and defined as the normal consistency loss, which measures the continuity of the surface normal. Vertex positions are then adjusted to gradually reduce the normal consistency loss. This optimization process, based on the principle of minimization, ultimately generates an optimized continuous boundary model.
[0135] Isosurface extraction, Laplace smoothing, and normal consistency adjustment ensure the geometric accuracy and continuity of lesion boundaries. The isosurface extraction algorithm converts the segmentation mask into a triangular mesh model. Laplace smoothing smoothes the surface by averaging vertex positions, and normal consistency loss further improves surface quality by constraining the differences in normal vectors of adjacent patches. This provides a high-quality boundary model for real-time navigation, ensuring the smoothness and continuity of lesion contours, significantly improving the accuracy of biopsy navigation and dose planning.
[0136] Step S4 optimizes data smoothness and lesion boundary accuracy on the isotropic volume data stack by applying slice smoothing regularization, fine-tuning the lesion segmentation network, and generating a continuous boundary model. Ultimately, a continuous boundary model is generated. In the adaptive segmentation scenario of lesion areas in seminal vesiculoscopic images, applying slice smoothing regularization improves data stability by suppressing inter-layer artifacts, fine-tuning the lesion segmentation network optimizes the continuity of lesion boundaries through geometric constraints, and generating a continuous boundary model ensures boundary accuracy through surface smoothing. These steps collectively reduce faults and holes in the segmentation results, ensure the geometric accuracy of the lesion contour, and provide a reliable foundation for the subsequent real-time correction of the frame stream to superimpose a fault-free lesion mask, significantly improving the accuracy of biopsy navigation and dose planning.
[0137] The aforementioned step S4 applies a slice smoothing regularization on the isotropic volume data stack, and combines the surface normal similarity and curvature penalty strategy to fine-tune the lesion segmentation network and generate a continuous boundary model. This model has high-quality geometric consistency and boundary continuity, which lays the foundation for the accurate segmentation of the lesion contour. However, in the real-time clinical scenario of seminal vesiculoscope navigation, the static continuous boundary model cannot directly meet the dynamic operation requirements. The operator needs to accurately superimpose the lesion mask on each frame in the real-time video frame stream acquired by the advancing lens to achieve dynamic guidance of the biopsy needle approach and energy knife trajectory. Therefore, step S5 needs to apply the continuous boundary model to the real-time correction frame stream, and combine the sequence number-pose mapping table to complete the accurate superposition of the non-fracture lesion mask, providing real-time quantitative support for biopsy navigation and dose planning.
[0138] Step S5 includes the following contents:
[0139] S5.1, real-time correction frame stream generation:
[0140] The processing logic for generating a real-time correction frame stream first synchronously acquires the corresponding pose matrix for each frame in the real-time thick cross-sectional frame stream, which is used to record the spatial posture of the lens at that moment. Next, the pose matrix is used to reversely deduce the cross-sectional tilt angle. Specifically, the degree of cross-sectional tilt is determined by calculating the angular difference between the normal vector corresponding to the pose matrix and the normal vector of the preset cross-sectional reference plane. Then, a real-time affine correction operator is constructed to adjust the geometric position of the real-time frame to be consistent with the cross-sectional reference plane through spatial rotation and translation operations, thereby generating a correction frame. Finally, all correction frames are organized in a time series to form a real-time correction frame stream.
[0141] Leveraging the spatial information of the pose matrix, we quantify cross-section tilt using normal vector angle differences, and then eliminate geometric deviations through rotation and translation. Spatial correction of the real-time frame is achieved through the pose matrix, ensuring geometric alignment between the real-time frame and the training data. Using normal vector angle differences to quantify pose deviations accurately describes the tilt state of the real-time frame, while the real-time affine correction operator eliminates geometric distortion through rotation and translation to provide a unified spatial reference.
[0142] S5.2, Continuous Boundary Model Mapping:
[0143] The processing logic for the continuous boundary model mapping first matches each frame in the real-time correction frame stream to the closest frame in the training data based on its pose matrix and a pre-built sequence-to-pose mapping table. The specific matching process determines the optimal matching frame by comparing the spatial difference between the real-time pose matrix and the pose matrices of each frame in the training data, where the spatial difference is represented by the square root of the sum of the squares of the differences between the components of the pose matrix. Next, the relative pose transformation is calculated, specifically by multiplying the real-time pose matrix with the inverse matrix of the best matching frame pose matrix to obtain the spatial transformation relationship from the training frame coordinate system to the real-time frame coordinate system. This relative pose transformation is then applied to the vertex set of the continuous boundary model to generate a mapped vertex set, which is then combined with the original patch set to generate a real-time boundary model that is spatially aligned with the real-time frame.
[0144] The degree of matching is quantified by spatial differences in the pose matrix, and the coordinate system transformation is achieved through matrix multiplication, ultimately adjusting the spatial position of the boundary model. Dynamic adjustment of the continuous boundary model is achieved through pose matching and relative transformation, ensuring the geometric consistency of the lesion boundary with the real-time frame. Spatial differences are used to quantify matching accuracy to ensure the accuracy of the optimal matching frame, while relative pose transformation achieves precise mapping through matrix operations to maintain the spatial correspondence of the boundary model. This significantly enhances the real-time and reliability of navigation, providing a precise spatial foundation for subsequent lesion mask overlay.
[0145] S5.3, Non-fragmented Lesion Mask Overlay:
[0146] The processing logic for seamless lesion mask overlay first generates a lesion mask based on the real-time boundary model for each frame in the real-time correction frame stream. The specific process generates a binary mask by projecting the real-time boundary model onto a two-dimensional plane and filling its internal area to mark the lesion area and background area. The generated lesion mask is then superimposed on the real-time correction frame to generate an enhanced display frame. Specifically, this is done by applying pseudo-color highlighting to the lesion area while retaining the original grayscale value in the background area to maintain contrast. Finally, the enhanced display frame is fed into the display channel to achieve dynamic visualization of the lesion area.
[0147] The computational concept is to generate precise masks through geometric projection and area filling, and then enhance visualization through color differentiation. Projection and filling enable precise generation of lesion masks, while pseudo-color highlighting enhances the visual recognition of lesion areas. Projection and filling are used to generate masks to ensure geometric consistency between the mask and the real-time boundary model, while pseudo-color highlighting enhances visualization to provide intuitive lesion localization information. This significantly improves the accuracy of biopsy needle approaches and energy knife trajectories, providing real-time and clear guidance for clinical operations.
[0148] Step S5 dynamically applies the continuous boundary model to the real-time correction frame stream through three sub-steps: real-time correction frame stream generation, continuous boundary model mapping, and seamless lesion mask superposition. The lesion mask is accurately superimposed based on the sequence number-pose mapping table, ultimately generating an enhanced display frame stream. In the adaptive segmentation scenario of the lesion area in seminal vesiculoscopic images, real-time correction frame stream generation ensures geometric alignment between the real-time frame and the training data, continuous boundary model mapping achieves dynamic adjustment of the boundary model through pose matching, and seamless lesion mask superposition provides intuitive visualization through projection and pseudo-color highlighting. These sub-steps together ensure the spatial consistency and boundary continuity of the lesion contour during dynamic navigation, provide real-time, accurate quantitative guidance for the biopsy needle approach and energy knife trajectory, and significantly improve the reliability and accuracy of clinical operations.
[0149] Example 2: Figure 2 The invention provides a lesion area adaptive segmentation system for seminal vesiculoscopic images, comprising a data acquisition module, a posture correction module, a feature fusion module, a segmentation optimization module and a real-time superposition module.
[0150] Data acquisition module: The acquisition end synchronously obtains thick-layer cross-sectional frames and pose matrices, and writes the frame sequence together with the sequence number-pose mapping table into the cache.
[0151] Posture correction module: Infer the cross-section tilt angle based on the pose matrix, construct an affine correction operator, align the coordinate system of each frame to the cross-section reference plane, and output a corrected frame sequence.
[0152] Feature fusion module: Extracts two key geometric features reflecting layer-wise scale imbalance and contour continuity from the corrected frame sequence, and fuses the feature results to form a comprehensive consistency index. When the index meets the standard, block anisotropic compensation resampling is performed; otherwise, cubic spline resampling is performed to output an isotropic volume data stack.
[0153] Segmentation optimization module: Slice smoothing regularization is applied to the isotropic volume data stack, and the surface normal similarity and curvature penalty strategy are combined to fine-tune the lesion segmentation network to generate a continuous boundary model.
[0154] Real-time overlay module: The continuous boundary model is applied to the real-time correction frame stream, and the seamless lesion mask is superimposed on the display channel according to the sequence number-pose mapping table.
[0155] The above formulas are all dimensionless and numerical calculations. The formulas are obtained by collecting a large amount of data and performing software simulation to obtain the most recent real situation. The preset parameters in the formulas are set by technicians in this field according to actual conditions.
[0156] It should be noted that the system of the present invention can be deployed on the device itself to realize embedded applications, and can also be run on a PC or other terminal with a user interface, thereby meeting a variety of hardware environments and usage requirements.
[0157] The above description is merely illustrative of certain exemplary embodiments of the present invention. It goes without saying that those skilled in the art will be able to modify the described embodiments in various ways without departing from the spirit and scope of the present invention. Therefore, the above drawings and description are illustrative in nature and should not be construed as limiting the scope of protection of the claims.
[0158] It should be noted that, in this document, if there are relational terms such as first and second, etc., they are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprises", "includes" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article or device. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device that includes the element.
[0159] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. An adaptive segmentation method for lesion areas in seminal vesiculoscopic images, characterized in that: Including steps: S1: The acquisition end synchronously obtains thick-slice cross-sectional frames and pose matrices, and writes the frame sequence together with the sequence number-pose mapping table into the cache; S2: Inversely infer the cross-section tilt angle based on the pose matrix, construct an affine correction operator, align the coordinate system of each frame to the cross-section reference plane, and output the correction frame sequence; S3: Extract two key geometric features reflecting slice-wise scale imbalance and contour continuity from the corrected frame sequence, and fuse the feature results to form a comprehensive consistency index. When the index meets the standard, perform block anisotropic compensation resampling; otherwise, perform cubic spline resampling and output an isotropic volume data stack. S4: Slice smoothing regularization is applied to the isotropic volume data stack, and the surface normal similarity and curvature penalty strategy are combined to fine-tune the lesion segmentation network to generate a continuous boundary model; Step S4 includes the following contents: A Gaussian smoothing filter is applied to each slice of the isotropic volume data stack along the depth direction, and the smooth regularization loss of the accumulated second-order rate of change is calculated. The smooth regularized 3D volume data is generated by gradient descent. The smooth regularized 3D volume data is input into the pre-trained lesion segmentation network to generate an initial segmentation mask. The lesion boundary surface is extracted, and the normal vector similarity and the square accumulation of the local curvature of adjacent point pairs are calculated. The normal similarity loss and curvature penalty loss are defined and weightedly combined with the cross-entropy loss. The lesion segmentation network is fine-tuned by gradient descent to generate an optimized segmentation mask. The optimized segmentation mask is subjected to the isosurface extraction algorithm to generate a triangular mesh model. The continuous boundary model is generated by optimizing the normal consistency loss by Laplace smoothing and the accumulation of the complement of the dot product of the normal vectors of adjacent patches. S5: Apply the continuous boundary model to the real-time correction frame stream, and superimpose the non-fracture lesion mask on the display channel according to the sequence number-pose mapping table.
2. The method for adaptive segmentation of lesion areas based on seminal vesiculoscopic images according to claim 1, characterized in that: Step S1 includes the following contents: The acquisition end synchronously acquires video frames and their corresponding pose matrices through thick-layer cross-sectional sampling. The video frames are cross-sectional images captured at different positions when the lens advances along the long axis of the seminal vesicle during seminal vesiculoscopy, and the pose matrix describes the position and orientation of the lens in three-dimensional space. The video frames are bound to the pose matrix through timestamp matching to ensure their temporal consistency. The video frames are arranged into a frame sequence in the order of acquisition, and a unique serial number is assigned to each frame. A serial number-pose mapping table in the form of key-value pairs of serial numbers and pose matrices is constructed. The frame sequence and the serial number-pose mapping table are stored in the cache.
3. The method for adaptive segmentation of lesion areas based on seminal vesiculoscopic images according to claim 2, characterized in that: Step S2 includes the following contents: The rotation matrix of each frame is extracted according to the pose matrix in the serial number-pose mapping table, and the angle between the lens optical axis direction vector and the global longitudinal axis direction vector is calculated to determine the cross-sectional tilt angle; an affine correction operator is constructed according to the cross-sectional tilt angle, and the cross-sectional direction is corrected by the rotation matrix and the translation vector is retained to maintain the spatial position; the affine correction operator is applied to each frame in the frame sequence for coordinate transformation, and bilinear interpolation is used to calculate the pixel values of the corrected image to generate a spatially consistent corrected frame sequence.
4. The method for adaptive segmentation of lesion areas based on seminal vesiculoscopic images according to claim 3, characterized in that: Step S3 includes the following contents: Key geometric features include the global layer-wise anisotropic gradient difference and the global curvature continuity deviation. The global layer-wise anisotropic gradient difference and the global curvature continuity deviation are normalized and fused into a comprehensive consistency index. Finally, based on the comparison between the comprehensive consistency index and the standard threshold, conventional cubic spline resampling or block anisotropic compensation resampling is adaptively selected to generate an isotropic volume data stack.
5. The method for adaptive segmentation of lesion areas based on seminal vesiculoscopic images according to claim 4, characterized in that: Step S3 also includes the following: For adjacent frames in the correction frame sequence, the layer-wise gradient is calculated by dividing the pixel value difference by the physical spacing between layers and normalized. At the same time, the in-plane gradient amplitude is calculated for each frame and normalized. Then, the logarithm of the ratio of the layer-wise gradient to the in-plane gradient amplitude is calculated as the layer-wise anisotropic gradient difference, and the average value of all adjacent frame pairs is taken to generate the global layer-wise anisotropic gradient difference.
6. The method for adaptive segmentation of lesion areas based on seminal vesiculoscopic images according to claim 4, characterized in that: Step S3 also Includes the following: The contour points of each frame are extracted through edge detection and the local curvature is calculated. The contour point pairs of adjacent frames are matched and the exponential average of the curvature difference is calculated as the curvature continuity deviation. The average value of all adjacent frame pairs is taken to generate the global curvature continuity deviation.
7. The method for adaptively segmenting lesion areas based on seminal vesiculoscopic images according to claim 1, characterized in that: Step S4 includes the following contents: The second-order rate of change is the acceleration rate of spatial change calculated by the difference between adjacent pixel values.
8. The method for adaptive segmentation of lesion areas based on seminal vesiculoscopic images according to claim 1, characterized in that: Step S5 includes the following contents: For each frame in the thick-layer cross-sectional frame stream acquired in real time, the pose matrix is synchronously obtained and the cross-sectional tilt angle is calculated. A real-time affine correction operator is constructed to align the real-time frame to the cross-sectional reference plane to generate a real-time correction frame stream. According to the spatial difference between the pose matrix of the real-time correction frame stream and the pose matrix of the training data recorded in the serial number-pose mapping table, the closest training frame is matched, the relative pose transformation is calculated, and the vertex set of the continuous boundary model is applied with the relative pose transformation to generate a real-time boundary model. The real-time boundary model is projected onto a two-dimensional plane and filled to generate a lesion mask. The lesion mask is superimposed on the real-time correction frame to generate an enhanced display frame and sent to the display channel.
9. A system for adaptively segmenting lesion areas in seminal vesiculoscopic images, for implementing the method for adaptively segmenting lesion areas in seminal vesiculoscopic images according to any one of claims 1 to 8, characterized in that: include: Data acquisition module, posture correction module, feature fusion module, segmentation optimization module and real-time superposition module; Data acquisition module: The acquisition end synchronously obtains thick-slice cross-sectional frames and pose matrices, and writes the frame sequence together with the sequence number-pose mapping table into the cache; Posture correction module: infers the cross-section tilt angle based on the pose matrix, constructs an affine correction operator, aligns the coordinate system of each frame to the cross-section reference plane, and outputs a corrected frame sequence; Feature fusion module: Extracts two key geometric features reflecting slice-wise scale imbalance and contour continuity from the corrected frame sequence, fuses the feature results to form a comprehensive consistency index. When the index meets the standard, it performs block anisotropic compensation resampling; otherwise, it performs cubic spline resampling and outputs an isotropic volume data stack. Segmentation Optimization Module: This module applies slice smoothing regularization to the isotropic volume data stack, combines surface normal similarity with curvature penalty strategy to fine-tune the lesion segmentation network, and generates a continuous boundary model. Real-time overlay module: The continuous boundary model is applied to the real-time correction frame stream, and the seamless lesion mask is superimposed on the display channel according to the sequence number-pose mapping table.
Citation Information
Patent Citations
Image segmentation method, computer equipment and storage medium
CN113487536A
Lung medical CT (Computed Tomography) image segmentation and classification device and equipment
CN116703901A