Compression Method for Annotated Data, Electronic Device, and Storage Medium

By generating multi-level encoding dictionary and using continuous interval coding, the problem of low data compression and transmission efficiency in the prior art is solved, and efficient data compression and local operation support is achieved.

CN112800264BActive Publication Date: 2025-05-30WUHAN ZHONGKE IND RES INST OF MEDICAL SCI CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202011622385.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-30
Publication Date
2025-05-30
Estimated Expiration
2041-05-30

AI Technical Summary

Technical Problem

The prior art is inefficient in the compression and transmission of medical image labeled data. Direct transmission of original data takes a long time and the encoding speed of lossless encoding methods is slow, and local changes require re-encoding, resulting in low operational efficiency.

Method used

By obtaining the label data of the original image, using the label label value and the first dimension value of the pixel position as the index, the label data is encoded, and a multi-level encoding dictionary is generated, and the continuous interval start and terminating values ​​of the second dimension value are encoded to realize the compression of the data.

Benefits of technology

It improves the compression and coding efficiency of labeled data, reduces the space and time required for storage and transmission, and supports local updates and rendering, improving operational efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112800264B_ABST
    Figure CN112800264B_ABST
Patent Text Reader

Abstract

The present application relates to a method for compressing labeled data, an electronic device, and a storage medium. The method for compressing labeled data includes: obtaining labeled data of an original image, where the labeled data includes: the pixel position and the labeled tag value of the labeled tag, and the pixel position of the labeled tag includes a first dimension value and a second dimension value; encoding the labeled data with the labeled tag value and the first dimension value as indexes to obtain a multi-level encoding dictionary, where the second dimension value includes one or more continuous intervals, and the encoded value of the second dimension value is represented by the starting value and the ending value of each continuous interval. Through the present application, the problem of low efficiency in the compression and transmission processing of labeled data in the prior art is solved, and the efficiency of the compression and transmission processing of labeled data is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing, and in particular, to a method for compressing labeled data, an electronic device, and a storage medium. Background Art

[0002] In the process of processing common medical image labeled data, there are mainly the following two forms of existing medical image labeled data transmission: (1) directly transmit the original three-dimensional volume data; (2) compress the labeled data using an encoding algorithm and then transmit it. However, both of these methods have the following deficiencies:

[0003] The first transmission method consumes a large amount of storage space and a long transmission time due to the large amount of labeled data, resulting in low transmission efficiency.

[0004] The second transmission method usually uses two encoding methods: lossy encoding and lossless encoding. In order to keep the original labeled data consistent with the data after encoding and decoding, the lossless encoding method is usually adopted. However, the encoding process of the commonly used lossless encoding methods all requires statistics and two operations of generating codes, and the encoding speed is relatively slow. Moreover, when the original labeled data changes locally, all the data needs to be re-encoded, resulting in low operation efficiency. Summary of the Invention

[0005] In this embodiment, a method for compressing labeled data, an electronic device, and a storage medium are provided to solve the problem of low efficiency in compressing and transmitting labeled data in the prior art.

[0006] In a first aspect, in this embodiment, a method for compressing labeled data is provided, including: obtaining labeled data of an original image, where the labeled data includes: pixel positions of a labeled label and a labeled label value, and the pixel positions of the labeled label include a first dimension value and a second dimension value; encoding the labeled data with the labeled label value and the first dimension value as indexes to obtain a multi-level encoding dictionary, where the second dimension value includes one or more continuous intervals, and the encoded value of the second dimension value is represented by the start value and the end value of each continuous interval.

[0007] In some of these embodiments, the pixel positions of the labeled label include: row numbers and column numbers of the pixel positions; where, when the first dimension value is the row number of the pixel position, the second dimension value is the column number of the pixel position; when the first dimension value is the column number of the pixel position, the second dimension value is the row number of the pixel position.

[0008] In some of these embodiments, the annotation data is encoded using the annotation label value and the first dimension value as indices to obtain a multi-level encoding dictionary, which includes: using the annotation label value as the first-level index and the first dimension value as the second-level index to generate the multi-level encoding dictionary, where the encoded value of the second-level index includes the start value and the end value of each continuous interval of the second dimension value.

[0009] In some of these embodiments, the original image is a three-dimensional image, and the pixel position of the annotation label further includes a third dimension value; encoding the annotation data using the annotation label value and the first dimension value as indices to obtain a multi-level encoding dictionary further includes: encoding the annotation data using the annotation label value, the third dimension value, and the first dimension value as indices to obtain the multi-level encoding dictionary.

[0010] In some of these embodiments, encoding the annotation data using the annotation label value, the third dimension value, and the first dimension value as indices to obtain the multi-level encoding dictionary includes: using the annotation label value as the first-level index, the third dimension value as the second-level index, and the first dimension value as the third-level index to generate the multi-level encoding dictionary, where the encoded value of the third-level index includes the start value and the end value of each continuous interval of the second dimension value.

[0011] In some of these embodiments, the method further includes: after the pixel position of the annotation label is locally updated, generating new encoded data for the annotation label based on the newly obtained pixel position after local update; querying the encoded data corresponding to the annotation label in the multi-level encoding dictionary, and updating the queried encoded data according to the new encoded data to obtain a new multi-level encoding dictionary.

