Method and system for recording browsing track in panoramic image pyramid
By using a unified browsing trajectory data structure and global mapping variables, the problems of data format disorder and resource consumption for field of view, position and rotation angle under multiple magnification are solved, realizing low-complexity and high-stability browsing trajectory recording, improving operation smoothness and diagnostic efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANDONG LABOR VOCATIONAL & TECHN COLLEGE
- Filing Date
- 2025-12-26
- Publication Date
- 2026-05-01
AI Technical Summary
Existing technologies for recording browsing trajectories of field of view, position, and rotation angle at multiple magnifications suffer from problems such as data format corruption, high resource consumption, and high hardware performance consumption, resulting in unsmooth operation and low diagnostic efficiency.
By adopting a unified browsing trajectory data structure and global mapping variables, and configuring color association rules and image processing modules, grayscale, binarization, and colorization of images are achieved, reducing data maintenance complexity and optimizing hardware resource consumption.
It simplifies data management, reduces hardware resource consumption, improves operational fluency and diagnostic efficiency, lowers the performance requirements of computer hardware, and is adaptable to more clinical scenarios.
Smart Images

Figure CN121961827A_ABST
Abstract
Description
A method and system for recording browsing trajectories in a panoramic image pyramid Technical Field
[0001] This invention relates to the field of medical image processing technology, specifically to a method and system for recording browsing trajectories in a panoramic image pyramid. Background Technology
[0002] An image pyramid is a collection of images formed by progressively decreasing resolution from the original images at the bottom up; the higher the level, the smaller the image size and the lower the resolution. In the medical field, image pyramid technology is widely used for browsing, rotating, and magnifying medical images, enabling doctors to observe pathological images at different scales to locate lesions, and also assisting teachers and students in identifying and learning lesion characteristics in medical imaging education.
[0003] During image interpretation, doctors often need to switch between different fields of view at the same magnification, observe the same field of view at different magnifications, or perform comparative analysis by rotating images. Because medical images offer a rich field of view and detailed information, navigation maps are typically used to locate the current viewing position. Recording the browsing trajectory can help doctors trace back to key areas, improving diagnostic efficiency.
[0004] Existing technologies for recording field of view, position, and rotation angle at multiple magnifications have significant drawbacks: Firstly, each magnification requires a separate independent data structure containing the field of view range, position coordinates, and rotation angle. If N magnifications are supported, N sets of data need to be maintained, which is prone to formatting errors. Furthermore, complex boundary scenarios such as unsaved data, magnification anomalies, and multi-device compatibility need to be handled, which can easily lead to field of view misalignment and angle errors. Secondly, multiple sets of independent data will consume a large amount of storage resources. Position scaling, angle calibration, and real-time rendering adaptation during magnification switching will consume a large amount of CPU and GPU resources, resulting in platform lag and response delays, and placing high demands on computer hardware performance.
[0005] Therefore, there is an urgent need for a browsing trajectory recording method that can reduce the complexity of data maintenance, reduce resource consumption, and improve the smoothness of operation, so as to overcome the shortcomings of existing technologies. Summary of the Invention
[0006] The purpose of this invention is to provide a method and system for recording browsing trajectories in a panoramic image pyramid, achieving low complexity, low resource consumption, and high stability in recording browsing trajectories, thereby improving doctors' efficiency in reading images and reducing computer performance overhead.
[0007] To achieve the above objectives, the present invention employs the following technical solutions.
[0008] A method for recording browsing trajectories in a panoramic image pyramid includes the following steps: S1. Configuring preconditions: S11. Defining a browsing trajectory data structure BH, which includes angle attributes and image attributes. The angle attributes are used to store the image flip angle, and the image attributes are used to store the trajectory image; S12. Constructing a global variable, where the key of the global variable includes a slice identifier and the current slice magnification, and the value of the global variable is an instance of the browsing trajectory data structure; S13. Configuring color association rules to match corresponding display colors based on different slice magnifications; S2. Obtaining the digital image to be browsed and its navigation map, generating slice identifiers, and performing the following operations when the digital image triggers an image movement, rotation, or navigation map size adjustment event: S21. Obtaining the current magnification of the digital image, the parameters of the current browsing field of view, and the actual flip angle; S22. Calculating the window display point based on the parameters of the current browsing field of view. S23. Based on whether there is a key in the global variable corresponding to the current slice identifier and the current magnification, initialize or call the corresponding browsing trajectory data structure instance; S24. If the angle attribute of the instance is inconsistent with the actual flip angle, rotate and adjust the image attribute of the instance and update the angle attribute; if the image size of the instance is inconsistent with the size of the navigation map, adjust the image size to be consistent with the navigation map; S25. Convert the image corresponding to the image attribute to grayscale and binarize to obtain a black and white image; S26. Determine the target color according to the matching result of the current magnification and color association rule, replace the black pixels in the black and white image with the target color, and complete the image coloring; S27. Store the updated browsing trajectory data structure instance in the global variable and display the colorized image on the image browsing platform.
[0009] Furthermore, S26 also includes the steps of: instantiating a rectangle for marking the current browsing area, drawing the rectangle on the binarized black and white image, and then performing an image coloring operation; the parameters of the rectangle are determined based on the position and size parameters of the rotated and adapted window display point, the navigation map size, and the current browsing field of view: rectangle width = navigation map width × current browsing field of view width / width of the digital medical image to be browsed; rectangle height = rectangle width × current browsing field of view height / current browsing field of view width; rectangle X coordinate = rotated window display point center X coordinate - rectangle width / 2; rectangle Y coordinate = rotated window display point center Y coordinate - rectangle height / 2.
[0010] Furthermore, the global variable is a key-value pair collection type, and the slice is uniquely identified by a GUID.
[0011] Furthermore, the color association rules include a preset color table and a magnification interval S. The color table contains at least three different light colors, and the magnification interval S is a preset fixed value. The target color index in the color table is determined by the association calculation between the current magnification and S.
[0012] Furthermore, the relationship between the current magnification and S is calculated as follows: p = Math.Round(current magnification / S) - 1, where p is the index of the color table, Math.Round indicates rounding, and the value of p does not exceed the index range of the color table.
[0013] Furthermore, the calculation process for the rotated window display point is as follows: If the actual rotation angle FA = 0°, the window display point retains the initial calculation result; if the actual rotation angle FA ≠ 0°, the cosine value dCos and the sine value dSin of FA are calculated first, and then the center coordinates of the window display point are adjusted using the following formula: ; Where NVP is the rotated viewport display point. , Here, X and Y are the center coordinates of the rotated viewport display point, and VP is the initial viewport display point. , These are the X and Y coordinates of the center of the initial viewport display point, AN is the navigation map, AN.Width is the width of the navigation map, and AN.Height is the height of the navigation map.
[0014] Furthermore, the actual flip angle FA is processed by taking the remainder between the actual flip angle and 360°, and the remainder is used as the normalized actual flip angle FA to ensure that the range of the actual flip angle FA is 0°≤FA≤359°.
[0015] Furthermore, the image attribute of the browsing trajectory data structure is of bitmap type, and the angle attribute is of integer type.
[0016] A system for recording browsing trajectories in a panoramic image pyramid includes: a data structure definition module for defining a browsing trajectory data structure, the data structure including angle attributes and image attributes; a global mapping module for constructing and maintaining global variables, the keys of which include slice identifiers and current slice magnification, and the values being instances of the browsing trajectory data structure; a color configuration module for configuring color association rules, the color association rules being used to match corresponding display colors according to different slice magnifications; an event response module for monitoring events such as movement, rotation, or navigation map size adjustment of digital images and triggering the trajectory recording process; a parameter acquisition module for acquiring the current magnification, actual flip angle, and position and size parameters of the current browsing field of view of the digital image; a window calculation module for calculating the window display point and performing rotation adaptation calculations based on the actual flip angle; an image processing module for performing size adjustment, grayscale conversion, binarization, and colorization processing on the image attributes of the browsing trajectory data structure instance; and a storage and display module for storing the updated browsing trajectory data structure instance to the global mapping variables and displaying the colorized image on an image browsing platform.
[0017] Furthermore, the image processing module also includes a rectangular marker submodule, which is used to calculate the core parameters of the rectangular marker based on the rotation-adapted window display point and navigation map size output by the window calculation module, and the current browsing field position and size parameters output by the parameter acquisition module. The rectangular marker is used to identify the current browsing area.
[0018] The advantages of this invention are: Reduced data maintenance complexity: By using a unified browsing trajectory data structure and global mapping variables, there is no need to design multiple sets of independent data for different magnifications, simplifying data format management and reducing the processing logic of boundary scenes. This fundamentally avoids problems such as field of view misalignment and angle errors, improving functional stability; Optimized hardware performance consumption: The unified storage method reduces redundant data occupation, simplifies the calculation process when switching magnifications, reduces CPU and GPU resource consumption, avoids response delays caused by frequent switching, and ensures smooth operation; Meets clinical application needs: It reduces the performance requirements of computer hardware, adapts to more clinical scenarios, and reduces the lag and adjustment time during doctors' image reading process, directly improving image reading efficiency and assisting in accurate diagnosis and medical teaching. Attached Figure Description
[0019] Figure 1 is a flowchart of the method for recording browsing trajectory in the panoramic image pyramid of the present invention; Figure 2 is a schematic diagram of configuring the preconditions of the present invention; Figure 3 is the original image of the browsing trajectory image of the present invention; Figure 4 is the grayscale processing result of the original image; Figure 5 is the binarization processing result of the grayscale image; Figure 6 is a schematic diagram of drawing the current browsing position on the binarized image; Figure 7 is the image after coloring after adding a new browsing position; Figure 8 is a schematic diagram of the browsing trajectory image of the present invention after adding a 40X browsing trajectory; Figure 9 is a schematic diagram of the browsing trajectory image of the present invention after being scaled down by 10X; Figure 10 is a schematic diagram of the browsing trajectory image of the present invention after being rotated by 40X. Detailed Implementation
[0020] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
[0021] Example 1 This example uses the C# programming language as an example. Based on a coordinate system with the origin at the lower left corner and the Y-axis increasing upwards, combined with a medical pathological slide image browsing scenario, and referring to the flowchart in Figure 1, the specific implementation process of the present invention is described in detail.
[0022] Before recording browsing history, configure the prerequisites, as shown in Figure 2.
[0023] Prerequisite 1. Define the browsing trajectory data structure BH, which includes the angle attribute Angle and the corresponding image attribute Image.
[0024] {public int Angle;public Bitmap Image;} Precondition 2. Define a global variable DC of type Dictionary, where the key of DC is the slice GUID + slice ratio, and the value is BH.
[0025] Dictionary<string, BH> DC = new Dictionary<string, BH> () Precondition 3. Define a color sheet to display colors at different magnifications.
[0026] Color[] colorSheet ={LightSteelBlue,LightGreen,LightSalmon,Moccasin,DarkGray,Goldenrod,MediumOrchid,Olive}; Precondition 4. Define S as the color change ratio interval.
[0027] S = 10.
[0028] The steps for recording the browsing trajectory in slices are as follows.
[0029] Step 1, Image Initialization and Event Binding: Open the digital pathology slide image A with a resolution of 10000×8000, as shown in Figure 3, and obtain the navigation map AN, which has a size of 800×600. Generate a unique GUID for the slide. Bind the trajectory recording method UN to the movement event, rotation event, and navigation map AN resizing event of image A.
[0030] Step 2, Parameter Acquisition and Viewport Calculation: Define a variable CBH of type BH. When the UN method is triggered, acquire the current magnification Scale and the actual flip angle FA, for example, set Scale=40X, FA=90°. Define the current viewing field of view as K, which includes coordinates X, Y and dimensions Width, Height. In this embodiment, the coordinates of the current viewing field K are X=2000, Y=1500, and the dimensions are Width=1000, Height=800.
[0031] Calculate the initial viewport display point VP: , FA = 90%360 = 90° ≠ 0 , .
[0032] Further calculations are performed based on VP and FA to determine the rotated window display point NVP: Step 3, Data Structure Instantiation and Adaptation: Construct Key=GUID+Scale, check if the Key does not exist in DC, if not, initialize CBH: Assign the angle of FA to CBH, CBH.Angle=90°; Set the size of CBH.Image according to the width and height of An, CBH.Image=new Bitmap (800,600).
[0033] Step 4, Image Processing and Coloring: Instantiate rectangle R, , , , .
[0034] Calculate the color index p=Math.Round (40 / 10)-1=4-1=3, which corresponds to the color sheet colorSheet [3]=Moccasin.
[0035] The CBH.Image is converted to grayscale as shown in Figure 4, and then binarized with a threshold of 128 as shown in Figure 5 to obtain a black and white image.
[0036] The image is drawn into a black and white image based on the position and size of R, as shown in Figure 6. Then, the pixels of CBH.Image are traversed, and the black in CBH.Image is replaced with the Moccasin color to color CBH.Image, as shown in Figure 7.
[0037] Step 5, Storage and Display: Store the updated CBH into DC [Key], DC [Key] = CBH, and display the colored image in the navigation map area of the browsing platform. At this time, the doctor can clearly see the browsing trajectory marked with a Moccasin colored rectangle at 40X magnification and 90° rotation in the navigation map, as shown in Figure 8. The slice browsing trajectory recording ends.
[0038] Example 2: When the doctor switches the magnification from 40X to 10X, Scale=10, and the rest remains unchanged. The calculation is p=(10 / 10)-1=0, corresponding to the color LightSteelBlue.
[0039] After repeating the window calculation and image processing steps, the navigation map will mark the browsing trajectory at 10X magnification with LightSteelBlue color, as shown in Figure 9, and the switching process is smooth.
[0040] Example 3: When FA=0, with other parameters unchanged, calculate p=(40 / 10)-1=3, corresponding to the color Moccasin. After repeating the window rotation adaptation calculation, grayscale conversion, binarization, rectangular marker drawing, and coloring steps, the following is obtained: , , , The navigation map will mark the browsing trajectory at 40X magnification with Moccasin color, as shown in Figure 10. It is 90° different from Figure 6, and the trajectory position and rectangle are significantly different.
[0041] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for recording browsing trajectories in a panoramic image pyramid, characterized in that, Includes the following steps: S1. Configure Preconditions: S11. Define a browsing trajectory data structure BH, which includes angle attributes and image attributes. The angle attributes store the image flip angle, and the image attributes store the trajectory image. S12. Construct a global variable. The key of the global variable includes the slice identifier and the current slice magnification. The value of the global variable is an instance of the browsing trajectory data structure. S13. Configure color association rules to match the corresponding display color according to different slice magnifications. S2. Obtain the digital image to be browsed and its navigation map, generate slice identifiers, and trigger image movement, rotation, or navigation map scaling when the digital image is moved, rotated, or the navigation map scale is adjusted. When the zoom level is adjusted, perform the following operations: S21, obtain the current magnification of the digital image, the parameters of the current browsing field of view, and the actual flip angle; S22, calculate the window display point based on the parameters of the current browsing field of view, and perform rotation adaptation calculation on the window display point based on the actual flip angle to obtain the rotated window display point; S23, based on whether there is a key in the global variables corresponding to the current slice identifier and the current magnification, initialize or call the corresponding browsing trajectory data structure instance; S24, if the angle attribute of the instance is inconsistent with the actual flip angle, rotate and adjust the image attribute of the instance and update the angle attribute; If the image size of the instance is inconsistent with the size of the navigation map, adjust the image size to match the navigation map; S25, convert the image corresponding to the image attribute to grayscale and binarize it to obtain a black and white image; S26, determine the target color according to the matching result of the current magnification and color association rules, replace the black pixels in the black and white image with the target color, and complete the image colorization; S27, store the updated browsing trajectory data structure instance in the global variable, and display the colorized image on the image browsing platform.
2. The method for recording browsing trajectories in a panoramic image pyramid according to claim 1, characterized in that, S26 further includes the steps of: instantiating a rectangle for marking the current browsing area, drawing the rectangle on the binarized black and white image, and then performing an image coloring operation; the parameters of the rectangle are determined based on the position and size parameters of the rotated and adapted window display point, the navigation map size, and the current browsing field of view: rectangle width = navigation map width × current browsing field of view width / width of the digital medical image to be browsed; rectangle height = rectangle width × current browsing field of view height / current browsing field of view width; rectangle X coordinate = rotated window display point center X coordinate - rectangle width / 2; rectangle Y coordinate = rotated window display point center Y coordinate - rectangle height / 2.
3. The method for recording browsing trajectories in a panoramic image pyramid according to claim 1, characterized in that, The global variable is a key-value pair collection type, and the slice is uniquely identified by a GUID.
4. The method for recording browsing trajectories in a panoramic image pyramid according to claim 1, characterized in that, The color association rule includes a preset color table and a magnification interval S. The color table contains at least three different light colors, and the magnification interval S is a preset fixed value. The target color index in the color table is determined by the association calculation between the current magnification and S.
5. The method for recording browsing trajectories in a panoramic image pyramid according to claim 4, characterized in that, The correlation calculation method between the current magnification and S is: p = Math.Round(current magnification / S) - 1, where p is the index of the color table, Math.Round means rounding, and the value range of p does not exceed the index range of the color table.
6. The method for recording browsing trajectories in a panoramic image pyramid according to claim 1, characterized in that, The calculation process for the rotated window display point is as follows: If the actual rotation angle FA = 0°, the window display point retains the initial calculation result; if the actual rotation angle FA ≠ 0°, the cosine value dCos and the sine value dSin of FA are calculated first, and then the center coordinates of the window display point are adjusted using the following formula: ; Where NVP is the rotated viewport display point. 、 Here, X and Y are the center coordinates of the rotated viewport display point, and VP is the initial viewport display point. 、 These are the X and Y coordinates of the center of the initial viewport display point, AN is the navigation map, AN.Width is the width of the navigation map, and AN.Height is the height of the navigation map.
7. The method for recording browsing trajectories in a panoramic image pyramid according to claim 6, characterized in that, The actual flip angle FA is processed by taking the remainder between the actual flip angle and 360°, and the remainder is used as the normalized actual flip angle FA to ensure that the actual flip angle FA ranges from 0° to 359°.
8. The method for recording browsing trajectories in a panoramic image pyramid according to claim 1, characterized in that, The image attribute of the browsing trajectory data structure is a bitmap type, and the angle attribute is an integer type.
9. A system for recording browsing trajectories in a panoramic image pyramid, characterized in that, include: The data structure definition module is used to define the browsing trajectory data structure, which includes angle attributes and image attributes. The global mapping module is used to build and maintain global variables. The keys of the global variables include the slice identifier and the current slice magnification, and the values are instances of the browsing trajectory data structure. The color configuration module is used to configure color association rules, which are used to match the corresponding display colors according to different slice magnifications. The event response module is used to monitor events such as movement, rotation, or navigation map size adjustment of digital images and trigger the trajectory recording process. The parameter acquisition module is used to acquire the current magnification, actual flip angle, and position and size parameters of the current viewing field of the digital image. The window calculation module is used to calculate the window display points and perform rotation adaptation calculations based on the actual flip angle. The image processing module is used to perform size adjustment, grayscale conversion, binarization, and colorization on the image attributes of the browsing trajectory data structure instance; The storage and display module is used to store the updated browsing trajectory data structure instance to a global mapping variable and display the colored image on the image browsing platform.
10. The system for recording browsing trajectories in a panoramic image pyramid according to claim 9, characterized in that, The image processing module further includes a rectangular marker submodule, which is used to calculate the core parameters of the rectangular marker based on the rotation-adapted window display point and navigation map size output by the window calculation module, and the current browsing field position and size parameters output by the parameter acquisition module. The rectangular marker is used to identify the current browsing area.