A virtual positioning system based on parapelvic cyst and storage medium
By constructing a three-dimensional map of the urinary system and identifying the mask of the renal pelvis wall, cysts, and structures contraindicated for surgery, the projection distance and virtual surgical positioning were calculated, solving the problem of inaccurate positioning in parapelvic cyst surgery and achieving automation and precision in surgical planning.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HANGZHOU THIRD PEOPLES HOSPITAL (HANGZHOU HUIMIN HOSPITAL HANGZHOU THIRD AFFILIATED HOSPITAL OF ZHEJIANG UNIV OF TRADITIONAL CHINESE MEDICINE)
- Filing Date
- 2026-05-09
- Publication Date
- 2026-06-26
Smart Images

Figure CN122289253A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of medical image processing technology, specifically a virtual positioning system and storage medium for para-renal pelvis cysts. Background Technology
[0002] Parapelvic cysts are cystic lesions located close to the renal pelvis or renal sinus. Their deep location and close relationship with the renal pelvis wall, renal parenchyma, and renal vascular plexus are significant factors. Ureteroscopic incision and drainage of parapelvic cysts has become a mainstream minimally invasive procedure, but its core bottleneck lies in the extreme difficulty of intraoperative endoscopic localization. Due to the clear cyst fluid, the cyst wall is difficult to distinguish from the normal renal pelvis mucosa under the microscope, making it impossible for the surgeon to accurately determine the incision boundaries.
[0003] Currently, while preoperative planning can visualize anatomical structures using 3D reconstruction technology from CT / MRI images, this only solves the problem of "seeing" the anatomical structures and fails to address the decision-making challenge of "how to cut." Existing systems generally lack the ability to automatically and accurately map and convert key information such as cysts and blood vessels in 3D space into quantitative, executable incision plans on the renal pelvis wall (surgical operating surface). Surgical planning still heavily relies on manual measurements and experience-based sketching by surgeons on 3D models, a cumbersome and subjective process that cannot provide precise guidance on incision location and extent in real time during surgery.
[0004] Therefore, there is an urgent clinical need for a method that can go beyond basic three-dimensional visualization and achieve automatic intelligent planning of the incision location from three-dimensional anatomical information to the microscopic incision location, in order to overcome the fundamental problem of microscopic localization of peripelvic cysts. Summary of the Invention
[0005] To address the shortcomings of existing technologies, this invention provides a virtual positioning system and storage medium for parapelvic cysts, which solves the problem of inaccurate surgical positioning of parapelvic cysts in existing technologies.
[0006] To achieve the above objectives, one aspect of the present invention provides a computer-readable storage medium storing a computer program, the computer program including program instructions that, when executed by a processor, cause the processor to perform the following steps: acquiring enhanced urography images of a patient with a peripelvic cyst and constructing a three-dimensional urinary system map based on the enhanced urography images; identifying a renal pelvis wall mask, a cyst mask, and a surgically contraindicated structure mask in the three-dimensional urinary system map; obtaining a cyst location area and a contraindicated surgical area based on the cyst mask, the surgically contraindicated structure mask, and the renal pelvis wall mask; obtaining candidate surgical areas based on the cyst location area and the contraindicated surgical area, and calculating the projection distance from each voxel of the candidate surgical area to the cyst mask; and determining the virtual surgical location based on the projection distance and the candidate surgical areas.
[0007] This invention acquires enhanced urography images of patients with peripelvic cysts and constructs a three-dimensional urinary system map, intuitively presenting the three-dimensional relationships of tissue structures and solving the problem of ambiguous anatomical localization under endoscopy. By identifying three types of masks—the renal pelvis wall, the cyst, and structures contraindicated for surgery—it accurately distinguishes key structures and risk areas, reducing the probability of misjudgment. By deriving the cyst location area and contraindicated surgical area, screening candidate surgical areas, and calculating voxel projection distances, it clarifies the safe operating range and incision depth. Based on the projection distance, it optimizes the virtual surgical localization, achieving quantitative adaptation of incision position and length. This approach transforms three-dimensional anatomical information into precise, actionable intraoperative localization guidance, reducing reliance on human experience and improving the accuracy of surgical localization.
[0008] Optionally, identifying the renal pelvis wall mask, cyst mask, and surgical contraindication structure mask in the three-dimensional urinary system diagram includes: constructing a urinary system tissue structure recognition model; and inputting the three-dimensional urinary system diagram into the urinary system tissue structure recognition model to obtain the renal pelvis wall mask, cyst mask, and surgical contraindication structure mask.
[0009] This invention constructs a dedicated urinary system tissue structure recognition model and inputs a three-dimensional urinary system diagram into the model to achieve automated recognition of renal pelvis wall masks, cyst masks, and surgically contraindicated structure masks. This avoids the subjectivity and tediousness of manual annotation, improving the efficiency of mask recognition. The model is designed specifically for the anatomical characteristics of the peripelvic region and can accurately distinguish three types of key structures, reducing structural confusion and misidentification, and improving the accuracy of mask recognition. It eliminates the need for doctors to manually outline the structures, reducing reliance on clinical experience and making mask acquisition more convenient and standardized, thus improving the accuracy of renal pelvis wall masks, cyst masks, and surgically contraindicated structure masks.
[0010] Optionally, the construction of the urinary system tissue structure recognition model includes: constructing tissue structure recognition constraints based on pre-acquired prior anatomical knowledge of the peripelvic region of the kidney; constructing a basic loss function using Descein loss and cross-entropy loss; constructing an optimized loss function based on the basic loss function and the tissue structure recognition constraints; and constructing the urinary system tissue structure recognition model based on the loss function.
[0011] This invention constructs tissue structure recognition constraints by combining prior anatomical knowledge of the renal peripelvic region to avoid model outputs of segmentation results that do not conform to anatomical rules, thus ensuring the clinical rationality of the mask. A basic loss function is constructed by using Descein loss and cross-entropy loss to balance the overlap of segmented regions and the accuracy of voxel classification, solving the problem of imbalanced categories in medical images. An optimized loss function is constructed based on the basic loss function and constraints to balance segmentation accuracy and anatomical rationality. Finally, a urinary system tissue structure recognition model is constructed based on this optimized loss function, improving the inference accuracy of the urinary system tissue structure recognition model.
[0012] Optionally, obtaining the cyst location area and the contraindicated surgical structure area based on the cyst mask, the surgical contraindication structure mask, and the renal pelvis wall mask includes: determining the projection direction based on the cyst mask and the renal pelvis wall mask; projecting the cyst mask onto the surface of the renal pelvis wall mask based on the projection direction to obtain the cyst location area; filtering the surgical contraindication structure mask based on the cyst mask and the renal pelvis wall mask to obtain a valid mask to be projected; and projecting the valid mask to be projected onto the surface of the renal pelvis wall mask based on the projection direction to obtain the contraindicated surgical area.
[0013] This invention determines the projection direction based on cyst masks and renal pelvis wall masks, locking in the shortest surgical path and improving the targeting accuracy. Based on this direction, the cyst mask is projected onto the surface of the renal pelvis wall to obtain the cyst location area, accurately marking the surgical target range and avoiding positioning deviations. Based on the two types of masks, contraindicated structures are screened to obtain effective projection masks, eliminating irrelevant structural interference and ensuring the accuracy of risk assessment. Then, the effective projection masks are projected along the projection direction to obtain the forbidden zone, clearly defining the boundary of the danger area, thus improving the rationality and scientific nature of the cyst location area and the forbidden zone.
[0014] Optionally, determining the projection direction based on the cyst mask and the renal pelvis wall mask includes: calculating a first shortest distance from the cyst mask to the renal pelvis wall mask; and obtaining the projection direction based on the first shortest distance.
[0015] This invention calculates the first shortest distance from the cyst mask to the renal pelvis inner wall mask, locks the closest spatial association between the two types of structures, eliminates redundant path interference, improves the targeting of the direction determination, and then obtains the projection direction based on the first shortest distance, so that the projection direction accurately matches the shortest surgical path in anatomy, thereby improving the rationality and scientific nature of the projection direction.
[0016] Optionally, determining the virtual positioning of the incision based on the projection distance and the candidate surgical area includes: calculating the incision cost value based on each voxel of the candidate surgical area with the projection distance as the voxel; obtaining the blade length; and determining the virtual positioning of the incision based on the incision cost value and the blade length using the candidate surgical area.
[0017] This invention calculates the surgical cost for each voxel in the candidate surgical area based on the projection distance, comprehensively quantifying surgical risks and operational difficulties, avoiding the one-sidedness of judging by a single indicator. By combining cyst size and surgical instrument limitations to obtain a suitable incision length, it ensures that the positioning scheme meets the requirements of clinical practice. Then, based on the surgical cost and incision length, the optimal area is selected from the candidate surgical areas to achieve a precise match between the incision position and length, thus improving the scientificity and accuracy of virtual surgical positioning.
[0018] Optionally, the step of calculating the surgical cost value based on the projection distance for each voxel of the candidate surgical area includes: calculating the second shortest distance from each voxel of the candidate surgical area to the prohibited surgical area; calculating the surgical risk cost value based on the second shortest distance for each voxel of the candidate surgical area; calculating the surgical depth cost value based on the projection distance for each voxel of the candidate surgical area; and fusing the surgical risk cost value and the surgical depth cost value to obtain the surgical cost value.
[0019] This invention calculates the second shortest distance from each voxel in the candidate surgical area to the prohibited surgical area, accurately quantifying the spatial correlation between voxels and risk areas, providing reliable data for risk assessment. Based on this second shortest distance, the invention calculates the surgical risk cost value, intuitively reflecting the surgical safety level at different locations and reducing the probability of damaging contraindicated structures. Based on the projected distance, the invention calculates the surgical depth cost value, quantifying the difficulty of surgical operation and helping to avoid the risk of excessively deep incisions. Finally, the invention integrates the two types of cost values to obtain a comprehensive surgical cost value, improving the scientific validity and rationality of the surgical cost value.
[0020] Optionally, determining the virtual positioning of the incision based on the incision cost and the blade length using the candidate surgical area includes: setting an initial cost threshold based on the incision cost; filtering the candidate surgical areas based on the initial cost threshold to obtain a filtered region; performing three-dimensional connectivity analysis on the filtered region to obtain the maximum connected region after filtering; calculating the maximum geometric span based on the maximum connected region after filtering; comparing the maximum geometric span with the blade length, and adjusting the initial cost threshold based on the comparison result using a binary search method to obtain an adjusted cost threshold; iterating based on the adjusted cost threshold until a pre-set convergence condition is met to obtain the virtual positioning of the incision.
[0021] This invention provides an objective benchmark for screening candidate surgical areas by setting an initial cost threshold based on the cost of surgery, avoiding subjective judgment bias. Based on this threshold, low-cost screening areas are obtained, focusing on a range of high-quality surgical candidates. Three-dimensional connectivity analysis is used to extract the largest connected region, ensuring the continuity and operability of the surgical area. The maximum geometric span is calculated and compared with the incision length to ensure that the positioning is adapted to clinical operational needs. A binary search method is used to dynamically adjust the cost threshold, precisely balancing surgical safety and incision size adaptability. Iteration continues until convergence conditions are met to determine the virtual surgical positioning, thus optimizing the solution. Finally, this systematic and quantitative iterative screening process significantly improves the accuracy, adaptability, and reliability of virtual surgical positioning.
[0022] Optionally, setting the initial cost threshold based on the surgical cost value includes: extracting the maximum and minimum values from the surgical cost value; and calculating the average of the maximum and minimum values to obtain the initial cost threshold.
[0023] This invention extracts the maximum and minimum values of the surgical cost to clarify the complete distribution range of the cost, providing objective data support for threshold setting and avoiding subjective experience bias. Then, it calculates the average of the maximum and minimum values as the initial cost threshold, realizing adaptive generation of the threshold without relying on external parameter adjustments, thus improving the rationality of the initial cost threshold.
[0024] Another aspect of the present invention provides a virtual positioning system for parapelvic cysts, including an input device, a processor, an output device, and a memory, wherein the input device, processor, output device, and memory are interconnected, the memory includes the computer-readable storage medium described in the preceding aspect of the present invention, the memory is used to store a computer program, the computer program includes program instructions, and the processor is configured to invoke the program instructions.
[0025] The present invention provides a virtual positioning system for parapelvic cysts, which is compact, stable, highly integrated, and simple in construction. It can stably execute the steps of the program instructions in the computer-readable storage medium provided in the preceding aspect of the present invention, thereby further improving the overall applicability and practical application capability of the present invention. Attached Figure Description
[0026] Figure 1 This is a flowchart of program instructions in a computer-readable storage medium according to an embodiment of the present invention; Figure 2 This is a schematic diagram of a virtual positioning system for parapelvic cysts according to an embodiment of the present invention. Detailed Implementation
[0027] Specific embodiments of the present invention will now be described in detail. It should be noted that the embodiments described herein are for illustrative purposes only and are not intended to limit the invention. In the following description, numerous specific details are set forth in order to provide a thorough understanding of the invention. However, it will be apparent to those skilled in the art that these specific details are not necessary to practice the invention. In other instances, well-known circuits, software, or methods have not been specifically described to avoid obscuring the invention.
[0028] Throughout this specification, references to "an embodiment," "an embodiment," "an example," or "an example" mean that a particular feature, structure, or characteristic described in connection with that embodiment or example is included in at least one embodiment of the invention. Therefore, the phrases "in an embodiment," "in an embodiment," "an example," or "an example" appearing in various places throughout the specification do not necessarily refer to the same embodiment or example. Furthermore, specific features, structures, or characteristics can be combined in one or more embodiments or examples in any suitable combination and / or sub-combination. Moreover, those skilled in the art will understand that the illustrations provided herein are for illustrative purposes and are not necessarily drawn to scale.
[0029] Please see Figure 1 In one embodiment of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing a computer program, the computer program including program instructions, which, when executed by a processor, cause the processor to perform the following steps: Step S1: Obtain enhanced urography images of patients with peripelvic cysts, and construct a three-dimensional urinary system diagram based on the enhanced urography images.
[0030] In this embodiment, a multi-phase contrast-enhanced urography CT tomographic image sequence of a patient with a peripelvic cyst is acquired using a clinical CT scanning device. First, the original CT tomographic images are preprocessed using ITK-SNAP software. The software's median filtering module removes scanning noise, and a linear interpolation algorithm corrects for inconsistencies in slice spacing. Gray-scale standardization is performed based on the HU value (Henness units) of the CT images to highlight density differences in tissue structures such as the kidney, renal pelvis, cyst, and blood vessels. Subsequently, the preprocessed two-dimensional tomographic image sequence is precisely aligned according to the axial spatial position of the CT scan to form contrast-enhanced urography images. To ensure the continuity of anatomical structures at each level, the three-dimensional reconstruction module of Mimics software (Mimics is a powerful interactive medical image processing and three-dimensional reconstruction software) was used. Based on the HU value threshold range of different tissue structures (such as the HU value of the renal pelvis wall of about 20-40, the HU value of cysts of about 0-10, and the HU value of blood vessels of about 100-150), the two-dimensional CT tomographic image sequence was reconstructed into a three-dimensional model containing the renal pelvis, renal parenchyma, cysts and surrounding structures contraindicated for surgery, i.e., a three-dimensional urinary system map. This model can clearly present the spatial location, morphology and adjacent relationships of each tissue structure.
[0031] Step S2: Identify the renal pelvis wall mask, cyst mask, and surgically contraindicated structure mask in the three-dimensional urinary system map.
[0032] The identification of the renal pelvis wall mask, cyst mask, and surgically contraindicated structure mask in the three-dimensional urinary system diagram specifically includes the following sub-steps: Step S201: Construct a urinary system tissue structure recognition model.
[0033] The construction of the urinary system tissue structure recognition model specifically includes the following sub-steps: Step S20101: Construct tissue structure recognition constraints based on prior knowledge of the anatomical anatomy of the peripelvic region of the kidney.
[0034] In this embodiment, tissue structure recognition constraints are constructed based on prior anatomical knowledge of the peripelvic region of the kidney. This prior anatomical knowledge stems from the medical consensus on the inherent anatomical relationships of the peripelvic region of the kidney, specifically including: the renal pelvis lumen is anatomically a single continuous cavity, therefore its corresponding mask should remain connected and not broken into multiple isolated parts; the renal pelvis wall, cysts, and surgically contraindicated structures (such as blood vessels and renal parenchyma) are mutually exclusive independent anatomical entities in three-dimensional space (except for capillaries, as capillaries have little impact on surgery and cannot be avoided during surgery), and there should be no voxel overlap between them. This knowledge is formalized into constraints, which, by penalizing "non-single connected regions of the renal pelvis wall mask" and "voxel overlap between various types of masks," guide the model to output segmentation results that conform to both image features and anatomical rationality, thereby improving the clinical credibility and usability of the segmentation results.
[0035] Organizational structure identification constraints satisfy the following formula: in, Identify constraints for the organizational structure. For the first Each sample is predicted to be a set of voxels representing a mask of the renal pelvis wall. The number of training samples. This represents the number of connected regions. For the first Each sample is predicted to be a set of voxels representing a cyst region. For the first Each sample is predicted to be a set of voxels representing a surgically forbidden structure mask region. Let be the cardinality of the set.
[0036] The above formula consists of the addition of two terms, and its design logic closely follows the anatomical priors of the renal pelvis. The first term... As a connectivity penalty term, the absolute deviation of the number of connected regions in the renal pelvis wall mask from 1 (a single continuous cavity) directly forces the model to learn its key topological structure. The second term (overlap ratio score) serves as a mutual exclusion penalty term, calculating and penalizing the voxel overlap ratio between the three types of masks: renal pelvis wall, cysts, and surgically contraindicated structures, strictly adhering to the principle of mutual exclusion of different anatomical entities in space. Although the two terms have different mathematical meanings (the former is the counting bias, and the latter is the normalized ratio), their combination has clear clinical and optimization rationality: on the one hand, both terms serve the unified goal of outputting an anatomically reasonable mask, and are co-optimized through gradient descent during training. The final clinical effectiveness is a reflection of the combined effect of the two terms. On the other hand, the numerical scales of the two terms are coordinated in practice. The abnormal number of connected regions (usually small integers of 0, 2, and 3) and the voxel overlap ratio (range [0,1]) are on comparable orders of magnitude in typical error scenarios, allowing the summed constraint value to reflect the two types of anatomical errors in a balanced and sensitive manner. The core advantage of this formula lies in its transformation of the two key clinical rules—that the segments must be singly connected and must not overlap—into explicit mathematical expressions. This allows anatomical priors to serve as strong constraint signals that directly guide model training, thereby ensuring that the segmentation results are not only accurate but also highly physiologically sound and directly usable for surgical planning.
[0037] Step S20102: Construct the basic loss function using Dess loss and cross-entropy loss.
[0038] In this embodiment, a hybrid loss function strategy combining conventional Dice loss and cross-entropy loss is adopted to construct the base loss function for tissue structure segmentation. Dice loss focuses on optimizing the overlap between the predicted segmented region and the ground truth annotation; a lower Dice value indicates a higher degree of matching between the segmented contour and the region area, making it particularly suitable for handling the common class imbalance problem in medical images. Cross-entropy loss, on the other hand, focuses on the accuracy of the classification prediction for each voxel, effectively driving the model to learn the correct pixel-level class probability distribution. The two are then weighted and fused to form the base loss function. Its expression is ,in, and To adjust the weights.
[0039] Step S20103: Construct an optimized loss function based on the basic loss function and the organizational structure identification constraint.
[0040] In this embodiment, the optimized loss function is constructed by weighted fusion of the basic loss function and anatomical constraint terms. The core principle is to constrain the model prediction results through prior anatomical knowledge, avoiding segmentation errors that do not conform to the anatomical structure of the peripelvic region of the kidney. Its expression is: ,in As the basic loss function, it is responsible for ensuring both voxel classification accuracy and region overlap. To identify constraints for tissue structures, the model is forced to output a mask that conforms to anatomical rules by penalizing cases where the renal pelvis wall mask is not a single connected domain and where masks of different structures overlap. The constraint weight hyperparameter (example value 0.2, dynamically adjusted based on the degree of anatomical constraint satisfaction during training) is used to balance segmentation accuracy and anatomical rationality. This optimized loss function retains the ability of the basic loss function to optimize segmentation details while avoiding structural misalignment problems commonly found in medical image segmentation through anatomical constraint terms.
[0041] Step S20104: Construct a urinary system tissue structure recognition model based on the loss function.
[0042] In this embodiment, a urinary system tissue structure recognition model is constructed based on a 3D U-Net network. The model has 1 input channel to adapt to CT single-modal enhanced urography images, and 4 output channels (corresponding to semantic segmentation channels), representing four segmentation targets: background, renal pelvis wall, cysts, and structures contraindicated for surgery. The encoder-decoder structure is configured with 4 levels of downsampling and upsampling, with an initial feature map count of 32. Each encoding block contains two 3×3×3 3D convolutional layers, followed by a ReLU activation function and a batch normalization layer to ensure the stability and effectiveness of feature extraction. The training data is generated by experienced radiologists through voxel-level annotation on 3D urinary system maps: the renal pelvis wall and cyst areas are fully delineated; for structures contraindicated for surgery, the renal parenchyma, renal hilum, and visible blood vessels with a diameter of not less than 1 mm are highlighted (this diameter threshold is set based on clinical surgical safety experience to filter out small blood vessel branches that have little impact on surgical planning, allowing the model to focus more on key risk structures). The model uses the optimized loss function that incorporates the tissue structure recognition constraint as the training objective, employs the Adam optimizer, has an initial learning rate of 1e-4, and uses a dynamic learning rate decay strategy (e.g., if the segmentation accuracy on the validation set does not improve for 5 consecutive rounds, the learning rate is decayed to 1 / 10 of the original value) for end-to-end training. During training, three-dimensional data augmentation techniques (such as random rotation, translation, brightness perturbation, and voxel-level noise addition) are introduced to improve the model's generalization ability. After the training converges, a urinary system tissue structure recognition model that can simultaneously and accurately segment the three-dimensional masks of the above three types of target structures is obtained.
[0043] Step S202: Input the three-dimensional urinary system diagram into the urinary system tissue structure recognition model to obtain the renal pelvis wall mask, cyst mask, and surgical contraindication structure mask.
[0044] In this embodiment, a three-dimensional urinary system image is input into a urinary system tissue structure recognition model for forward inference. Based on its learned features, the model calculates in parallel the probability of each voxel in the image belonging to one of four categories: background, renal pelvis wall, cyst, and surgically contraindicated structures, and outputs the corresponding four-channel three-dimensional probability map. By selecting the category with the highest probability for each voxel, an initial semantic segmentation result is generated. Furthermore, three-dimensional connected component analysis is performed on voxels belonging to the surgically contraindicated structure category, and isolated regions with excessively small volumes (e.g., less than 10 voxels) are removed to filter out potential noise, forming the final surgically contraindicated structure mask. Simultaneously, voxels with probabilities higher than 0.5 in the corresponding channels are directly extracted to generate renal pelvis wall masks and cyst masks, respectively. The final output is a binary renal pelvis wall mask, cyst mask, and surgically contraindicated structure mask that correspond one-to-one with the spatial resolution of the input image.
[0045] Step S3: Obtain the cyst location area and the restricted surgical area based on the cyst mask, the surgical contraindication structure mask, and the renal pelvis inner wall mask.
[0046] The process of obtaining the cyst location area and the restricted surgical area based on the cyst mask, the surgically contraindicated structure mask, and the renal pelvis wall mask specifically includes the following sub-steps: Step S301: Determine the projection direction based on the cyst mask and the renal pelvis inner wall mask.
[0047] Determining the projection direction based on the cyst mask and the renal pelvis wall mask specifically includes the following sub-steps: Step S30101: Calculate the first shortest distance from the cyst mask to the renal pelvis inner wall mask.
[0048] In this embodiment, firstly, a three-dimensional morphological erosion operation (using a 3×3×3 cubic structuring element) is performed on the renal pelvis inner wall mask and the cyst mask respectively. Then, the difference between the original mask and the eroded mask is calculated to accurately extract the surface voxel set of the renal pelvis inner wall mask and the surface voxel set of the cyst mask. The distance calculation is focused on the surface of the two structures to avoid invalid calculations caused by internal voxels. Subsequently, the two types of extracted surface voxel sets are converted into three-dimensional point sets represented by three-dimensional image space physical coordinates. A KD-Tree spatial index is constructed for the three-dimensional point set of the cyst surface to improve the efficiency of nearest neighbor query. Then, the nearest point pair distance between the two surface point sets is calculated: the distance from each point in the renal pelvis inner wall surface point set to the nearest neighbor point in the cyst surface point set is quickly queried through KD-Tree. The global minimum value among all query results is determined as the first shortest distance. This method not only ensures the accuracy of distance calculation, but also significantly improves the computational efficiency through spatial indexing.
[0049] Step S30102: Obtain the projection direction based on the first shortest distance.
[0050] In this embodiment, the pair of closest points corresponding to the first shortest distance is the closest point located on the surface of the cyst. The closest point located on the inner wall surface of the renal pelvis Composition. Projection direction It should be defined as the direction from the cyst towards the inner wall of the renal pelvis, that is, from... point to The unit vector is calculated using the following formula: Anatomically, this direction represents the shortest penetration path from the renal pelvis to the cyst, and in surgical planning, it is the theoretical direction for instrument entry or incision.
[0051] Step S302: Based on the projection direction, the cyst mask is projected onto the surface of the renal pelvis inner wall mask to obtain the cyst location area.
[0052] In this embodiment, the cyst mask is first translated along the projection direction (from the cyst to the renal pelvis wall) to ensure its spatial extent covers the renal pelvis wall. Then, the three-dimensional Boolean intersection of the extended cyst mask's spatial extent and the voxels on the renal pelvis wall mask surface is directly calculated, yielding a series of voxels on the renal pelvis wall surface. These voxels constitute the initial projection point set. Finally, a morphological closing operation (e.g., dilation followed by erosion) is performed on the three-dimensional voxel adjacency relationships on the renal pelvis wall surface to fill any small voids within the projection area and smooth its boundaries, ultimately forming a complete and connected surface region, which serves as the cyst location area. This method achieves projection through geometrically intuitive extension and intersection operations, avoiding complex ray intersection calculations, and ensuring processing efficiency while meeting the accuracy requirements for surgical planning.
[0053] Step S303: Based on the cyst mask and the renal pelvis wall mask, the surgical contraindication structure mask is filtered to obtain an effective projection mask.
[0054] In this embodiment, the core logic of screening valid projection masks lies in retaining only those forbidden structures located within the surgical projection path space from the cyst to the renal pelvis wall. Specifically, taking the determined projection direction as the axis, the cyst mask is considered as a volume extending along that direction towards the renal pelvis wall surface. The three-dimensional space swept by this extension defines the theoretical instrument operation channel. During screening, each independent three-dimensional connected region in the surgical forbidden structure mask is judged: if the minimum coordinate value of the region along the projection direction is less than the maximum coordinate value of the renal pelvis wall surface in the same direction, it is considered to have an intersection and is retained; otherwise, the entire region is discarded. All retained forbidden structure regions together constitute the valid projection mask. This method ensures that the structures subsequently used to generate the forbidden area for projection are all key risk points that may actually obstruct the surgical path, avoiding interference from irrelevant structures.
[0055] Step S304: Based on the projection direction, the effective projection mask is projected onto the surface of the renal pelvis inner wall mask to obtain the knife-free zone.
[0056] In this embodiment, each independent three-dimensional connected region in the effective projection mask is first uniformly translated along the projection direction from the cyst to the renal pelvis wall to ensure that its spatial range covers the renal pelvis wall. Then, the three-dimensional Boolean intersection of the spatial range of each translated forbidden structure with the voxels on the surface of the renal pelvis wall mask is calculated to obtain multiple sets of projection voxels located on the surface of the renal pelvis wall. Next, all projection voxel sets are merged to form an initial forbidden zone voxel set, which may contain multiple unconnected components. Finally, for each independent connected component in this initial set, a morphological closing operation (e.g., dilation followed by erosion) is performed on the three-dimensional voxel adjacency relationship on the surface of the renal pelvis wall to smooth the boundaries of each component and fill any small voids that may exist inside. All connected components processed in this way together constitute the final forbidden zone. This method is consistent with the logic of generating cyst localization areas. Through efficient voxel space operations, the location information of key surgically contraindicated structures is mapped to the inner wall surface of the renal pelvis, thereby clearly identifying one or more dangerous areas that need to be avoided for surgical path planning.
[0057] Step S4: Based on the cyst location area and the prohibited scalpel area, obtain the candidate surgical area, and calculate the projection distance of each voxel of the candidate surgical area to the cyst mask.
[0058] In this embodiment, on the inner wall surface of the renal pelvis, the portion of the cyst location area that overlaps with the forbidden incision area is removed to obtain a candidate surgical area. The candidate surgical area is the difference between the cyst location area and the forbidden incision area on the inner wall surface of the renal pelvis, representing the initial area on the inner wall surface where a surgical incision can be considered and the forbidden structure is avoided. Then, the projection distance from each voxel in the candidate surgical area to the cyst mask is calculated. For each voxel in the candidate surgical area, a ray is emitted from the voxel in the opposite direction to the projection direction (i.e., from the inner wall of the renal pelvis towards the cyst). A three-dimensional ray casting algorithm is used to traverse the voxel space, and the intersection point where the ray first intersects the cyst mask is calculated. The Euclidean distance from the center point of the voxel to the center point of the intersection point is the projection distance. In this way, a projection distance value representing the depth to the cyst surface is calculated for each effective voxel in the candidate surgical area.
[0059] Step S5: Determine the virtual positioning of the incision based on the projection distance and the candidate moving blade area.
[0060] The determination of the virtual positioning for incision based on the projection distance and the candidate surgical area specifically includes the following sub-steps: Step S501: Calculate the cutting cost based on each voxel of the candidate cutting area with the projection distance as the value.
[0061] The calculation of the surgical cost based on each voxel of the candidate surgical area with the projection distance specifically includes the following sub-steps: Step S50101: Calculate the second shortest distance from each voxel of the candidate cutting area to the forbidden cutting area.
[0062] In this embodiment, for each voxel in the candidate moving blade area mask, the three-dimensional Euclidean distance from its three-dimensional spatial coordinates to all voxels in the forbidden blade area mask is calculated, and the minimum value among all these distances is taken. This minimum value is defined as the second shortest distance of the voxel.
[0063] To efficiently calculate the second shortest distance from each voxel in the candidate cutting area to the forbidden cutting area, an optimization method based on three-dimensional Euclidean distance transformation can be adopted. First, the forbidden cutting area mask is set as the target source point set for distance calculation. Then, a parallel three-dimensional Euclidean distance transformation algorithm (e.g., using the Danielsson algorithm or a fast and accurate vector propagation algorithm) is executed. This algorithm calculates the Euclidean distance from each voxel in space to the nearest source point in the forbidden cutting area through a finite number of image traversals, thus generating a global three-dimensional distance field map. Finally, for each voxel within the candidate cutting area, there is no need to repeat the distance search; the corresponding distance value is directly read from the three-dimensional distance field map based on its spatial coordinate index. This value is the required second shortest distance. This method transforms the problem of calculating numerous two-point distances for each voxel into a one-time global preprocessing and efficient table lookup operation, significantly reducing computational complexity while ensuring the accuracy of the results.
[0064] Step S50102: Calculate the surgical risk cost for each voxel of the candidate surgical area based on the second shortest distance.
[0065] In this embodiment, based on the principle that the closer to the restricted area, the higher the risk and the greater the cost, the second shortest distance is used to calculate the surgical risk cost for each voxel in the candidate surgical area. First, the maximum value of the second shortest distance among all voxels within the candidate surgical area is found. Then, for any voxel within this region, let its second shortest distance be... The normalized surgical risk value is calculated using the following formula. : This formula linearly normalizes the risk value of each voxel to... Interval. When the voxel is adjacent to the forbidden zone ( )hour, This indicates the highest risk of surgery, when the voxel is furthest from the prohibited area ( )hour, This represents the lowest risk of surgery. Thus, a risk quantification mapping consistent with intuition about surgical safety is obtained: the higher the value, the greater the geometric risk of damaging adjacent contraindicated structures when making an incision at that location.
[0066] Step S50103: Calculate the cutting depth cost based on the projection distance for each voxel of the candidate cutting area.
[0067] In this embodiment, based on the principle that the deeper the incision, the higher the surgical difficulty and potential risk, and the greater the corresponding cost, the incision depth cost is calculated for each voxel in the candidate surgical area using the projected distance. First, the maximum value among the projected distances corresponding to all voxels within the candidate surgical area is found. Then, for any voxel within this region, let its projected distance be... The normalized incision depth cost is calculated using the following formula. : This formula linearly normalizes the required cut depth for each voxel to... Interval. When the cut-in path corresponding to the voxel is the shortest ( )hour, This represents the lowest depth cost; when the entry path corresponding to the voxel is the longest ( )hour, This represents the highest cost in terms of depth. Therefore, a quantitative indicator that directly reflects the surgical incision depth is obtained.
[0068] Step S50104: The surgical risk value and the surgical depth value are fused to obtain the surgical cost value.
[0069] In this embodiment, the surgical risk cost value and the surgical depth cost value are fused to obtain the final surgical cost value. The fusion method is weighted summation. For a candidate voxel, its surgical risk cost value is... (The higher the value, the higher the risk), the cost of the incision depth is... (The larger the value, the greater the depth), then the cost of surgery is... The calculation formula is as follows: in, and These are the weighting coefficients for risk cost and depth cost, respectively, and they satisfy... Based on the principle that risk avoidance takes precedence over trauma reduction in clinical surgery, a procedure is usually designed... (For example This fusion formula generates a unified cost for each candidate voxel, taking into account both safety and operational difficulty. (Its value range also falls within) The larger the value (range), the higher the overall cost of surgical incision at that location. This value will serve as the core quantitative basis for determining the optimal surgical area.
[0070] Step S502: Obtain the blade length, and determine the virtual positioning of the cutting process based on the cutting cost and the blade length using the candidate moving blade area.
[0071] In this embodiment, the specific method for obtaining the incision length follows clinical surgical planning conventions, namely, it is determined based on the objective size of the target cyst and the physical limitations of the selected surgical instruments. First, the three-dimensional geometry of the cyst is calculated based on the cyst mask, and the longest diameter of the cyst in space is extracted as the basic reference length. Subsequently, considering the port size, degrees of freedom of operation, and boundaries reserved for safe operation of the endoscopic instruments or surgical tools to be used, the attending physician comprehensively evaluates and finally confirms a safe and operable actual incision length value in a three-dimensional visualization system. This length value is provided as a key input parameter to the subsequent automatic planning algorithm to filter out the size-matching and cost-optimal incision area within the candidate surgical area, thereby combining clinical experience with quantitative calculation to ensure the executability of the surgical plan.
[0072] Specifically, determining the virtual positioning of the cutting process based on the cutting cost and the blade length using the candidate moving blade area includes the following sub-steps: Step S50201: Set an initial cost threshold based on the surgical cost value.
[0073] The specific steps for setting the initial cost threshold based on the surgical cost value include the following: Step S5020101: Extract the maximum and minimum values from the surgical cost.
[0074] In this embodiment, the surgical cost value (a normalized comprehensive evaluation value obtained by fusing risk cost and depth cost) corresponding to all voxels within the candidate surgical area is traversed. The maximum value encountered is recorded and updated simultaneously during a single scan. and minimum value This operation provides a data range basis for subsequently setting the initial cost threshold.
[0075] Step S5020102: Calculate the average of the maximum value and the minimum value to obtain the initial cost threshold.
[0076] In this embodiment, the maximum value of the surgical cost is calculated. and minimum value The average value is used to obtain the initial cost threshold. ,Right now Using the average value as the initial threshold is a data-adaptive strategy that automatically determines the central benchmark based on the cost value range calculated from the patient's specific cysts and anatomical structure, without relying on external empirical parameters. This improves the algorithm's versatility and objectivity. Furthermore, considering the algorithm's convergence efficiency, setting the initial threshold at the midpoint of the cost value interval allows for the initial screening of candidate regions, roughly dividing the region into two parts with higher and lower costs. This provides a reasonable starting point for subsequent iterative adjustments based on binary search, helping to optimize the overall search process's convergence speed while maintaining screening accuracy.
[0077] Step S50202: Based on the initial cost threshold, the candidate cutting area is filtered to obtain the filtered area.
[0078] In this embodiment, each voxel within the candidate surgical area is traversed, and its corresponding surgical cost is determined. With the initial cost threshold If a comparison is made, If, then retain that voxel, if If the threshold is not met, the voxel is removed from the candidate region. After this threshold filtering operation, all the retained voxels together form a binary three-dimensional voxel set, called the filtered region. Geometrically, this region represents the set of all locations in the candidate surgical area with relatively low overall surgical costs (i.e., costs not exceeding the initial threshold). Its range is usually smaller than the original candidate surgical area, thus providing a more concentrated and high-quality candidate set for subsequent connectivity analysis.
[0079] Step S50203: Perform three-dimensional connectivity analysis on the filtered region to obtain the maximum connected region after filtering.
[0080] In this embodiment, a connected component labeling algorithm based on 26 neighborhoods (i.e., voxels are considered adjacent in 3D space by their faces, edges, and vertices) is used to traverse all voxels in the filtered region. Spatially connected voxels are assigned the same region label, thereby identifying all independent, unconnected sub-regions within the region. Subsequently, the number of voxels contained in each labeled connected region is counted, and the region with the most voxels is selected as the largest connected region after filtering. By extracting the candidate surgical region with the largest spatial scale and best continuity from the initially filtered regions with lower costs, a stable and coherent spatial foundation is provided for subsequent geometric span calculations and iterative adjustments.
[0081] Step S50204: Calculate the maximum geometric span based on the maximum connected component after filtering.
[0082] In this embodiment, the three-dimensional spatial coordinates of all voxels in the filtered maximum connected region are first extracted to form a three-dimensional point set. The goal is to quantify the spatial extent of this connected region, which essentially involves calculating the maximum Euclidean distance between any two points in the point set. To improve computational efficiency, the three-dimensional convex hull of the point set can be calculated first to significantly reduce the number of candidate point pairs whose distances need to be calculated. Then, based on the vertices of the convex hull, the maximum geometric span is obtained efficiently and accurately by calculating the Euclidean distances between all vertex pairs and taking the maximum value. This span value represents the maximum straight-line length of the current candidate cutting area in space, and is a key geometric indicator for evaluating whether it can accommodate a specified cutting edge length.
[0083] Step S50205: Compare the maximum geometric span with the blade length, and adjust the initial cost threshold using a binary search method based on the comparison result to obtain an adjusted cost threshold.
[0084] In this embodiment, the minimum cost value is used. and maximum value These are respectively used as the lower bound of the search interval. and upper limit and the initial cost threshold (i.e., the average of the two) is set as the current threshold. The maximum geometric span is thus calculated, and the maximum geometric span is then... With preset blade length Compare the results and update the search range accordingly: If Then set the current threshold as the upper limit of the new interval (i.e., let...). This is to attempt to find areas that meet the size requirements within a lower cost range. Then set the current threshold as the lower limit of the new interval (i.e., let...). This is to include areas that are more costly but potentially larger. After the interval is updated, the median of the new interval is used to calculate the new current threshold, i.e. Repeat the above filtering, comparison, and updating process until the maximum geometric span is reached. Meeting convergence conditions (in (This is the preset tolerance threshold), at which point the last iteration uses... This is the final adjustment cost threshold. This process efficiently determines the optimal cost boundary while satisfying the surgical incision size by systematically halving intervals and taking the midpoint of the threshold.
[0085] Step S50206: Iterate based on the adjusted cost threshold until the pre-set convergence condition is met to obtain the virtual positioning of the incision.
[0086] In this embodiment, after obtaining the desired result through binary search... The adjustment cost threshold for this convergence condition Then, using this threshold, a final screening is performed on the candidate surgical areas, retaining all surgical areas with a cost not exceeding [a certain threshold]. The voxels are used to form the final binary voxel set. Then, three-dimensional connectivity analysis is performed on the set, and the connected region with the most voxels is extracted as the largest connected region after screening. This region is a continuous, complete area on the inner wall surface of the renal pelvis with a spatial size adapted to the incision length. Its geometric center or the set of all voxels inside is defined as the final virtual incision location. This location result can be directly used in the surgical navigation system to provide doctors with intuitive and quantitative incision location guidance.
[0087] It's important to note that the method for determining the virtual surgical location based on cost threshold iteration relies on the fact that the surgical cost, determined by spatial proximity, is spatially continuous on the continuous anatomical surface of the renal pelvis wall. This means the cost between adjacent voxels does not undergo drastic, irrational jumps. This property stems from its computational basis: both the surgical risk cost and the surgical depth cost are calculated using geometric distances (the second shortest distance to the restricted surgical area and the projected distance to the cyst). In a real anatomical environment, the boundaries of key structures (such as blood vessels and cyst walls) are continuous and smooth. Therefore, the associated distance field and the resulting cost field are also spatially continuous and gradually changing. This aligns with basic clinical observation and spatial cognitive priors. Surgeons, when planning incisions, also assume that the anatomical risks and operational difficulties of the incision area change gradually, rather than undergoing random, drastic changes at the microscopic scale. The iterative screening process is built upon this anatomically accurate foundation. The continuity of the cost field ensures that the filtered regions selected by the threshold are spatially coherent, and small adjustments to the threshold only cause smooth changes in the region boundaries, rather than generating a large number of discrete, isolated noise points. This fundamentally ensures that the binary search method can stably and efficiently converge to a continuous region that is geometrically adapted to the incision length and relatively uniform and optimal in terms of cost value. As a result, the final determined virtual surgical location is not only computationally feasible, but also has a high degree of clinical rationality and reliability.
[0088] like Figure 2 As shown, in another aspect, the present invention also provides a virtual positioning system for parapelvic cysts, including an input device, a processor, an output device, and a memory, wherein the input device, processor, output device, and memory are interconnected, the memory includes the computer-readable storage medium described above, the memory is used to store a computer program, the computer program includes program instructions, and the processor is configured to call the program instructions.
[0089] In this embodiment, the input device is used to provide the system with relevant input data or instructions. In the virtual positioning system for parapelvic cysts, the input device may include common human-computer interaction interface devices such as keyboards, mice, and touchscreens. Through the input device, doctors or researchers can input necessary parameters.
[0090] The processor is the core component of the system, responsible for executing computer program instructions and performing data processing and analysis. In the virtual localization system for parapelvic cysts, the processor analyzes and interprets the input experimental data by running pre-programmed algorithms and models. The processor can be a central processing unit (CPU), a graphics processing unit (GPU), or other dedicated processing unit.
[0091] The memory is used to store computer programs, data, and parameters required by the system. It may include random access memory (RAM) for temporary data storage and processing, and persistent memory (such as hard disks or solid-state drives) for long-term data storage and preservation.
[0092] The output device is used to present the results of system processing and analysis to users or external devices. The output device can be a monitor, printer, charting device, etc. Through the output device, the system can display the prediction results, which can be used as a reference for doctors, researchers, or patients to assist in decision-making and communication.
[0093] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention, and they should all be covered within the scope of the claims and specification of the present invention.
Claims
1. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, the computer program including program instructions that, when executed by a processor, cause the processor to perform the following steps: Enhanced urography images of patients with peripelvic cysts were obtained, and a three-dimensional urinary system map was constructed based on the enhanced urography images; Identify the renal pelvis wall mask, cyst mask, and surgically contraindicated structure mask in the three-dimensional urinary system diagram; The cyst location area and the restricted surgical area are obtained based on the cyst mask, the surgical contraindication structure mask, and the renal pelvis inner wall mask; Candidate surgical areas are obtained based on the cyst localization area and the prohibited surgical area, and the projection distance from each voxel of the candidate surgical area to the cyst mask is calculated. The virtual positioning for incision is determined based on the projection distance and the candidate surgical area.
2. The computer-readable storage medium according to claim 1, characterized in that, The identification of renal pelvis wall masks, cyst masks, and surgically contraindicated structure masks in the three-dimensional urinary system map includes: Construct a tissue structure recognition model for the urinary system; The three-dimensional urinary system diagram is input into the urinary system tissue structure recognition model to obtain the renal pelvis wall mask, cyst mask, and surgical contraindication structure mask.
3. The computer-readable storage medium according to claim 2, characterized in that, The construction of the urinary system tissue structure recognition model includes: Based on prior knowledge of the anatomy of the peripelvic region of the kidney, construct tissue structure recognition constraints; Construct the basic loss function using Descein loss and cross-entropy loss; An optimized loss function is constructed based on the basic loss function and the organizational structure identification constraint. A urinary system tissue structure recognition model is constructed based on the loss function.
4. The computer-readable storage medium according to claim 1, characterized in that, The process of obtaining the cyst location area and the contraindicated surgical area based on the cyst mask, the surgically contraindicated structure mask, and the renal pelvis wall mask includes: The projection direction is determined based on the cyst mask and the renal pelvis inner wall mask; Based on the projection direction, the cyst mask is projected onto the surface of the renal pelvis inner wall mask to obtain the cyst location area; The effective projection mask is obtained by filtering the surgically contraindicated structure mask based on the cyst mask and the renal pelvis inner wall mask; Based on the projection direction, the effective projection mask is projected onto the surface of the renal pelvis inner wall mask to obtain the knife-free zone.
5. A computer-readable storage medium according to claim 4, characterized in that, Determining the projection direction based on the cyst mask and the renal pelvis wall mask includes: Calculate the first shortest distance from the cyst mask to the renal pelvis inner wall mask; The projection direction is obtained based on the first shortest distance.
6. The computer-readable storage medium according to claim 1, characterized in that, The step of determining the virtual positioning for incision based on the projection distance and the candidate surgical area includes: The surgical cost is calculated based on the projection distance for each voxel of the candidate surgical area; Obtain the blade length, and determine the virtual positioning of the cutting process based on the cutting cost and the blade length using the candidate moving blade area.
7. The computer-readable storage medium according to claim 6, characterized in that, The calculation of the surgical cost based on each voxel of the candidate surgical region with the projection distance includes: Calculate the second shortest distance from each voxel in the candidate cutting region to the forbidden cutting region; The surgical risk cost is calculated for each voxel of the candidate surgical area based on the second shortest distance; The cutting depth cost is calculated based on the projection distance for each voxel of the candidate cutting area; The surgical risk value and the surgical depth value are combined to obtain the surgical cost value.
8. The computer-readable storage medium according to claim 6, characterized in that, The step of determining the virtual positioning of the cutting process based on the cutting cost and the blade length using the candidate cutting area includes: Set an initial cost threshold based on the surgical cost; The candidate cutting area is filtered based on the initial cost threshold to obtain the filtered region; Perform three-dimensional connectivity analysis on the filtered region to obtain the maximum connected region after filtering; Calculate the maximum geometric span based on the maximum connected component after the filtering; The maximum geometric span is compared with the blade length, and the initial cost threshold is adjusted based on the comparison result using a binary search method to obtain the adjusted cost threshold; Based on the adjusted cost threshold, the process is iterated until the pre-set convergence condition is met to obtain the virtual positioning of the incision.
9. A computer-readable storage medium according to claim 8, characterized in that, The step of setting the initial cost threshold based on the surgical cost value includes: Extract the maximum and minimum values from the surgical cost; The initial cost threshold is obtained by averaging the maximum and minimum values.
10. A virtual positioning system for parapelvic cysts, characterized in that, The device includes an input device, a processor, an output device, and a memory, wherein the input device, processor, output device, and memory are interconnected, the memory includes a computer-readable storage medium as described in any one of claims 1 to 9, the memory is used to store a computer program, the computer program includes program instructions, and the processor is configured to invoke the program instructions.