[0012] In some of these embodiments, the method further includes: generating an initial annotation result with the same resolution as the original image; determining the annotation data to be rendered; querying the target pixel position indexed by the annotation label value of the annotation data to be rendered in the multi-level encoding dictionary; replacing the pixel value at the target pixel position in the initial annotation result with a preset pixel value to obtain the annotation result of the annotation data to be rendered, where the preset pixel value is determined based on the annotation label value.

[0013] In some of these embodiments, the annotation data to be rendered includes annotation data with one annotation label value, or multiple annotation data labeled with different annotation label values.

[0014] In a second aspect, an electronic device is provided in this embodiment, which includes a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to execute the compression method of the labeled data described in the first aspect.

[0015] In a third aspect, a storage medium is provided in this embodiment. A computer program is stored in the storage medium, wherein the computer program is configured to execute the compression method of the labeled data described in the first aspect when running.

[0016] Compared with the related art, in the compression method, electronic device, and storage medium of the labeled data provided in this embodiment, by using the tag value and the first-dimensional value of the labeled tag pixel position as indexes, the labeled data is encoded into a multi-level coding dictionary, and the start value and end value of the second-dimensional value of the labeled tag pixel position are used to represent the second-dimensional values of the entire continuous interval, thereby realizing the compression coding of the image; and compared with the lossless coding scheme adopted in the related art, the compression rate of the multi-level coding dictionary is not affected by the character occurrence probability, so there is no need to perform character statistics before coding, which improves the compression coding efficiency. In addition, in the multi-level coding dictionary, the labeled data is stored hierarchically according to the tag value and the labeled pixel position, so that the labeled data can be transmitted, locally modified, or locally rendered in units of labeled tags.

[0017] The details of one or more embodiments of the present application are set forth in the following drawings and description to make the other features, objects, and advantages of the present application more comprehensible. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The drawings described herein are used to provide a further understanding of the present application and form a part of the present application. The illustrative embodiments and descriptions thereof are used to explain the present application and do not constitute an improper limitation of the present application. In the drawings:

[0019] Figure 1 is a schematic structural diagram of a CT system according to an embodiment of the present application;

[0020] Figure 2 is a schematic hardware structure diagram of an electronic device according to an embodiment of the present application;

[0021] Figure 3 is the flow of the compression method of the labeled data according to an embodiment of the present application Figure 1 ;

[0022] Figure 4 is the flow of the compression method of the labeled data according to an embodiment of the present application Figure 2 ;

[0023] Figure 5 is a flowchart of the local modification method of a preferred embodiment according to an embodiment of the present application. Detailed implementation manners

[0024] To understand the purpose, technical solution and advantages of the present application more clearly, the present application will be described and illustrated below with reference to the accompanying drawings and embodiments.

[0025] Unless otherwise defined, the technical terms or scientific terms involved in the present application shall have the general meanings understood by those with ordinary skills in the technical field to which the present application belongs. In the present application, words such as "a", "one", "a kind of", "the", "these" and the like do not indicate a limitation in quantity, and they can be singular or plural. The terms "include", "comprise", "have" and any variants thereof involved in the present application are intended to cover non-exclusive inclusion; for example, a process, method, system, product or device including a series of steps or modules (units) is not limited to the listed steps or modules (units), but may include unlisted steps or modules (units), or may include other steps or modules (units) inherent in these processes, methods, products or devices. The terms "connection", "connection", "coupling" and the like involved in the present application are not limited to physical or mechanical connections, but may include electrical connections, whether directly or indirectly connected. The "plurality" involved in the present application means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" may represent: A exists alone, A and B exist simultaneously, and B exists alone. Usually, the character " / " indicates that the objects associated before and after are an "or" relationship. The terms "first", "second", "third" and the like involved in the present application only distinguish similar objects and do not represent a specific sorting of the objects.

[0026] The method for compressing labeled data, electronic device or computer-readable storage medium involved in the present application can be used for processing the labeled data of medical images in any modality. The electronic device provided in the embodiments of the present application can be applied to a medical image processing system, and the medical image processing system can include a medical image scanning device and an electronic device.

[0027] Among them, the medical image scanning device can be any one or more of a magnetic resonance system (MR system), a positron emission tomography system (PET system), a positron emission tomography-magnetic resonance multimodal hybrid system (PET-MR system), a computed tomography system (CT system), an X-ray scanning system, etc.

[0028] Hereinafter, the embodiments of the present application will be described and illustrated by taking the medical image scanning device as a CT system as an example.

[0029] In this embodiment, the CT system includes an examination table 110 and a scanning component 120. Among them, the examination table 110 is adapted to carry the person to be examined. The examination table 110 can move so that the part of the person to be examined is moved to a position suitable for detection, such as Figure 1 the position marked as 200 in the figure. The scanning component 120 has a radiation source 121 and a detector 122.

