A comparison and compression method and system for DICOM single sequence images
Through the comparison processing and data compression of DICOM single-sequence images, the problem of low storage and transmission efficiency of DICOM images is solved, and resource saving and compact data representation are achieved.
Patent Information
- Application Number
- CN202411405881.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-10
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2044-10-10
AI Technical Summary
DICOM single-sequence images take up a large amount of storage during storage and transmission, and are inefficient, and cannot effectively save resource consumption.
By reading DICOM files, splitting image data and non-image data, performing comparison processing and data compression, eliminating all-zero images, calculating and encoding image data, and using JPEG2000 and RAR/ZIP compression technology to generate the final DICOM single-sequence comparison Compress files.
It significantly reduces the storage amount of image data, improves transmission and storage efficiency, saves resource consumption, and maintains the integrity of important information.
Smart Images

Figure CN118921431B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of medical image data processing, and in particular relates to a comparison and compression method and system for DICOM single sequence images. Background Art
[0002] In recent years, with the development of medical imaging technology, intravenous ultrasound (IVUS) and optical coherence tomography (OCT) have become indispensable diagnostic equipment in the diagnosis and treatment of cardiovascular diseases. The Digital Imaging and Communications in Medicine (DICOM) images obtained from IVUS and OCT equipment, including additional information such as patient information, are sent to the Picture Archiving and Communication Systems (PACS) for process storage and management, and have been widely used in the diagnosis and treatment of cardiovascular diseases. DICOM is an international standard for medical images and related information (ISO 12052), which defines a medical image format that can be used for data exchange with quality that meets clinical needs.
[0003] In the PACS system, IVUS and OCT devices obtain dynamic DICOM images, which are sent to the DICOM image server for storage and management through communication with the DICOM image server. However, since DICOM image storage consumes a large amount of storage media, generally there are thousands of frames of DICOM image files. If no compression is performed, an image file has a data volume of more than 1GB. Therefore, the dynamic DICOM images stored in the DICOM image server will occupy a large amount of storage and have low efficiency during transmission and storage, which cannot effectively save resource consumption. Summary of the invention
[0004] In view of the above-mentioned deficiencies in the prior art, the present application provides a method and system for comparing and compressing DICOM single sequence images.
[0005] In a first aspect, the present application proposes a comparison and compression method for DICOM single sequence images, comprising the following steps:
[0006] Read the DICOM file in the specified path, split the DICOM file according to the serial number and TAG element parsing value in the DICOM file, and obtain an image data set and a non-image data set;
[0007] Performing a first type comparison process on the non-image data set according to the TAG element parsing value, removing the same TAG element parsing value therein, and packaging the remaining non-image data set and saving it as a first type DICOM file;
[0008] Converting the image data set into a single three-dimensional array through an array according to the number of sets, performing a second type of contrast processing based on the points of the three-dimensional array in the image of the image data set, eliminating all zero images therein, and forming a second type of image data set;
[0009] Calculating the point data of each image in the second type of image data set to obtain row and column identifiers and a minimum number of the images, thereby forming third type of image data, performing data compression processing on all the formed third type of image data to obtain a third type of image data set, and packaging and saving the third type of image data set as a second type of DICOM file;
[0010] The first category DICOM file and the second category DICOM file are merged, and the merged file is compressed by using a file compression technology to generate a final DICOM single sequence alignment compressed file.
[0011] In some optional implementations of some embodiments, the reading of the DICOM file under the specified path, splitting the DICOM file according to the serial number and TAG element parsing value in the DICOM file to obtain the image data set and the non-image data set includes:
[0012] The image data whose TAG element parsing value is PixelData(0x7fe0, 0x0010) in the DICOM file is read into the image data set, and the data whose other TAG element parsing values in the DICOM file are read into the non-image data set;
[0013] The image data of the image data set is subjected to single sequence judgment and the non-image data set is sorted according to the serial number InstanceNumber (0x0020, 0x0013) in the DICOM file.
[0014] In some optional implementations of some embodiments, performing a first type comparison process on the non-image data set according to the TAG element parsing value, removing the same TAG element parsing value therein, and packaging the remaining non-image data set and saving it as a first type DICOM file includes:
[0015] The TAG element parsing values of the data in the non-image data set are compared with the TAG element parsing values of the first image of the single sequence in the DICOM file, and the identical TAG element parsing values are removed and saved as the first type DICOM file.
[0016] In some optional implementations of some embodiments, converting the image data set into a single three-dimensional array through an array according to the number of sets, performing a second type of contrast processing based on the points of the three-dimensional array in the image of the image data set, eliminating all zero images therein, and forming a second type of image data set, includes:
[0017] The image data set is converted into a single three-dimensional array through an array according to the number of sets, the data with the same Z-axis point in the three-dimensional array is stored in the same image, and a single all-zero image consisting of all 0s is eliminated to form a second type of image data set.
[0018] In some optional implementations of some embodiments, the step of calculating the point data of each image in the second type of image data set to obtain row and column identifiers and a minimum number of the image, thereby forming the third type of image data, includes:
[0019] Calculating the offset of each point data of the image data in the second type of image data set relative to a preset reference value one by one, identifying data points whose offset exceeds a preset range, extracting the identified data points, and assigning new row and column identifiers to the data points;
[0020] For each non-zero data point in the two-dimensional array of the image in the second type of image data set, the minimum difference between the non-zero data point and the adjacent data point or the preset threshold is calculated, and each non-zero data point is converted into a relative representation of the minimum difference with the non-zero data point to obtain a converted two-dimensional array;
[0021] According to the converted two-dimensional array, the new row and column identifiers and the calculated minimum difference, the data of each image are recombined and encoded to form third-category image data, all the third-category image data formed are subjected to data compression processing to obtain a third-category image data set, and the third-category image data set is packaged and saved as a second-category DICOM file.
[0022] In some optional implementations of some embodiments, performing data compression processing on all the third-category image data to obtain a third-category image data set, and packaging and saving the third-category image data set as a second-category DICOM file, includes:
[0023] The third category image data is compressed using JPEG2000 encoding technology, and the third category image data compressed using JPEG2000 encoding technology is recombined into a new image data set to obtain a third category image data set, and the third category image data set is packaged and saved as a second category DICOM file.
[0024] In some optional implementations of some embodiments, the merging of the first-category DICOM file and the second-category DICOM file, and performing file compression processing on the merged file by using a file compression technology to generate a final DICOM single sequence alignment compressed file includes:
[0025] The first type of DICOM file and the second type of DICOM file are merged, and the files are compressed using RAR / ZIP compression technology to generate a final DICOM single sequence alignment compressed file.
[0026] In a second aspect, the present application proposes a comparison and compression system for DICOM single sequence images, including a data classification module, a non-image data processing module, a second type of image data processing module, a third type of image data processing module and a merging and compression module.
[0027] The data classification module is used to read the DICOM file in the specified path, split the DICOM file according to the serial number and TAG element parsing value in the DICOM file, and obtain an image data set and a non-image data set;
[0028] The non-image data processing module is used to perform a first type of comparison processing on the non-image data set according to the TAG element parsing value, remove the same TAG element parsing value therein, and package and save the remaining non-image data set as a first type DICOM file;
[0029] The second type of image data processing module is used to convert the image data set into a single three-dimensional array through an array according to the number of sets, perform a second type of contrast processing based on the points of the three-dimensional array in the image of the image data set, eliminate all zero images therein, and form a second type of image data set;
[0030] The third-category image data processing module is used to calculate the point data of each image in the second-category image data set, obtain the row and column identifiers and the minimum number of the images, thereby forming the third-category image data, perform data compression processing on all the formed third-category image data to obtain the third-category image data set, and package and save the third-category image data set as a second-category DICOM file;
[0031] The merging and compression module is used to merge the first type of DICOM file and the second type of DICOM file, and perform file compression processing on the merged file by using file compression technology to generate a final DICOM single sequence alignment compressed file.
[0032] In a third aspect, the present application proposes an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.
[0033] In a fourth aspect, the present application proposes a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.
[0034] Beneficial effects of the present invention:
[0035] Through the first type of comparison processing, the same TAG element parsing value is removed to reduce the storage occupied by the repeated TAG element parsing values of a single sequence DICOM image. By eliminating a single image composed of all 0s in the image data, a new image data set is formed to achieve the purpose of reducing the total amount of the image data set. The point data of each image in the image data is calculated to make the new image data representation more compact, which can reduce the byte occupancy without losing important information. When the processed image data is stored in the DICOM image server, the storage occupied by the image is greatly reduced, and the efficiency is higher during the transmission and storage process, effectively saving resource consumption. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 It is the overall flow chart of the present invention.
[0037] Figure 2 This is the framework diagram of this system. DETAILED DESCRIPTION
[0038] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments described herein; on the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0039] In the first aspect, the present application proposes a comparison and compression method for DICOM single sequence images, such as Figure 1 As shown, the following steps are included:
[0040] S100: Reading a DICOM file in a specified path, splitting the DICOM file according to a serial number and a TAG element parsing value in the DICOM file to obtain an image data set and a non-image data set;
[0041] In some optional implementations of some embodiments, the reading of the DICOM file under the specified path, splitting the DICOM file according to the serial number and TAG element parsing value in the DICOM file to obtain the image data set and the non-image data set includes:
[0042] The image data whose TAG element parsing value is PixelData(0x7fe0, 0x0010) in the DICOM file is read into the image data set, and the data whose other TAG element parsing values in the DICOM file are read into the non-image data set;
[0043] The image data of the image data set is judged as a single sequence and the non-image data set is sorted according to the serial number InstanceNumber (0x0020, 0x0013) in the DICOM file.
[0044] Among them, a single patient may have multiple DICOM file sets in one examination. The sequence numbers of the single sequences are the same, and the images of different sequences can be distinguished by the sequence numbers; image comparison must be performed under the same sequence, and the image difference under a single sequence is the smallest. The single sequence judgment mentioned here is to find the same sequence in the DICOM file set of multiple sequences of a single patient and put them together for DICOM standard analysis.
[0045] S200: performing a first type comparison process on the non-image data set according to the TAG element parsing value, removing the same TAG element parsing value therein, and packaging the remaining non-image data set and saving it as a first type DICOM file;
[0046] In some optional implementations of some embodiments, performing a first type comparison process on the non-image data set according to the TAG element parsing value, removing the same TAG element parsing value therein, and packaging the remaining non-image data set and saving it as a first type DICOM file includes:
[0047] The TAG element parsing values of the data in the non-image data set are compared with the TAG element parsing values of the first image of the single sequence in the DICOM file, and the identical TAG element parsing values are removed and saved as the first type DICOM file.
[0048] Among them, the same TAG element parsing value is removed, a new DICOM file is generated, and it is saved in a fixed folder, so as to reduce the storage occupied by the repeated TAG element parsing values of a single sequence DICOM image.
[0049] S300: converting the image data set into a single three-dimensional array through an array according to the number of sets, performing a second type of contrast processing based on the points of the three-dimensional array in the image of the image data set, eliminating all zero images therein, and forming a second type of image data set;
[0050] In some optional implementations of some embodiments, converting the image data set into a single three-dimensional array through an array according to the number of sets, performing a second type of contrast processing based on the points of the three-dimensional array in the image of the image data set, eliminating all zero images therein, and forming a second type of image data set, includes:
[0051] The image data set is converted into a single three-dimensional array through an array according to the number of sets, the data with the same Z-axis point in the three-dimensional array is stored in the same image, and a single all-zero image consisting of all 0s is eliminated to form a second type of image data set.
[0052] Among them, for example:
[0053] The image data set is represented as:
[0054] {[image 1] [image 2] [image 3] ... [image N]};
[0055] The three-dimensional array conversion is expressed as:
[0056] {[two-dimensional array 1] [two-dimensional array 2] ... [two-dimensional array N]}-> {[three-dimensional array]};
[0057] The Z-axis point data is combined and expressed as:
[0058] {[3D array]} -> {[merged 3D array]};
[0059] Image array conversion: {[merged three-dimensional array}]->[{all points on the Z axis where X=0, Y=0},{all points on the Z axis where X=1, Y=0}..,{all points on the Z axis where X=(original image length value - 1), Y=(original image width value - 1)}]->{[array conversion three-dimensional array]};
[0060] The image with all zeros removed is represented as:
[0061] {[Array conversion 3D array]}->{ [3D array after removing all zero images]};
[0062] The second type of image data set is expressed as:
[0063] [new image 1] [new image 2] ... [new image M] (M <= N).
[0064] S400: Calculating the point data of each image in the second type of image data set to obtain row and column identifiers and a minimum number of the images, thereby forming third type of image data, performing data compression processing on all the formed third type of image data to obtain a third type of image data set, and packaging and saving the third type of image data set as a second type of DICOM file;
[0065] In some optional implementations of some embodiments, the step of calculating the point data of each image in the second type of image data set to obtain row and column identifiers and a minimum number of the image, thereby forming the third type of image data, includes:
[0066] Calculating the offset of each point data of the image data in the second type of image data set relative to a preset reference value one by one, identifying data points whose offset exceeds a preset range, extracting the identified data points, and assigning new row and column identifiers to the data points;
[0067] For each non-zero data point in the two-dimensional array of the image in the second type of image data set, the minimum difference between the non-zero data point and the adjacent data point or the preset threshold is calculated, and each non-zero data point is converted into a relative representation of the minimum difference with the non-zero data point to obtain a converted two-dimensional array;
[0068] According to the converted two-dimensional array, the new row and column identifiers and the calculated minimum difference, the data of each image are recombined and encoded to form third-category image data, all the third-category image data formed are subjected to data compression processing to obtain a third-category image data set, and the third-category image data set is packaged and saved as a second-category DICOM file.
[0069] Among them, a single image is a two-dimensional array, and multiple images put together form a three-dimensional array;
[0070] For the image data in the second category of image data set, the offset of the data of each point (pixel) relative to a preset reference value (the reference value may be the average value, median or any other suitable reference value of the image data) is calculated one by one, and data points with large offsets are identified. These data points may represent significant features or changes in the image, and these data points with large offsets are extracted and assigned new row and column identifiers for priority processing in subsequent compression and transmission.
[0071] For each non-zero data point in the two-dimensional array of the image, the minimum difference between it and the adjacent data points or the preset threshold is calculated. This minimum difference represents the relative change of the data point relative to its surrounding environment. Each non-zero data point in the two-dimensional array of the image is converted to a relative representation with its minimum difference. This conversion can map the original data point to a smaller numerical range, thereby reducing the number of storage bits required.
[0072] A single image is a two-dimensional array, and multiple images put together form a three-dimensional array. According to the converted two-dimensional array, the new row and column identifiers, and the calculated minimum difference, the data of each image is recombined and encoded to form the third type of image data. The representation of the third type of image data is more compact, which can reduce the byte occupancy without losing important information. It provides greater convenience and efficiency for subsequent compression, transmission and storage.
[0073] For example, suppose there is a second type of image data set, which contains multiple medical images, each of which is represented in the form of a two-dimensional array. For simplicity, assume that the data of one of the images is as follows (for illustration only): [
[0075] [100, 105, 0, 0],
[0076] [102, 110, 108, 0],
[0077] [0, 107, 112, 115],
[0078] [0, 0, 114, 116] ]
[0080] The preset reference value is 100, the preset range is ±10, and the preset threshold is 5.
[0081] Step 1: Calculate offsets and identify anomalous data points
[0082] Calculate the offset of each point data relative to the reference value 100 one by one (for illustration only): [
[0084] [0, 5, -100, -100],
[0085] [2, 10, 8, -100],
[0086] [-100, 7, 12, 15],
[0087] [-100, -100, 14, 16] ]
[0089] Identify data points where the deviation exceeds ±10 (illustrative only):
[0090] (0, 1): 5;
[0091] (0, 3): -100 (but since it is 0, no processing is required);
[0092] (1, 0): 2;
[0093] (1, 1): 10;
[0094] (1, 2): 8;
[0095] (2, 1): 7;
[0096] (2, 2): 12;
[0097] (2, 3): 15;
[0098] (3, 2): 14;
[0099] (3, 3): 16;
[0100] Since the value of points such as (0,3) is 0, we don't actually need to process them. The data points that need to be processed and their new row and column identifiers are as follows (assuming that the new identifier starts from (1,1)) (for illustration only):
[0101]
Original coordinates
New coordinates
[0102] (0, 1) -> (1, 1);
[0103] (1, 0) -> (2, 1);
[0104] (1, 1) -> (2, 2);
[0105] (1, 2) -> (2, 3);
[0106] (2, 1) -> (3, 1);
[0107] (2, 2) -> (3, 2);
[0108] (2, 3) -> (3, 3);
[0109] (3, 2) -> (4, 1);
[0110] (3, 3) -> (4, 2);
[0111] Step 2: Calculate the minimum difference and transform the data points:
[0112] For each non-zero data point, calculate the minimum difference between it and the adjacent data point or the preset threshold 5 (for illustration only):
[0113] 105: adjacent to 100, 0; minimum difference is 5
[0114] 102: Adjacent numbers are 100, 105, 110; the minimum difference is 2
[0115] 110: adjacent to 105, 102, 108; the minimum difference is 2
[0116] 108: adjacent to 110, 0; minimum difference is 2
[0117] 107: Adjacent numbers are 0, 110, 112; the minimum difference is 3
[0118] 112: Adjacent numbers are 107, 110, 115; the minimum difference is 3
[0119] 115: adjacent to 112, 0; the minimum difference is 3
[0120] 114: adjacent to 0, 116; minimum difference is 2
[0121] 116: adjacent to 114, 0; minimum difference is 2
[0122] Convert each non-zero data point to its relative representation of the minimum difference (illustrative only):
[0123] [Original array] [Converted array]
[0124] 100 -> 0 (base value unchanged);
[0125] 105 -> 5 -> 1 (5-5=0, expressed as the minimum difference);
[0126] 102 -> 2 -> 0 (2-2=0);
[0127] 110 -> 10 -> 2 (10- (the smallest adjacent difference of 10-2) = 2);
[0128] 108 -> 8 -> 2 (8- (8-2's adjacent difference, 2) = 2);
[0129] 107 -> 7 -> 3 (7- (7-3's adjacent difference, 3) = 3);
[0130] 112 -> 12 -> 3 (12- (12-3's adjacent difference, 3) = 3);
[0131] 115 -> 15 -> 3 (15- (15-3's adjacent differences, take the smallest 3) = 3);
[0132] 114 -> 14 -> 2 (14- (14-2's adjacent difference, 2) = 2);
[0133] 116 -> 16 -> 2 (16- (the adjacent difference of 16-2, 2) = 2);
[0134] The converted two-dimensional array (illustrative only): [
[0136] [0, 0, -100, -100],
[0137] [0, 0, 2, -100],
[0138] [-100, 3, 3, 3],
[0139] [-100, -100, 2, 2] ]
[0141] Step 3: Reassemble and encode the image data and compress it:
[0142] Reassemble and encode the image data based on the converted 2D array, the new row and column identifiers, and the calculated minimum difference:
[0143] Reorganized data (illustrative only):
[0144]
New coordinates
value
[0145] (1, 1): 0;
[0146] (2, 1): 0;
[0147] (2, 2): 0;
[0148] (2, 3): 2;
[0149] (3, 1): 3;
[0150] (3, 2): 3;
[0151] (3, 3): 3;
[0152] (4, 1): 2;
[0153] (4, 2): 2;
[0154] Compress the above data (here we assume a simple lossless compression method):
[0155] Compressed data example (for illustration only):
[0156] "(1,1):0,1;(2,1):0,2;(2,2):2,1;(2,3):3,1 ... "
[0157] The compressed data is saved as a third-category image data set, and packaged and saved as a second-category DICOM file.
[0158] In some optional implementations of some embodiments, performing data compression processing on all the third-category image data to obtain a third-category image data set, and packaging and saving the third-category image data set as a second-category DICOM file, includes:
[0159] The third category image data is compressed using JPEG2000 encoding technology, and the third category image data compressed using JPEG2000 encoding technology is recombined into a new image data set to obtain a third category image data set, and the third category image data set is packaged and saved as a second category DICOM file.
[0160] Among them, the third type of image data after processing is compressed. In the compression process, the advanced coding technology of JPEG2000, such as discrete wavelet transform (DWT), quantization, encoding, etc., is used to effectively compress the image data. The image data after JPEG2000 compression processing is recombined into a new image data set to obtain the third type of image data set. Each image in this new set has been optimized and compressed and has a smaller byte occupancy. Each image in the third type of image data set is traversed. For each image, a new DICOM file is created, and the compressed image data and necessary DICOM tags (such as PatientID, StudyDate, etc.) are written to the file to ensure that the format and metadata of the DICOM file meet the requirements of the DICOM standard so that it can be correctly read and used in the medical image processing system. A unique file name is assigned to each DICOM file so that it can be easily identified and managed in subsequent processing and retrieval. These DICOM files are saved as second type DICOM files.
[0161] S500: merging the first-category DICOM file and the second-category DICOM file, and performing file compression processing on the merged file by using a file compression technology to generate a final DICOM single sequence alignment compressed file.
[0162] In some optional implementations of some embodiments, the merging of the first-category DICOM file and the second-category DICOM file, and performing file compression processing on the merged file by using a file compression technology to generate a final DICOM single sequence alignment compressed file includes:
[0163] The first type of DICOM file and the second type of DICOM file are merged, and the files are compressed using RAR / ZIP compression technology to generate a final DICOM single sequence alignment compressed file.
[0164] Furthermore, two commonly used compression methods are used to compare with the compression scheme of this scheme, and the results are as follows:
[0165] Compression method 1: The program obtains the single-sequence DICOM folder to be processed through parameters, which contains 145 520KB single-sequence DICOM files. It uses RAR to directly compress and generate a 26371KB compressed file with a compression rate of 34.97%;
[0166] Compression method 2: Use JPEG2000 to compress the single DICOM file in this DICOM folder to form a single 154KB DICOM file, and use RAR to directly compress it to generate a 21600KB compressed file (JPEG2000 is a compression algorithm for a single DICOM file), with a compression rate of 28.64%;
[0167] Compression method of this solution: Using this compression method for the DICOM images in this DICOM folder can generate a 16826KB file. Compared with the common compression methods 1 and 2 in the market, the compression efficiency of this solution is 22%, and the compression efficiency is significantly improved.
[0168] In the second aspect, the present application proposes a comparison and compression system for DICOM single sequence images, such as Figure 2 As shown, it includes a data classification module, a non-image data processing module, a second type of image data processing module, a third type of image data processing module and a merging and compression module.
[0169] The data classification module is used to read the DICOM file in the specified path, split the DICOM file according to the serial number and TAG element parsing value in the DICOM file, and obtain an image data set and a non-image data set;
[0170] The non-image data processing module is used to perform a first type of comparison processing on the non-image data set according to the TAG element parsing value, remove the same TAG element parsing value therein, and package and save the remaining non-image data set as a first type DICOM file;
[0171] The second type of image data processing module is used to convert the image data set into a single three-dimensional array through an array according to the number of sets, perform a second type of contrast processing based on the points of the three-dimensional array in the image of the image data set, eliminate all zero images therein, and form a second type of image data set;
[0172] The third-category image data processing module is used to calculate the point data of each image in the second-category image data set, obtain the row and column identifiers and the minimum number of the images, thereby forming the third-category image data, perform data compression processing on all the formed third-category image data to obtain the third-category image data set, and package and save the third-category image data set as a second-category DICOM file;
[0173] The merging and compression module is used to merge the first type of DICOM file and the second type of DICOM file, and perform file compression processing on the merged file by using file compression technology to generate a final DICOM single sequence alignment compressed file.
[0174] In a third aspect, the present application proposes an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.
[0175] In a fourth aspect, the present application proposes a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.
[0176] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0177] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0178] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this disclosure.
[0179] In the embodiments provided in the present disclosure, it should be understood that the disclosed apparatus / computer equipment and methods can be implemented in other ways. For example, the apparatus / computer equipment embodiments described above are merely schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation. Multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, indirect coupling or communication connection of the apparatus or unit, which may be electrical, mechanical or other forms.
[0180] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0181] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0182] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present disclosure implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. The computer program may include computer program code, and the computer program code may be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium does not include electric carrier signals and telecommunication signals.
[0183] The above are only preferred implementations of the present invention. It should be pointed out that a number of modifications and improved technical solutions made by those skilled in the art without departing from the technical solution should also be deemed to fall within the scope of protection required by the claims.
Claims
1. A comparison and compression method for DICOM single sequence images, characterized in that: The following steps are involved: Read the DICOM file under the specified path, split the DICOM file according to the serial number and TAG element parsing value in the DICOM file to obtain an image data set and a non-image data set, wherein the image data whose TAG element parsing value in the DICOM file is PixelData(0x7fe0, 0x0010) is read into the image data set, and the data of the remaining TAG element parsing values in the DICOM file is read into the non-image data set, and the image data of the image data set is judged as a single sequence and the non-image data set is sorted according to the serial number InstanceNumber(0x0020, 0x0013) in the DICOM file; Performing a first type of comparison processing on the non-image data set according to the TAG element parsing value, removing the same TAG element parsing value therein, and packaging the remaining non-image data set and saving it as a first type of DICOM file, wherein the TAG element parsing value of the data in the non-image data set is compared with the TAG element parsing value of the first image of a single sequence in the DICOM file, removing the same TAG element parsing value therein, and saving it as a first type of DICOM file; The image data set is converted into a single three-dimensional array through an array according to the number of sets, and a second type of contrast processing is performed based on the point positions of the three-dimensional array in the image of the image data set, and all-zero images therein are eliminated to form a second type of image data set, wherein the image data set is converted into a single three-dimensional array through an array according to the number of sets, and data with the same Z-axis point position in the three-dimensional array are stored in the same image, and a single all-zero image consisting of all 0s is eliminated to form a second type of image data set; Calculating the point data of each image in the second type of image data set to obtain the row and column identifiers and the minimum number of the images, thereby forming the third type of image data, performing data compression processing on all the third type of image data formed to obtain the third type of image data set, and packaging and saving the third type of image data set as a second type of DICOM file, wherein the offset of each point data of the image data in the second type of image data set relative to a preset reference value is calculated one by one, identifying the data points whose offset exceeds the preset range, extracting the identified data points, and assigning new row and column identifiers to them; For each non-zero data point in the two-dimensional array of the image in the second type of image data set, the minimum difference between the non-zero data point and the adjacent data point or the preset threshold is calculated, and each non-zero data point is converted into a relative representation of the minimum difference with the non-zero data point to obtain a converted two-dimensional array; According to the converted two-dimensional array, the new row and column identifiers and the calculated minimum difference, the data of each image is recombined and encoded to form the third type of image data, all the formed third type of image data are subjected to data compression processing to obtain the third type of image data set, and the third type of image data set is packaged and saved as the second type of DICOM file; The first category DICOM file and the second category DICOM file are merged, and the merged file is compressed by using a file compression technology to generate a final DICOM single sequence alignment compressed file.
2. The method according to claim 1, characterized in that: The step of performing data compression processing on all the third-category image data to obtain a third-category image data set, and packaging and saving the third-category image data set as a second-category DICOM file includes: The third category image data is compressed using JPEG2000 encoding technology, and the third category image data compressed using JPEG2000 encoding technology is recombined into a new image data set to obtain a third category image data set, and the third category image data set is packaged and saved as a second category DICOM file.
3. The method according to claim 2, characterized in that: The step of merging the first type DICOM file and the second type DICOM file, and compressing the merged file by using a file compression technology to generate a final DICOM single sequence alignment compressed file includes: The first type of DICOM file and the second type of DICOM file are merged, and the files are compressed using RAR / ZIP compression technology to generate a final DICOM single sequence alignment compressed file.
4. A comparison and compression system for DICOM single sequence images, characterized in that: It includes a data classification module, a non-image data processing module, a second-type image data processing module, a third-type image data processing module and a merging and compression module; The data classification module is used to read the DICOM file under the specified path, split the DICOM file according to the serial number and TAG element parsing value in the DICOM file to obtain an image data set and a non-image data set, wherein the image data with the TAG element parsing value PixelData (0x7fe0, 0x0010) in the DICOM file is read into the image data set, and the data of the remaining TAG element parsing values in the DICOM file is read into the non-image data set, and the image data of the image data set is judged as a single sequence and the non-image data set is sorted according to the serial number InstanceNumber (0x0020, 0x0013) in the DICOM file; The non-image data processing module is used to perform a first type of comparison processing on the non-image data set according to the TAG element parsing value, remove the same TAG element parsing value therein, and package the remaining non-image data set and save it as a first type DICOM file, wherein the TAG element parsing value of the data in the non-image data set is compared with the TAG element parsing value of the first image of a single sequence in the DICOM file, remove the same TAG element parsing value therein, and save it as a first type DICOM file; The second type of image data processing module is used to convert the image data set into a single three-dimensional array through an array according to the number of sets, perform a second type of contrast processing based on the point positions of the three-dimensional array in the image of the image data set, and eliminate all-zero images therein to form a second type of image data set, wherein the image data set is converted into a single three-dimensional array through an array according to the number of sets, data with the same Z-axis point position in the three-dimensional array is stored in the same image, and a single all-zero image consisting of all 0s is eliminated to form a second type of image data set; The third-category image data processing module is used to calculate the point data of each image in the second-category image data set, obtain the row and column identifiers and the minimum number of the images, thereby forming the third-category image data, perform data compression processing on all the formed third-category image data to obtain the third-category image data set, and package the third-category image data set and save it as a second-category DICOM file, wherein the offset of each point data of the image data in the second-category image data set relative to a preset reference value is calculated one by one, and the data points whose offset exceeds the preset range are identified, the identified data points are extracted, and new row and column identifiers are assigned to them; For each non-zero data point in the two-dimensional array of the image in the second type of image data set, the minimum difference between the non-zero data point and the adjacent data point or the preset threshold is calculated, and each non-zero data point is converted into a relative representation of the minimum difference with the non-zero data point to obtain a converted two-dimensional array; According to the converted two-dimensional array, the new row and column identifiers and the calculated minimum difference, the data of each image is recombined and encoded to form the third type of image data, all the formed third type of image data are subjected to data compression processing to obtain the third type of image data set, and the third type of image data set is packaged and saved as the second type of DICOM file; The merging and compression module is used to merge the first type of DICOM file and the second type of DICOM file, and perform file compression processing on the merged file by using file compression technology to generate a final DICOM single sequence alignment compressed file.
5. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 3 are implemented.
6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 3 are implemented.
Citation Information
Cited By
Compression algorithm based on DICOM JXL
CN120676146A
