Method and device for synchronously previewing pictures at multiple viewports
By acquiring and calculating the slice position difference between the main viewport and the synchronous viewport, and determining and displaying the matching image, the problem of inaccurate positioning of multi-viewport images is solved, and the accuracy and reliability of synchronous preview of medical images are improved.
Patent Information
- Application Number
- CN202310678592.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-08
- Publication Date
- 2024-12-10
AI Technical Summary
When viewing medical images in multiple viewports, the number of images in the main viewport and the synchronous viewport are different and the slice thickness is different, making it difficult to accurately locate to the same or close position, resulting in the problem of display errors.
By monitoring the image switching instructions of the main viewport, obtain the slice positions of the main viewport and the synchronous viewport, calculate the difference in real time to determine the matching target image, and display the image in the synchronous viewport to realize the main viewport and synchronous viewport. Synchronous preview of the port.
It improves the accuracy and reliability of multi-viewport image synchronization preview, reduces synchronization errors, ensures accurate alignment of images, and helps doctors to understand the patient's condition more comprehensively.
Smart Images

Figure CN119105715A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of medical imaging technology, and in particular to a method and device for synchronous preview of multi-viewport images. Background Art
[0002] In the medical field, when doctors view medical images of patients, they usually need to use multiple viewports to compare and view multiple sets of images of the same section in order to fully understand the patient's condition and make a diagnosis. When viewing multiple viewports, the images in the synchronous viewport and the image in the main viewport are usually scrolled synchronously to view the images at the same position.
[0003] In the related art, the synchronization methods of the synchronous viewport and the main viewport mainly include: synchronization based on the main viewport sequence index, synchronization based on the progress bar percentage of the main viewport and synchronization based on the slice thickness. However, in the above synchronization methods, when the number of images of the main viewport and the synchronous viewport are different and the slice thickness is different, it will cause the image of the synchronous viewport to be difficult to accurately position to the same or close position as the image of the main viewport, which is prone to display errors. Summary of the invention
[0004] In view of this, an embodiment of the present invention provides a method and device for synchronous preview of multiple viewport images, which can determine in real time based on the slice position the target second image in the synchronous viewport that matches the first image to be displayed in the main viewport, thereby improving the accuracy and reliability of the synchronous preview of images in the main viewport and the synchronous viewport.
[0005] To achieve the above object, according to one aspect of an embodiment of the present invention, a method for synchronously previewing a multi-viewport image is provided, comprising:
[0006] In response to monitoring a picture switching instruction of the main viewport, obtaining a slice position of a first picture to be displayed in a first picture sequence corresponding to the main viewport;
[0007] Obtaining a slice position of a second image currently displayed in a second image sequence corresponding to a synchronous viewport; the synchronous viewport is a viewport for synchronous preview with the main viewport;
[0008] Determine a target second picture that matches the first picture to be displayed according to a slice position of the first picture to be displayed and a slice position of the second picture currently displayed;
[0009] The target second picture is displayed in the synchronized viewport.
[0010] Optionally, before obtaining the slice position of the second image currently displayed in the second image sequence corresponding to the synchronous viewport, the method includes:
[0011] Acquire a scanning position of the first picture sequence in the primary viewport;
[0012] Acquire a scanning position of a picture sequence in each of a plurality of non-primary viewports; the primary viewport and the plurality of non-primary viewports are in the same display interface;
[0013] The synchronous viewport is selected from the plurality of non-primary viewports according to the scanning position of the first image sequence and the scanning position of the image sequence in each non-primary viewport.
[0014] Optionally, both the first picture and the second picture have a sequence identifier, and the first pictures in the first picture sequence and the second pictures in the second picture sequence are sorted in ascending or descending order of the sequence identifier.
[0015] Optionally, determining a target second picture matching the first picture to be displayed according to a slice position of the first picture to be displayed and a slice position of the second picture currently displayed includes:
[0016] When the picture switching instruction indicates a forward switch, the second picture sequence is forwardly traversed with the sequence identifier of the currently displayed second picture as the starting position to determine the target second picture; wherein the forward switch is to switch the first picture in the main viewport in the order of increasing sequence identifiers;
[0017] When the picture switching instruction indicates a reverse switch, the second picture sequence is traversed in reverse with the sequence identifier of the currently displayed second picture as the starting position to determine the target second picture, wherein the reverse switch is to switch the first picture in the main viewport in descending order of the sequence identifiers.
[0018] Optionally, determining the target second picture includes:
[0019] Setting a difference variable; determining an absolute value of a difference between a slice position of a first image to be displayed and a slice position of a second image currently being traversed;
[0020] When the absolute value of the difference is not a preset value, determining whether the second picture currently traversed is the second picture currently displayed;
[0021] In the case that the second picture currently traversed is the second picture currently displayed, the value of the difference variable is determined to be the absolute value of the difference, and the second picture currently traversed is updated to determine the target second picture.
[0022] Optionally, after determining whether the second picture currently traversed is the second picture currently displayed, the method further includes:
[0023] In response to the fact that the currently traversed second picture is not the currently displayed second picture, determine whether the absolute value of the difference is less than or equal to the value of the difference variable; in response to the absolute value of the difference being less than or equal to the value of the difference variable, determine that the value of the difference variable is the absolute value of the difference, and update the currently traversed second picture to determine the target second picture; in response to the absolute value of the difference being greater than the value of the difference variable, use the last traversed second picture as the target second picture.
[0024] Optionally, after determining the absolute value of the difference between the slice position of the first picture to be displayed and the slice position of the second picture currently traversed, the method further includes:
[0025] When the absolute value of the difference is a preset value, it is determined that the currently traversed second picture is the target second picture.
[0026] According to another aspect of an embodiment of the present invention, a device for synchronously previewing a multi-viewport image is provided, comprising:
[0027] A first acquisition module, in response to monitoring a picture switching instruction of the main viewport, acquires a slice position of a first picture to be displayed in a first picture sequence corresponding to the main viewport;
[0028] A second acquisition module is used to acquire a slice position of a second image currently displayed in a second image sequence corresponding to a synchronous viewport; the synchronous viewport is a viewport for synchronous preview with the main viewport;
[0029] A determination module, which determines a target second picture matching the first picture to be displayed according to a slice position of the first picture to be displayed and a slice position of the second picture currently displayed;
[0030] A display module displays the target second image in the synchronous viewport.
[0031] According to another aspect of an embodiment of the present invention, there is provided an electronic device, including:
[0032] one or more processors;
[0033] a storage device for storing one or more programs,
[0034] When the one or more programs are executed by the one or more processors, the one or more processors implement the method for synchronous preview of multi-viewport images provided by the present invention.
[0035] According to another aspect of an embodiment of the present invention, a computer-readable medium is provided, on which a computer program is stored. When the program is executed by a processor, the method for synchronous preview of multi-viewport images provided by the present invention is implemented.
[0036] An embodiment of the above invention has the following advantages or beneficial effects: after monitoring the image switching instruction of the main viewport, the slice position of the first image to be displayed in the first image sequence corresponding to the main viewport and the slice position of the second image currently displayed in the second image sequence corresponding to the synchronous viewport are obtained, and then based on the slice position, the target second image in the synchronous viewport that matches the first image to be displayed in the main viewport is determined to achieve synchronous preview of the main viewport and the synchronous viewport. The method calculates the difference in the slice position of the images of the main viewport and the synchronous viewport in real time to determine the second image in the synchronous viewport that matches the first image to be displayed in the main viewport, thereby achieving synchronous preview of the images of the main viewport and the synchronous viewport. The method can reduce the error of synchronization between the main viewport and the synchronous viewport, ensure the accuracy and precision of the synchronous preview of the images, and has high reliability.
[0037] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.
[0039] Figure 1 is a schematic diagram of the main process of a method for synchronous preview of multi-viewport images according to an embodiment of the present invention;
[0040] Figure 2 is a schematic diagram of the main process of another method for synchronous preview of multi-viewport images according to an embodiment of the present invention;
[0041] Figure 3 It is a flowchart of a method for synchronously previewing multiple viewport images according to an embodiment of the present invention;
[0042] Figure 4 is a schematic diagram of main modules of a device for synchronous preview of multi-viewport images according to an embodiment of the present invention;
[0043] Figure 5 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;
[0044] Figure 6 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION
[0045] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0046] Figure 1 FIG. 1 is a schematic diagram of the main process of a method for synchronous preview of multi-viewport images according to an embodiment of the present invention. Figure 1 As shown, the method comprises the following steps:
[0047] Step S101: in response to monitoring a picture switching instruction of a main viewport, obtaining a slice position of a first picture to be displayed in a first picture sequence corresponding to the main viewport;
[0048] Step S102: obtaining a slice position of a second picture currently displayed in a second picture sequence corresponding to a synchronous viewport; the synchronous viewport is a viewport for synchronous preview with the main viewport;
[0049] Step S103: determining a target second picture matching the first picture to be displayed according to the slice position of the first picture to be displayed and the slice position of the second picture currently displayed;
[0050] Step S104: Display the target second picture in the synchronous viewport.
[0051] In an embodiment of the present invention, the method can be applied in the medical field for multi-viewport synchronous preview of DICOM (Digital Imaging and Communications in Medicine) medical images, so that the image of the synchronous viewport can be more accurately positioned at the same or close position of the image of the main viewport, so that doctors can have a more comprehensive understanding of the patient's condition.
[0052] In an embodiment of the present invention, an image report can be compared and viewed by switching multiple viewports in the same display interface, such as 2*1, 2*2, 3*3 viewports, etc. The synchronous viewport is a viewport that performs synchronous preview with the main viewport. The first image and the second image can be medical images, and the medical image is obtained by scanning on a set section. The first image sequence includes multiple first images, and the second image sequence includes multiple second images. The main viewport and the synchronous viewport can be determined according to the received operation instruction. For example, if a certain viewport receives a click instruction, the viewport is the main viewport, and the viewport in which the image scrolls synchronously with the image in the main viewport is the synchronous viewport, that is, the main viewport and the synchronous viewport can be adjusted according to the received operation instruction. Image preview can be performed synchronously in the main viewport and the synchronous viewport, wherein the main viewport corresponds to the preview of the first image sequence, and the synchronous viewport corresponds to the preview of the second image sequence.
[0053] In an embodiment of the present invention, the image switching instruction of the main viewport may be a triggering instruction of a scrolling event, and the scrolling event has a corresponding scrolling value. When the scrolling value is a positive number, it means that the user is scrolling from top to bottom in the main viewport, that is, the image switching instruction indicates a positive switching; when the scrolling value is a negative number, it means that the user is scrolling from bottom to top in the main viewport, that is, the image switching instruction indicates a negative switching. The image switching of the main viewport may be realized by a mouse wheel.
[0054] In the embodiment of the present invention, Figure 2 As shown, before obtaining the slice position of the second picture currently displayed in the second picture sequence corresponding to the synchronous viewport, it includes:
[0055] Step S201: obtaining a scanning position of a first picture sequence in a main viewport;
[0056] Step S202: obtaining a scanning position of a picture sequence in each of a plurality of non-primary viewports; the primary viewport and the plurality of non-primary viewports are in the same display interface;
[0057] Step S203: selecting a synchronous viewport from the plurality of non-primary viewports according to the scanning position of the first image sequence and the scanning position of the image sequence in each non-primary viewport.
[0058] In an embodiment of the present invention, in order to determine a target second image that matches a first image to be displayed, before obtaining the slice position of the second image currently displayed in the second image sequence corresponding to the synchronous viewport, it is necessary to determine the synchronous viewport, that is, it is necessary to determine a viewport that performs synchronous preview with the main viewport on the same display interface to further determine the target second image that matches the first image to be displayed in the synchronous viewport.
[0059] In an embodiment of the present invention, an image report may include multiple image sequences, and each image sequence or each image in the image sequence has a corresponding scanning orientation. The scanning orientation is the scanning section, and the scanning section can be divided into three planes: axial, coronal and sagittal. In different viewports of the same display interface, viewports with the same scanning orientation can perform synchronous preview. The scanning orientation of the first image sequence in the main viewport and the scanning orientation of the image sequence in each non-main viewport in multiple non-main viewports are obtained, and then the non-main viewport whose scanning orientation of the image sequence is the same as the scanning orientation of the first image sequence in the main viewport is used as the synchronous viewport to realize the synchronous preview of the image in the synchronous viewport and the image in the main viewport. It is also possible to compare the scanning orientation of the first first image in the first image sequence in the main viewport with the scanning orientation of the first image in the image sequence in each non-main viewport after monitoring the image switching instruction of the main viewport, and the non-viewport with the same scanning orientation is the synchronous viewport that performs synchronous preview with the main viewport.
[0060] In the embodiment of the present invention, the scanning position can be represented by a corresponding array, and 6 values are stored in the array. When the value is (1, 0, 0, 0, 1, 0), it indicates that the scanning position is the axial position, when the value is (1, 0, 0, 0, 0, -1), it indicates that the scanning position is the coronal position, and when the value is (0, 1, 0, 0, 0, -1), it indicates that the scanning position is the sagittal position. During the image scanning process, there may be a certain angle offset during scanning, so that the value in the array corresponding to the scanning position is not an integer. The value can be processed into an integer before comparison to reduce the error. For example, the slice method can be used to cut the 6 values in the array into 2 arrays, with the first 3 values in the first array and the last 3 values in the second array. Then, the values in the two arrays are converted to absolute values, and the Math.max method is called to find the maximum value in the array. Then, the maximum value in the first array and the second array that is greater than 0 is modified to 1, the maximum value that is less than 0 is modified to -1, and the rest is modified to 0. Then, the first array and the second array are merged using the concat method to obtain the processed array, and the processed array is used to compare the scanning direction. When comparing the scanning direction, the array can be converted into a string for comparison. If the strings corresponding to the scanning directions of the two viewports are exactly the same, it means that they are the same scanning direction, and synchronous scrolling is performed.
[0061] In an embodiment of the present invention, after the image switching instruction of the main viewport is monitored, the synchronous viewport that needs to perform synchronous preview with the main viewport can be determined by the scanning orientation of the image, and the synchronous scrolling of the image needs to be determined according to the slice position of the image. Specifically, the slice position of the first image to be displayed in the first image sequence corresponding to the main viewport is obtained, and the slice position of the second image currently displayed in the second image sequence corresponding to the synchronous viewport is obtained. Among them, the first image to be displayed is a first image, wherein each first image in the first image sequence and each second image in the second image sequence have a corresponding slice position, and the slice position of the image is the spatial coordinate of the image in the human body, that is, the position where the image is shot or scanned in the human body.
[0062] In an embodiment of the present invention, the slice position can also be represented by a corresponding array, in which three position coordinate axes are stored, corresponding to the x, y, and z coordinate points of the human body. When the image of the axial plane is scrolled and previewed, the z value of the array will change, the y value will change when the coronal plane is previewed, and the x value will change when the sagittal plane is previewed. That is, after determining the scanning orientation of the main viewport and the synchronous viewport, the image closest to the main viewport in the synchronous viewport can be found through the changed coordinate values for loading, parsing, and display.
[0063] In the embodiment of the present invention, both the first picture and the second picture have a sequence identifier, and the first picture in the first picture sequence and the second picture in the second picture sequence are sorted in ascending or descending order of the sequence identifier. The first picture in the first picture sequence and the second picture in the second picture sequence are also sorted according to the slice position, that is, the slice position and the sequence identifier have a corresponding relationship.
[0064] In the embodiment of the present invention, determining a target second picture matching the first picture to be displayed according to the slice position of the first picture to be displayed and the slice position of the second picture currently displayed includes:
[0065] When the picture switching instruction indicates a forward switch, the second picture sequence is forwardly traversed with the sequence identifier of the currently displayed second picture as the starting position to determine the target second picture; wherein the forward switch is to switch the first picture in the main viewport in the order of increasing sequence identifiers;
[0066] When the picture switching instruction indicates reverse switching, the second picture sequence is traversed in reverse with the sequence identifier of the currently displayed second picture as the starting position to determine the target second picture, wherein the reverse switching is to switch the first picture in the main viewport in descending order of the sequence identifiers.
[0067] In an embodiment of the present invention, when determining the target second picture, forward traversal or reverse traversal can be performed with the sequence identifier of the currently displayed second picture as the starting position. When the picture switching instruction indicates a forward switch, the forward traversal starts with the starting position; when the picture switching instruction indicates a reverse switch, the reverse traversal starts with the starting position. Forward switching is to display the first picture in the first picture sequence in the order of increasing sequence identifiers, and forward traversal is to display the second picture in the second picture sequence in the order of increasing sequence identifiers starting from the starting position; reverse switching is to display the first picture in the first picture sequence in the order of decreasing sequence identifiers, and reverse traversal is to display the second picture in the second picture sequence in the order of decreasing sequence identifiers starting from the starting position. This is because, if the sequence identifiers of the first picture in the first picture sequence and the second picture in the second picture sequence are sorted in ascending order, and the slice positions are also sorted in ascending order, then the target second picture that matches the first picture to be displayed is the second picture currently displayed or after the second picture currently displayed; if the sequence identifiers of the first picture in the first picture sequence and the second picture in the second picture sequence are sorted in descending order, and the slice positions are also sorted in descending order, then the target second picture that matches the first picture to be displayed is the second picture currently displayed or before the second picture currently displayed. By setting the starting position of the traversal to the sequence identifier of the second picture currently displayed, a partial traversal is performed without a full traversal, which can reduce the number of loops and improve matching efficiency.
[0068] In the embodiment of the present invention, forward traversal and reverse traversal can be implemented using a while loop. In the forward traversal, the execution condition of the while loop is that the sequence identifier of the second picture currently displayed is less than the length of the second picture sequence. In the reverse traversal, the execution condition of the while loop is that the second picture currently displayed is not the first picture in the second picture sequence. For example, the sequence identifiers of the second picture sequence range from 0 to 9, the sequence length is 10, the largest sequence identifier in the forward traversal is 9, and the smallest sequence identifier in the reverse traversal is 0.
[0069] In the embodiment of the present invention, Figure 3 As shown, determining the target second picture includes:
[0070] Step S301: setting difference variables;
[0071] Step S302: determining the absolute value of the difference between the slice position of the first picture to be displayed and the slice position of the second picture currently traversed;
[0072] Step S303: Determine whether the absolute value of the difference is a preset value; if so, execute step S304; if not, execute step S305;
[0073] Step S304: Determine that the second picture currently traversed is the target second picture;
[0074] Step S305: Determine whether the second picture currently traversed is the second picture currently displayed; if so, execute step S306; if not, execute step S307;
[0075] Step S306: determine that the value of the difference variable is the absolute value of the difference, update the second picture currently traversed, and jump to step S302 to determine the target second picture;
[0076] Step S307: Determine whether the absolute value of the difference is less than or equal to the value of the difference variable; if so, execute step S308; if not, execute step S309;
[0077] Step S308: determine that the value of the difference variable is the absolute value of the difference, update the second picture currently traversed, and jump to step S302 to determine the target second picture;
[0078] Step S309: taking the last traversed second picture as the target second picture.
[0079] In an embodiment of the present invention, a target second image is determined, that is, a second image whose slice position is the same as or closest to the slice position of the first image to be displayed is determined, so that when the first image to be displayed in the main viewport is displayed, the synchronous viewport displays the second image whose slice position is the same as or closest to the first image to be displayed, so as to understand the patient's condition based on the image with the same or close slice position. The difference variable is a variable declared outside the while loop body, which is used to store the absolute value of the position difference between the main viewport and the synchronous viewport, and set the initial value of the difference variable, which can be set to a value less than 0, such as -1. When traversing the second image sequence forward or backward with the sequence of the currently displayed second image marked as the starting position, the absolute value of the difference between the slice position of the first image to be displayed and the slice position of the currently traversed second image is first calculated, and then the absolute value of the difference is compared with a preset value, wherein the preset value can be 0, or can be set to other values that can be identified as the closest position.
[0080] When the absolute value of the difference is not a preset value, it is determined whether the second picture currently traversed is the second picture currently displayed. If the second picture currently traversed is the second picture currently displayed, the absolute value of the difference is assigned to the difference variable, and the traversal of the next second picture is continued, that is, the current traversal of the second picture is updated, and the process jumps to step S302 to determine the target second picture, that is, if the sequence identifier of the second picture currently traversed is i, if the traversal is forward, the sequence identifier of the next traversed second picture is i+1, and if the traversal is reverse, the sequence identifier of the next traversed second picture is i-1. If the second picture currently traversed is not the second picture currently displayed, it is determined whether the absolute value of the difference is less than or equal to the value of the difference variable. If the absolute value of the difference is less than or equal to the value of the difference variable, it means that the slice position of the second picture currently traversed is closer to the first picture to be displayed than the second picture last traversed. At this time, the absolute value of the difference is assigned to the difference variable, that is, the difference variable is updated, and the next second picture is traversed continuously, the second picture currently traversed is updated, and the step S302 is jumped to; if the absolute value of the difference is greater than the value of the difference variable, the second picture last traversed is used as the target picture, because the difference between the slice position of the second picture traversed later and the first picture to be displayed is greater. By traversing with the sequence identifier of the second picture currently displayed as the starting position, the sequence identifier is incremented when traversing forward, and the sequence identifier is decremented when traversing backward, which reduces the number of loops and improves efficiency and performance.
[0081] In an embodiment of the present invention, if the absolute value of the difference is a preset value, there is no need to continue traversing, and the second picture currently traversed is used as the target second picture. The preset value can be set to 0, that is, if the difference between the slice position of the second picture currently traversed and the slice position of the first picture to be displayed is 0, it means that the slice positions of the two are the same, and the second picture currently traversed is the second picture closest to the slice position of the first picture to be displayed, then the traversal is stopped, and if the second picture currently traversed is the second picture currently displayed, there is no need to continue traversing, that is, just display the second picture currently displayed. In addition, the preset value can also be set to other smaller values or value ranges to ensure that when the absolute value of the difference is the preset value, the second picture currently traversed can be used as the target second picture.
[0082] In an embodiment of the present invention, after determining the target second image, the image identifier is obtained according to the sequence identifier of the target second image, and the target second image is obtained from the database according to the image identifier, loaded, parsed and displayed, that is, the target second image is displayed in the synchronization viewport, and a synchronized scrolling preview with the first image to be displayed in the main viewport is achieved, that is, a synchronized preview of the main viewport and the synchronization viewport is achieved.
[0083] The multi-viewport image synchronous preview method of the embodiment of the present invention determines a synchronous viewport for performing synchronous preview with the main viewport after monitoring an image switching instruction of the main viewport, and then determines a target second image in the synchronous viewport for synchronous scrolling preview with a first image to be displayed in the main viewport based on a slice position, thereby realizing synchronous preview of the main viewport and the synchronous viewport; the method calculates the difference in slice position of images of the main viewport and the synchronous viewport in real time to determine the second image in the synchronous viewport that matches the first image to be displayed in the main viewport, thereby reducing the error of synchronization between the main viewport and the synchronous viewport, ensuring the accuracy and precision of the image synchronous preview, and having high reliability; according to the image switching instruction, forward traversal or reverse traversal is performed with the sequence identifier of the second image currently displayed as the starting position, thereby narrowing the traversal range, reducing the number of loops, improving the search efficiency of the target second image, and improving program performance.
[0084] like Figure 4 As shown, according to another aspect of an embodiment of the present invention, a device 400 for synchronous preview of multi-viewport images is provided, comprising:
[0085] The first acquisition module 401 acquires a slice position of a first picture to be displayed in a first picture sequence corresponding to the main viewport in response to monitoring a picture switching instruction of the main viewport;
[0086] The second acquisition module 402 acquires the slice position of the second picture currently displayed in the second picture sequence corresponding to the synchronous viewport; the synchronous viewport is a viewport that is previewed synchronously with the main viewport;
[0087] A determination module 403 determines a target second picture matching the first picture to be displayed according to a slice position of the first picture to be displayed and a slice position of the second picture currently displayed;
[0088] The display module 404 displays the target second image in the synchronous viewport.
[0089] In the embodiment of the present invention, the second acquisition module 403 is further used to:
[0090] Before obtaining the slice position of the second image currently displayed in the second image sequence corresponding to the synchronous viewport, obtain the scanning direction of the first image sequence in the main viewport; obtain the scanning direction of the image sequence in each of the multiple non-main viewports; the main viewport and the multiple non-main viewports are in the same display interface; according to the scanning direction of the first image sequence and the scanning direction of the image sequence in each non-main viewport, filter out the synchronous viewport from the multiple non-main viewports.
[0091] In the embodiment of the present invention, both the first picture and the second picture have a sequence identifier, and the first pictures in the first picture sequence and the second pictures in the second picture sequence are sorted in ascending or descending order of the sequence identifier.
[0092] In the embodiment of the present invention, the determination module 403 is further configured to:
[0093] When the picture switching instruction indicates a forward switch, the second picture sequence is forwardly traversed with the sequence identifier of the currently displayed second picture as the starting position to determine the target second picture; wherein the forward switch is to switch the first picture in the main viewport in the order of increasing sequence identifiers;
[0094] When the picture switching instruction indicates reverse switching, the second picture sequence is traversed in reverse with the sequence identifier of the currently displayed second picture as the starting position to determine the target second picture, wherein the reverse switching is to switch the first picture in the main viewport in descending order of the sequence identifiers.
[0095] In the embodiment of the present invention, the determination module 403 is further configured to:
[0096] Set a difference variable; determine the absolute value of the difference between the slice position of the first image to be displayed and the slice position of the second image currently traversed; when the absolute value of the difference is not a preset value, determine whether the second image currently traversed is the second image currently displayed; when the second image currently traversed is the second image currently displayed, determine the value of the difference variable to be the absolute value of the difference, update the second image currently traversed, and determine the target second image.
[0097] In the embodiment of the present invention, the determination module 403 is further used to:
[0098] After determining whether the currently traversed second picture is the currently displayed second picture, in response to the currently traversed second picture not being the currently displayed second picture, determining whether the absolute value of the difference is less than or equal to the value of the difference variable; in response to the absolute value of the difference being less than or equal to the value of the difference variable, determining the value of the difference variable to be the absolute value of the difference, updating the currently traversed second picture to determine the target second picture; in response to the absolute value of the difference being greater than the value of the difference variable, using the last traversed second picture as the target second picture.
[0099] In an embodiment of the present invention, the determination module 403 is also used to: after determining the absolute value of the difference between the slice position of the first image to be displayed and the slice position of the currently traversed second image, when the absolute value of the difference is a preset value, determine that the currently traversed second image is the target second image.
[0100] According to another aspect of an embodiment of the present invention, an electronic device is provided, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method for synchronous preview of multi-viewport images provided by the present invention.
[0101] According to another aspect of an embodiment of the present invention, a computer readable medium is provided, on which a computer program is stored. When the program is executed by a processor, the method for synchronous preview of multi-viewport images provided by the present invention is implemented.
[0102] Figure 5 An exemplary system architecture 500 is shown to which the method for synchronous preview of multi-viewport images or the apparatus for synchronous preview of multi-viewport images according to the embodiments of the present invention may be applied.
[0103] like Figure 5 As shown, system architecture 500 may include terminal devices 501, 502, 503, a network 504 and a server 505. Network 504 is used to provide a medium for communication links between terminal devices 501, 502, 503 and server 505. Network 504 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0104] Users can use terminal devices 501, 502, 503 to interact with server 505 through network 504 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 501, 502, 503, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only as examples).
[0105] The terminal devices 501 , 502 , and 503 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.
[0106] The server 505 may be a server that provides various services, such as a backend management server (only an example) that provides support for shopping websites browsed by users using the terminal devices 501, 502, and 503. The backend management server may analyze and process the received data such as product information query requests, and feed back the processing results (such as target push information, product information - only an example) to the terminal device.
[0107] It should be noted that the method for synchronous preview of multi-viewport images provided in the embodiment of the present invention is generally executed by the server 505 , and accordingly, the apparatus for synchronous preview of multi-viewport images is generally disposed in the server 505 .
[0108] It should be understood that Figure 5 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0109] Reference below Figure 6, which shows a schematic diagram of the structure of a computer system 600 of a terminal device suitable for implementing an embodiment of the present invention. Figure 6 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0110] like Figure 6 As shown, the computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage part 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the system 600 are also stored. The CPU 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0111] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed into the storage section 608 as needed.
[0112] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the central processing unit (CPU) 601, the above-mentioned functions defined in the system of the present invention are executed.
[0113] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0114] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0115] The modules involved in the embodiments of the present invention may be implemented by software or hardware. The modules described may also be set in a processor, for example, it may be described as: a processor includes a first acquisition module, a second acquisition module, a determination module and a display module. The names of these modules do not constitute a limitation on the modules themselves in some cases, for example, the display module may also be described as "a module for displaying a target second image in a synchronized viewport".
[0116] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes: in response to monitoring the image switching instruction of the main viewport, obtaining the slice position of the first image to be displayed in the first image sequence corresponding to the main viewport; obtaining the slice position of the second image currently displayed in the second image sequence corresponding to the synchronous viewport; the synchronous viewport is a viewport for synchronous preview with the main viewport; determining the target second image matching the first image to be displayed according to the slice position of the first image to be displayed and the slice position of the second image currently displayed; and displaying the target second image in the synchronous viewport.
[0117] According to the technical solution of the embodiment of the present invention, the multi-viewport image synchronous preview method determines the synchronous viewport that performs synchronous preview with the main viewport after monitoring the image switching instruction of the main viewport, and then determines the target second image in the synchronous viewport that performs synchronous scrolling preview with the first image to be displayed in the main viewport based on the slice position, thereby realizing the synchronous preview of the main viewport and the synchronous viewport; the method calculates the difference in slice position of the images of the main viewport and the synchronous viewport in real time to determine the second image in the synchronous viewport that matches the first image to be displayed in the main viewport, thereby reducing the error of synchronization between the main viewport and the synchronous viewport, ensuring the accuracy and precision of the image synchronous preview, and having high reliability; according to the image switching instruction, forward traversal or reverse traversal is performed with the sequence identifier of the second image currently displayed as the starting position, thereby narrowing the traversal range, reducing the number of loops, improving the search efficiency of the target second image, and improving the program performance.
[0118] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for synchronous preview of multi-viewport images. It is characterized in that include: In response to monitoring a picture switching instruction of the main viewport, obtaining a slice position of a first picture to be displayed in a first picture sequence corresponding to the main viewport; Obtaining a slice position of a second image currently displayed in a second image sequence corresponding to a synchronous viewport; the synchronous viewport is a viewport for synchronous preview with the main viewport; Determine a target second picture that matches the first picture to be displayed according to a slice position of the first picture to be displayed and a slice position of the second picture currently displayed; The target second picture is displayed in the synchronized viewport.
2. The method according to claim 1, It is characterized in that Before obtaining the slice position of the second image currently displayed in the second image sequence corresponding to the synchronized viewport, the method includes: Acquire a scanning position of the first picture sequence in the primary viewport; Acquire a scanning position of a picture sequence in each of a plurality of non-primary viewports; the primary viewport and the plurality of non-primary viewports are in the same display interface; The synchronous viewport is selected from the plurality of non-primary viewports according to the scanning position of the first image sequence and the scanning position of the image sequence in each non-primary viewport.
3. The method according to claim 1, It is characterized in that The first pictures and the second pictures both have sequence identifiers, and the first pictures in the first picture sequence and the second pictures in the second picture sequence are sorted in ascending or descending order of the sequence identifiers.
4. The method according to claim 3, It is characterized in that Determining a target second picture matching the first picture to be displayed according to a slice position of the first picture to be displayed and a slice position of the second picture currently displayed includes: When the picture switching instruction indicates a forward switch, the second picture sequence is forwardly traversed with the sequence identifier of the currently displayed second picture as the starting position to determine the target second picture; wherein the forward switch is to switch the first picture in the main viewport in the order of increasing sequence identifiers; When the picture switching instruction indicates a reverse switch, the second picture sequence is traversed in reverse with the sequence identifier of the currently displayed second picture as the starting position to determine the target second picture, wherein the reverse switch is to switch the first picture in the main viewport in descending order of the sequence identifiers.
5. The method according to claim 4, It is characterized in that Determining the target second picture includes: Setting a difference variable; determining an absolute value of a difference between a slice position of a first image to be displayed and a slice position of a second image currently being traversed; When the absolute value of the difference is not a preset value, determining whether the second picture currently traversed is the second picture currently displayed; In the case that the second picture currently traversed is the second picture currently displayed, the value of the difference variable is determined to be the absolute value of the difference, and the second picture currently traversed is updated to determine the target second picture.
6. The method according to claim 5, It is characterized in that After determining whether the second picture currently being traversed is the second picture currently being displayed, the method further includes: In response to the second picture currently traversed being not the second picture currently displayed, determining whether the absolute value of the difference is less than or equal to the value of the difference variable; In response to the absolute value of the difference being less than or equal to the value of the difference variable, determining the value of the difference variable to be the absolute value of the difference, and updating the currently traversed second picture to determine the target second picture; In response to the absolute value of the difference being greater than the value of the difference variable, a second picture of a last traversal is used as the target second picture.
7. The method according to claim 5, It is characterized in that After determining the absolute value of the difference between the slice position of the first picture to be displayed and the slice position of the second picture currently traversed, the method further includes: When the absolute value of the difference is a preset value, it is determined that the currently traversed second picture is the target second picture.
8. A device for synchronous preview of multiple viewport images, It is characterized in that include: A first acquisition module, in response to monitoring a picture switching instruction of the main viewport, acquires a slice position of a first picture to be displayed in a first picture sequence corresponding to the main viewport; A second acquisition module is used to acquire a slice position of a second image currently displayed in a second image sequence corresponding to a synchronous viewport; the synchronous viewport is a viewport for synchronous preview with the main viewport; A determination module, which determines a target second picture matching the first picture to be displayed according to a slice position of the first picture to be displayed and a slice position of the second picture currently displayed; A display module displays the target second image in the synchronous viewport.
9. An electronic device, It is characterized in that include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7.
10. A computer readable medium having a computer program stored thereon, It is characterized in that When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