[0030] The radiation source 121 can be configured to emit radiation to the part of the person to be examined to generate scan data for a medical image. The part of the person to be examined may include substances, tissues, organs, samples, bodies, or the like, or any combination thereof. In some embodiments, the part of the person to be examined may include a patient or a part thereof, that is, it may include the head, chest, lungs, pleura, mediastinum, abdomen, large intestine, small intestine, bladder, gallbladder, triple energizer, pelvic cavity, bone shaft, end, skeleton, blood vessels, or the like, or any combination thereof. The radiation source 121 is configured to generate X-rays or other types of radiation. The radiation can pass through the part of the person to be examined. After passing through the part of the person to be examined, it is received by the detector 122.

[0031] The radiation source 121 may include a radiation generator. The radiation generator may include one or more X-ray tubes. The X-ray tubes can emit radiation or a radiation beam. The radiation source 121 can be an X-ray tube, a cold cathode ion tube, a high-vacuum hot cathode tube, a rotating anode tube, etc. The shape of the emitted radiation beam can be linear, narrow pencil-shaped, narrow fan-shaped, fan-shaped, conical, wedge-shaped, or the like, or an irregular shape, or any combination thereof. The fan angle of the radiation beam can be a certain value within the range of 20° to 90°. The X-ray tubes in the radiation source 121 can be fixed in one position. In some cases, the X-ray tubes can be translated or rotated.

[0032] The detector 122 can be configured to receive radiation from the radiation source 121 or other radiation sources. The radiation from the radiation source 121 can pass through the person to be examined and then reach the detector 122. After receiving the radiation, the detector 122 generates a detection result containing the radiation image of the person to be examined. The detector 122 includes a radiation detector or other components. The shape of the radiation detector can be flat, bow-shaped, circular, or the like, or any combination thereof. The fan angle range of the bow-shaped detector can be 20° to 90°. The fan angle can be fixed or adjustable according to different situations. Different situations include the desired image resolution, image size, sensitivity of the detector, stability of the detector, or the like, or any combination thereof. In some embodiments, the pixels of the detector can be the number of the smallest detection units, such as the number of detector units (e.g., scintillators or photoelectric sensors, etc.). The pixels of the detector can be arranged in a single row, a double row, or another number of rows. The radiation detector is one-dimensional, two-dimensional, or three-dimensional.

[0033] The CT system further includes a scan control device and an image generation device. Among them, the scan control device is configured to control the examination bed 110 and the scan component 120 to perform a scan. The image generation device is used to generate a medical image according to the detection result of the detector 122.

[0034] Since the scan component 120 often emits rays during a scan, in some embodiments, in order to prevent the operator of the CT system from being exposed to these radiations, the image generation device can be arranged in a room different from the scan component 120, so that the operator of the CT system can be in another room, avoiding being irradiated by the rays and being able to generate and observe the scan result through the image generation device.

[0035] The electronic device of this embodiment includes a processor 211, a memory 212 storing computer program instructions, and a display device 214.

[0036] The above-mentioned processor 211 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured as one or more integrated circuits implementing the embodiments of the present application.

[0037] In some of these embodiments, the processor 211 may be configured to: obtain the annotation data of the original image, where the annotation data includes: the pixel position and the annotation label value of the annotation label, and the pixel position of the annotation label includes a first dimension value and a second dimension value; use the annotation label value and the first dimension value as indexes to encode the annotation data to obtain a multi-level encoding dictionary, where the second dimension value includes one or more continuous intervals, and the encoded value of the second dimension value is represented by the start value and the end value of each continuous interval.

[0038] In some of these embodiments, the pixel position of the annotation label includes: the row number and the column number of the pixel position; where, when the first dimension value is the row number of the pixel position, the second dimension value is the column number of the pixel position; when the first dimension value is the column number of the pixel position, the second dimension value is the row number of the pixel position.

[0039] In some of these embodiments, the processor 211 may be configured to: use the annotation label value as the first-level index and the first dimension value as the second-level index to generate a multi-level encoding dictionary, where the encoded value of the second-level index includes the start value and the end value of each continuous interval of the second dimension value.

[0040] In some of these embodiments, the original image is a three-dimensional image, and the pixel position of the annotation label further includes a third-dimensional value; the processor 211 may further be configured to: encode the annotation data using the annotation label value, the third-dimensional value, and the first-dimensional value as indexes to obtain a multi-level encoding dictionary.

[0041] In some of these embodiments, the processor 211 may be configured to: use the annotation label value as the first-level index, the third-dimensional value as the second-level index, and the first-dimensional value as the third-level index to generate a multi-level encoding dictionary, wherein the encoded value of the third-level index includes the start value and the end value of each continuous interval of the second-dimensional value.

[0042] In some of these embodiments, the processor 211 may further be configured to: after the pixel position of the annotation label is locally updated, generate new encoded data of the annotation label according to the newly obtained pixel position after the local update; query the encoded data corresponding to the annotation label in the multi-level encoding dictionary, and update the queried encoded data according to the new encoded data to obtain a new multi-level encoding dictionary.

[0043] In some of these embodiments, the processor 211 may further be configured to: generate an initial annotation result with the same resolution as the original image; determine the annotation data to be rendered; query the target pixel position in the multi-level encoding dictionary using the annotation label value of the annotation data to be rendered as the index; replace the pixel value at the target pixel position in the initial annotation result with a preset pixel value to obtain the annotation result of the annotation data to be rendered, wherein the preset pixel value is determined based on the annotation label value.

[0044] In some of these embodiments, the annotation data to be rendered includes annotation data having one annotation label value, or multiple annotation data labeled with different annotation label values.

[0045] The memory 212 may include a mass storage for data or instructions. By way of example and not limitation, the memory 212 may include a hard disk drive (HDD), a floppy disk drive, a solid state drive (SSD), a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive, or a combination of two or more of these. Where appropriate, the memory 212 may include removable or non-removable (or fixed) media. Where appropriate, the memory 212 may be internal or external to the data processing device. In a particular embodiment, the memory 212 is non-volatile memory. In a particular embodiment, the memory 212 includes a read-only memory (ROM) and a random access memory (RAM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically alterable ROM (EAROM), or a flash memory, or a combination of two or more of these. Where appropriate, the RAM may be a static random-access memory (SRAM) or a dynamic random access memory (DRAM), where the DRAM may be a fast page mode dynamic random access memory (FPMDRAM), an extended data out dynamic random access memory (EDODRAM), a synchronous dynamic random-access memory (SDRAM), etc.

[0046] The memory 212 can be used to store or cache various data files (such as medical images, operating systems, original annotation data, original medical images, etc.) required for processing and / or communication, as well as possible computer program instructions executed by the processor 211.

[0047] The processor 211 reads and executes the computer program instructions stored in the memory 212 to implement the method for compressing annotation data according to the embodiments of the present application.

[0048] In some of the embodiments, the computer device may further include a communication interface 213 and a bus 210. Among them, as Figure 2 shown, the processor 211, the memory 212, the communication interface 213, and the display device 214 are connected through the bus 210 and complete communication with each other.

[0049] The communication interface 213 is used to implement communication between the various modules, devices, units, and / or devices in this embodiment. The communication interface 213 can also implement data communication with other components such as external devices, medical imaging scanning devices, databases, external storage, and image / data processing workstations, etc.

[0050] The bus 210 includes hardware, software, or both, and couples components of a computer device to each other. The bus 210 includes at least one of the following, including but not limited to: a data bus, an address bus, a control bus, an expansion bus, a local bus. By way of example and not limitation, the bus 210 may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an InfiniBand interconnect, a Low Pin Count (LPC) bus, a memory bus, a Micro Channel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local Bus (VLB) bus, or other suitable bus or a combination of two or more of these. In a suitable case, the bus 210 may include one or more buses. Although embodiments of the present application describe and illustrate specific buses, the present application contemplates any suitable bus or interconnect.

[0051] The computer device may execute the compression method for annotation data provided in this embodiment based on the obtained annotation data.

[0052] In addition, embodiments of the present application may be implemented by providing a computer-readable storage medium. Computer program instructions are stored on the computer-readable storage medium; when the computer program instructions are executed by a processor, the compression method for annotation data provided in this embodiment is implemented.

[0053] In this embodiment, a compression method for annotation data is provided. Figure 3 is a flowchart of the compression method for annotation data in this embodiment, asFigure 3 As shown, the process includes the following steps:

[0054] Step S301: Obtain the annotation data of the original image. The annotation data includes the pixel positions and annotation label values of the annotation labels. The pixel positions of the annotation labels include the first dimension value and the second dimension value.

[0055] Among them, in a two-dimensional image, the pixel position is represented by the row number and column number of the pixel in the image. The first dimension value and the second dimension value are respectively one of the row number and column number of the pixel position and the other. For example, in some embodiments, the first dimension value is the row number, and the second dimension value is the column number; in other embodiments, the first dimension value is the column number, and the second dimension value is the row number.

[0056] Step S302: Encode the annotation data using the annotation label value and the first dimension value as indexes to obtain a multi-level coding dictionary. The second dimension value includes one or more continuous intervals, and the coded value of the second dimension value is represented by the starting value and ending value of each continuous interval.

[0057] Taking the annotation data of a medical CT image as an example, after the CT image is annotated according to tissues, organs or components, a corresponding mask image can be generated on the local CT image of each annotated tissue, organ or component, which is the annotation result. Different tissues, organs or components are distinguished by different label values, and this label value is the annotation label value; at the same time, different annotation label values correspond to different colors of the mask image, that is, the pixel values of different mask images are different.

[0058] Then, in the multi-level coding dictionary obtained by encoding the annotation data using the annotation label value and the first dimension value as indexes, the annotation label value and the first dimension value are used as key values for indexing the second dimension value, and the second dimension value is further represented by the starting value and ending value of each continuous interval to reduce the byte length occupied by the second dimension value and achieve compression coding.

[0059] In some embodiments, the multi-level coding dictionary is encoded in the following form, for example:

[0060] {annotation label value: {first dimension value: [starting value 1 of the second dimension value, ending value 1 of the second dimension value], [starting value 2 of the second dimension value, ending value 2 of the second dimension value]}}.

[0061] Among them, the results queried according to the annotation label value z include all pixel positions in the original image where the annotation result (mask image) corresponding to this annotation label value z is marked. These pixel positions are further hierarchically encoded into a multi-level encoding dictionary according to row and column numbers. For example, when the first dimension value is the row number of the pixel position and the second dimension value is the column number of the pixel position, the first dimension value of x represents the x-th row of pixels in the original image; the encoded value [y1:y2] indexed by the first dimension value represents that the pixels from the y1-th to the y2-th column in the x-th row of pixels in the original image all belong to the pixel positions of the mask image with the annotation label value z. The above encoding method represents the consecutive column numbers from y1 to y2 in the form of [starting value: ending value], reducing the number of characters occupied by the encoded value and achieving the compression encoding of the annotation data.

[0062] In the embodiments of the present application, the method of using a multi-level encoding dictionary for compression encoding, compared with the lossless encoding algorithms such as Huffman encoding and string table encoding used in the related art, does not require character statistics before encoding; and, since the mask image is usually a color block with a certain area, therefore, using the starting value and the ending value of the second dimension value as the encoded value of the second dimension value not only achieves lossless compression, but also can obtain a high compression ratio, and the complexity of the compression process is low, with high processing efficiency. In the above embodiments, the position of the annotation label in the image is described by the row number and the column number, making the position of the annotation label clearer, more conducive to finding the range where the annotation label is located, and also accelerating the speed of compressing the annotation data, thereby improving the compression efficiency of the annotation data.

[0063] In some of these embodiments, the annotation data is encoded with the annotation label value and the first dimension value as indexes, and the obtained multi-level encoding dictionary includes: using the annotation label value as the first-level index and the first dimension value as the second-level index to generate a multi-level encoding dictionary, where the encoded value of the second-level index includes the starting value and the ending value of each continuous interval of the second dimension value.

[0064] The above embodiments use the annotation label value as the first-level index of the multi-level encoding dictionary and the first dimension value as the second-level index of the multi-level encoding dictionary to generate a multi-level encoding dictionary, which is equivalent to determining the directory in the dictionary, helping to orderly store the information required to determine the image in the multi-level encoding dictionary, and also helping to achieve rapid content search. Using the starting value and the ending value of each continuous interval to represent the second dimension value and using it as the encoded value of the second-level index, instead of recording the pixel positions of the annotation labels in this area one by one, greatly saves space and time resources.

[0065] It should be noted that the encoding method of the multi-level encoding dictionary is not limited to generating the multi-level encoding dictionary with the labeled tag value as the first-level index and the first-dimensional value as the second-level index. For example, in some embodiments, the multi-level encoding dictionary can also be generated in a way that uses the first-dimensional value as the first-level index and the labeled tag value as the second-level index, which can also achieve the compression encoding of the labeled data to a certain extent. In addition, when using the labeled tag value and the first-dimensional value as the index encoding, the multi-level encoding dictionary is not limited to only two levels of encoding. For example, parameters such as the unique identifier of the original image and the scanning time can also be added for more levels of encoding. For example, when encoding the labeled data of medical scan images of different parts of the same patient into a multi-level encoding dictionary, the patient's identity identifier and the scanning part identifier can also be used as the level indexes of the multi-level encoding dictionary.

[0066] In the case where the original image is a two-dimensional image, each pixel in the two-dimensional image includes two-dimensional values in the image coordinate system, namely the first-dimensional value and the second-dimensional value. The image coordinate system includes the i-axis and the j-axis. The upper left corner of the two-dimensional image can be used as the coordinate origin, the i-axis points horizontally to the right of the two-dimensional image, and the j-axis points downward of the two-dimensional image. Then the first-dimensional value and the second-dimensional value are respectively the i-axis coordinate value and the j-axis coordinate value of the pixel in the image coordinate system.

[0067] In the case where the original image is a three-dimensional image, each voxel in the three-dimensional image includes three-dimensional values in the image coordinate system, namely the first-dimensional value, the second-dimensional value, and the third-dimensional value. The image coordinate system includes the i-axis, the j-axis, and the k-axis. The upper left corner of the three-dimensional image can be used as the coordinate origin, the i-axis points horizontally to the right of the three-dimensional image, the j-axis points downward of the three-dimensional image, and the direction of the k-axis conforms to the right-hand rule. Then the first-dimensional value, the second-dimensional value, and the third-dimensional value are respectively the i-axis coordinate value, the j-axis coordinate value, and the k-axis coordinate value of the voxel in the image coordinate system.

[0068] In this embodiment, the third-dimensional value of the three-dimensional image can also be used as an index of the multi-level encoding dictionary, so as to generate a multi-level encoding dictionary for the entire three-dimensional image. For example, when encoding the labeled data of the three-dimensional image, the labeled data can be encoded with the labeled tag value, the third-dimensional value, and the first-dimensional value as the indexes to obtain the multi-level encoding dictionary. Specifically, the labeled tag value can be used as the first-level index, the third-dimensional value can be used as the second-level index, and the first-dimensional value can be used as the third-level index to generate the multi-level encoding dictionary. Among them, the encoded value of the third-level index includes the start value and the end value of each continuous interval of the second-dimensional value.

[0069] Through the above method, the position information and the label information of the labeled data are orderly stored in the multi-level encoding dictionary, realizing the compression of the image, reducing the complexity of the compression of the labeled data, and thus improving the efficiency of the compression of the labeled data.

[0070] Another advantage of using a multi - level encoded dictionary to encode and label data is that the labeled data after multi - level encoding can be locally updated, locally transmitted, and locally rendered. For example, in some cases, the labeled data corresponding to a certain labeled tag may be manually adjusted. For example, a small piece is removed from the corresponding mask image, or an image is added to the mask image. Taking the local update of the labeled data of a two - dimensional image as an example, when the pixel position of the labeled tag is locally updated, new encoded data can be generated according to the newly obtained pixel position after local update. Then, all qualified encoded data can be queried in the multi - level encoded dictionary using the labeled tag value as the index. Then, the queried encoded data is updated with the new encoded data, thereby locally updating the multi - level encoded dictionary to obtain a new multi - level encoded dictionary.

[0071] Among them, when a certain first - dimension value of the pixel position of the updated labeled tag cannot be queried in the old multi - level encoded dictionary, the index value corresponding to this first - dimension value is newly created; for the pixel position of the updated labeled tag that can be queried in the old multi - level encoded dictionary, the encoded value of the queried second - dimension value is replaced with the new encoded value; for the pixel position of the updated labeled tag that can be queried in the old multi - level encoded dictionary, and when there is no corresponding encoded value in the new encoded value, the corresponding encoded value in the old multi - level encoded dictionary is set to a null value or deleted.

[0072] Similarly, when the multi - level encoded dictionary needs to be transmitted to a device at the other end, if the device at the other end has received the old multi - level encoded dictionary, only the labeled data with updates can be encoded as new encoded values and then transmitted to the device at the other end, thereby reducing the amount of data required for transmission and improving efficiency. Or when the device at the other end only needs the labeled data corresponding to some labeled tags, only the labeled data required by the other end can be encoded as a local multi - level encoded dictionary, or the encoded values corresponding to the partial labeled tags required by the device at the other end are intercepted from the multi - level encoded dictionary to generate a local multi - level encoded dictionary and then transmitted to the device at the other end, reducing the amount of data required for transmission and improving efficiency.

[0073] Similarly, when it is necessary to render and display the labeled data, the labeled data corresponding to some labeled tags can be queried and decoded from the multi - level encoded dictionary, and then this part of the labeled data is rendered to obtain the rendering result of some labeled tags, without having to render all the labeled tags, improving the rendering efficiency.

[0074] For example, the rendering of partial annotation labels can be performed in the following manner: generating an initial annotation result with the same resolution as the original image; determining the annotation data to be rendered; querying in a multi-level encoding dictionary for the target pixel positions indexed by the annotation label values of the annotation data to be rendered; replacing the pixel values at the target pixel positions in the initial annotation result with preset pixel values to obtain the annotation result of the annotation data to be rendered, where the preset pixel values are determined based on the annotation label values.

[0075] When decoding the multi-level encoding dictionary encoding, first generate an initial annotation result with the same resolution as the original image. This initial annotation result can be a single-value image. For example, if the RGB value of each pixel on the image is (255, 255, 255), then the initial annotation result is a blank image. This is beneficial for subsequent decoding of the multi-level encoding dictionary to restore the identification data corresponding to the original image one by one. Then, based on the annotation data to be rendered, obtain the annotation label values and annotation data of the annotation data to be rendered. This step is used in subsequent steps to determine the first-dimensional value and the second-dimensional value corresponding to the annotation label according to the annotation label value, so that in the newly generated single-value image, the pixel positions belonging to the same annotation label can be determined, and the annotation label values of these pixel positions can be modified. When the original image is a multi-layer image, first generate multi-layer single-value images, and fill the newly generated multi-layer single-value images layer by layer according to the content of the multi-level encoding dictionary.

[0076] In some of the embodiments, the annotation data to be rendered includes annotation data with one annotation label value, or multiple annotation data labeled with different annotation label values.

[0077] The following describes and illustrates this embodiment through preferred embodiments.

[0078] Figure 4 is a preferred flowchart of the compression method for the annotation data of this embodiment, as Figure 4 shown. The compression method for the annotation data includes the following steps:

[0079] Step S401, the user annotates the data.

[0080] Step S402, encode the annotation result. The encoding method is to traverse the three-dimensional result (DHW) after annotation, find the area containing the annotation in the first two dimensions, and find the starting coordinate and ending coordinate of the annotation in the third dimension. Finally, convert the three-dimensional image into a multi-level encoding dictionary.

[0081] Step S403, transmit the encoded result to the receiving end.

[0082] In some of these embodiments, the receiving end can flexibly and efficiently render the annotation results according to the multi-level coding dictionary, and can render only the annotation results at specified positions or with specified tags, or can also render the original annotation data.

[0083] Step S404: For the annotation results that need to be locally modified and transmitted, the user can perform local coding on the medical image annotation results, and can transmit them after locally updating the coded results.

[0084] In some of these embodiments, as Figure 5 shown, the specific step operations are as follows:

[0085] Step S4041: Obtain the new annotation data obtained after local update.

[0086] Step S4042: Encode the new annotation data obtained after local update to obtain new local coded data.

[0087] Step S4043: In the overall coded data, update the updated coded data to the new local coded data to obtain the edited overall coded data, that is, the new multi-level coding dictionary.

[0088] For example, in some cases, when the original annotation data needs to be modified, added, or deleted, first, encode the updated annotation data to obtain new local coded data. Second, according to the tags and regions corresponding to the updated annotation data, query the corresponding coded data from the overall coded data, and then replace the updated coded data with the new local coded data to obtain the edited overall coded data. Of course, if new annotation data needs to be added, only need to query the corresponding tag position in the overall coded data according to the tag value corresponding to the added annotation data, and create a new index to store the corresponding coded value. Similarly, if some content of the original annotation data needs to be deleted, query the corresponding tag position in the overall coded data according to the tag value corresponding to the new annotation data obtained after update, and delete the relevant region. In this way, when the original annotation data locally changes, there is no need to re-encode all the data, and only the local area needs to be operated, which helps to achieve local compression coding, thereby improving the compression and transmission processing efficiency of the annotation data.

[0089] Step S405: During decoding, first initialize a blank annotation with all backgrounds according to the annotation size, and then modify the pixel values in the corresponding interval according to the coding dictionary.

[0090] In some of these embodiments, the user can decode only the annotation results of specific tags or the annotation results of specific positions according to the requirements.

[0091] In some cases, if only the annotation result of a specific label in the original annotation data needs to be decoded, first, according to the label corresponding to the specific annotation result, the area corresponding to this label is queried in the overall coded data, and then the corresponding coded value is obtained from this area, and finally the coded value of the area is decoded. Similarly, when only the annotation result of a specific position needs to be decoded, first, according to the pixel position corresponding to the annotation result of the specific position, including multiple intervals on the first dimension value and the second dimension value, in the overall coded data, from the multiple coded values ​​corresponding to the first dimension value, the coded value corresponding to the interval position specified in the direction of the second dimension value is queried, and then decoded. It should be noted that if the specific position only contains the first dimension value, all the coded values ​​corresponding to the first dimension value are queried from the overall coded data, and then decoded. Similarly, if the specific position is located in the direction of the second dimension value, the specific position is first encoded as a coded value, and then all the coded values ​​consistent with the coded value corresponding to the specific position are queried from the overall coded data. At this time, the coded value includes the coded values ​​corresponding to multiple first dimension values ​​of different labels, and finally decoded. In this way, only the annotation results of specific tags or specific positions can be decoded according to needs, which increases the flexibility of the multi-level encoding dictionary and thus improves the operability of the annotation data.

[0092] In some embodiments, the input of the encoding algorithm is the annotation result to be encoded and the label type to be encoded. If not specified, all annotation results are encoded. The algorithm traverses the three-dimensional image and finds the non-repeated position of the pixel to be encoded in the annotation data of the last dimension. If it is a set encoding label, the non-repeated position is stored in the set dictionary structure.

[0093] First, the annotation data is encoded into a multi-level encoding dictionary, which helps to save time and space resources. In this embodiment, the first level of the multi-level encoding dictionary is the annotation result category contained in the annotation data. The second level is the first-dimensional coordinates of the corresponding annotation area. The third level is the second-dimensional coordinates of the corresponding annotation area. The fourth level is the data composed of the starting position and the ending position of the corresponding annotation area.

[0094] Taking the medical scenario as an example, suppose that after outlining a CT image in DICOM format with N layers, the following dictionary is formed: {1:{3:{6:[123,136]}}}, which specifically means that the annotation label value corresponding to the annotation label in the coordinate interval [123,136] of the sixth row of the third layer is 1.

[0095] In the above steps, only the annotation results are encoded into a multi-level coding dictionary, which improves the compression efficiency of the annotation data. Then, the multi-level coding dictionary is transmitted, saving a large amount of time and space resources and improving the compression and transmission efficiency of the annotation data. When partial modification of the original data is required, only the partial data needs to be compressed and replaced, instead of re-encoding all the data, which improves the operation efficiency. Finally, during decoding, the newly generated image is filled layer by layer according to the dictionary structure, and the data exactly the same as that before compression can be obtained, thus realizing lossless compression transmission and improving the compression and transmission efficiency of the annotation data.

[0096] It should be noted that the steps shown in the above process or the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. And although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than here. For example, step S403 and step S404 can be interchanged.

[0097] In this embodiment, an electronic device is further provided, including a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0098] Optionally, the above electronic device may further include a transmission device and an input / output device. Among them, the transmission device is connected to the above processor, and the input / output device is connected to the above processor.

[0099] Optionally, in this embodiment, the above processor may be configured to execute the following steps through a computer program:

[0100] S1, obtain the annotation data of the original image. Among them, the annotation data includes: the pixel position and the annotation label value of the annotation label, and the pixel position of the annotation label includes a first dimension value and a second dimension value.

[0101] S2, using the annotation label value and the first dimension value as indexes, encode the annotation data to obtain a multi-level coding dictionary. Among them, the second dimension value includes one or more continuous intervals, and the encoded value of the second dimension value is represented by the start value and the end value of each continuous interval.

[0102] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation manners, and will not be elaborated in this embodiment.

[0103] It should be understood that the specific embodiments described here are only used to explain this application, rather than to limit it. According to the embodiments provided in this application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of this application.

[0104] Obviously, the accompanying drawings are only some examples or embodiments of the present application. For those of ordinary skill in the art, the present application can also be applied to other similar situations based on these drawings without creative efforts. Additionally, it can be understood that although the work done during the development process here may be complex and time-consuming, for those of ordinary skill in the art, certain design, manufacturing, or production changes based on the technical content disclosed in the present application are only routine technical means and should not be regarded as insufficient disclosure of the present application.

[0105] The term "embodiment" in this application means that the specific features, structures, or characteristics described in connection with the embodiments may be included in at least one embodiment of the present application. The phrase appears in various positions in the specification and does not necessarily mean the same embodiment, nor does it mean being independent or alternative to other embodiments and mutually exclusive. Those of ordinary skill in the art can clearly or implicitly understand that the embodiments described in this application can be combined with other embodiments without conflict.

[0106] The above-described embodiments only represent several implementation manners of the present application, and the description is relatively specific and detailed, but it should not be construed as a limitation on the scope of patent protection. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all fall within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.

Claims

1. A method for compressing labeled data, characterized in that, it includes: Obtain the labeled data of the original image, where the labeled data includes: the pixel positions of the labeled tags and the labeled tag values, the labeled tag values corresponding to the colors of the mask images of the original image, and the pixel positions of the labeled tags include the first dimension value and the second dimension value of the pixels of the mask image in the original image; Using the labeled tag value and the first dimension value as indexes, encode the labeled data to obtain a multi-level encoding dictionary, where the second dimension value includes one or more continuous intervals, and the encoded value of the second dimension value is represented by the start value and the end value of each continuous interval; The method further includes: After the pixel position of the labeled tag is locally updated, generate new encoded data for the labeled tag according to the new pixel position obtained after the local update; Query the encoded data corresponding to the labeled tag in the multi-level encoding dictionary, and update the queried encoded data according to the new encoded data to obtain a new multi-level encoding dictionary; Among them, when the first dimension value of the pixel position of the updated labeled tag cannot be queried in the old multi-level encoding dictionary, a corresponding index value for the first dimension value is newly created; for the pixel position of the updated labeled tag that can be queried in the old multi-level encoding dictionary, replace the encoded value of the queried second dimension value with the new encoded value; for the pixel position of the updated labeled tag that can be queried in the old multi-level encoding dictionary and there is no corresponding encoded value in the new encoded value, set the corresponding encoded value in the old multi-level encoding dictionary to a null value or delete it.

2. The method for compressing labeled data according to claim 1, characterized in that, The pixel positions of the labeled tags include: the row number and column number of the pixel positions; where, when the first dimension value is the row number of the pixel position, the second dimension value is the column number of the pixel position; when the first dimension value is the column number of the pixel position, the second dimension value is the row number of the pixel position.

3. The method for compressing labeled data according to claim 1, characterized in that, Encoding the labeled data using the labeled tag value and the first dimension value as indexes to obtain a multi-level encoding dictionary includes: Using the labeled tag value as the first-level index and the first dimension value as the second-level index to generate the multi-level encoding dictionary, where the encoded value of the second-level index includes the start value and the end value of each continuous interval of the second dimension value.

4. The method for compressing labeled data according to claim 1, characterized in that, The original image is a three-dimensional image, and the pixel positions of the labeled tags further include a third dimension value; encoding the labeled data using the labeled tag value and the first dimension value as indexes to obtain a multi-level encoding dictionary further includes: Encoding the labeled data using the labeled tag value, the third dimension value and the first dimension value as indexes to obtain the multi-level encoding dictionary.

5. The method for compressing labeled data according to claim 4, characterized in that, Encoding the annotation data using the annotation tag value, the third dimension value, and the first dimension value as indices to obtain the multi-level encoding dictionary, including: Generating the multi-level encoding dictionary by using the annotation tag value as the first-level index, the third dimension value as the second-level index, and the first dimension value as the third-level index, where the encoded values of the third-level index include the start value and the end value of each continuous interval of the second dimension value.

6. The method for compressing annotation data according to claim 1, wherein, the method further includes: Generating an initial annotation result with the same resolution as the original image; Determining the annotation data to be rendered; Querying in the multi-level encoding dictionary for the target pixel positions indexed by the annotation tag value of the annotation data to be rendered; Replacing the pixel values at the target pixel positions in the initial annotation result with a preset pixel value to obtain the annotation result of the annotation data to be rendered, where the preset pixel value is determined based on the annotation tag value.

7. The method for compressing annotation data according to claim 6, wherein, the annotation data to be rendered includes annotation data with one annotation tag value, or multiple annotation data labeled with different annotation tag values.

8. An electronic device, including a memory and a processor, wherein, a computer program is stored in the memory, and the processor is configured to run the computer program to execute the method for compressing annotation data according to any one of claims 1 to 7.

9. A storage medium, wherein, a computer program is stored in the storage medium, and the computer program is configured to execute the method for compressing annotation data according to any one of claims 1 to 7 when running.

Citation Information

Patent Citations

  • Labeling method, labeling device and defect inspection device

    JP2014209310A