DICOM image file storage method, device, electronic equipment and medium
By dividing DICOM image files into groups and integrating storage, the problem of low storage and reading efficiency of DICOM image files is solved, efficient storage and safe transmission are achieved, and storage and reading efficiency is improved.
Patent Information
- Application Number
- CN202110485325.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-30
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2041-04-30
AI Technical Summary
The existing technology is inefficient when storing and reading DICOM image files, resulting in low file storage efficiency. Especially when file directories are frequently operated, writing and reading efficiency is significantly reduced.
By dividing multiple DICOM image files to be stored into groups, and integrating the files in each group into one large DICOM image file, they are stored according to the configuration information, and encryption algorithms and cyclic redundancy check and other technologies are used to ensure data Integrity and security.
It improves the storage efficiency and reading efficiency of DICOM image files, avoids file omissions, enhances data integrity and security, makes full use of bandwidth, and improves upload and download efficiency.
Smart Images

Figure CN113096776B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of big data technology, and in particular to a storage method, device, electronic equipment and medium for DICOM image files. Background Art
[0002] With the development of medical equipment, a CT or MR examination can generate more than 3,000 images and store more than 3,000 files. The existing technology first performs lossless compression on the images and then stores the compressed files on SAN or NAS storage.
[0003] However, due to the need to frequently alternately operate file directories and image files during the file storage process, for example, one inspection upload requires more than 3,000 directory operations and the writing of more than 3,000 files; each time a review is conducted, more than 3,000 files need to be read, resulting in low efficiency in writing and reading image files, leading to low file storage efficiency.
[0004] Therefore, it is necessary to provide a method for quickly storing image files. Summary of the invention
[0005] In view of the above, it is necessary to propose a storage method, device, electronic device and medium for DICOM image files, which improves the storage efficiency of DICOM image files by dividing multiple DICOM image files to be stored into multiple groups and integrating all DICOM image files to be stored in each group into a large DICOM image file.
[0006] A first aspect of the present invention provides a method for storing a DICOM image file, the method comprising:
[0007] Parsing the storage request of the received DICOM image file, obtaining multiple DICOM image files to be stored and configuration information;
[0008] Dividing the plurality of DICOM image files to be stored into a plurality of groups according to the hierarchical information in the configuration information;
[0009] Parsing each DICOM image file to be stored in each of the groups to obtain index information and pixel information corresponding to each of the groups;
[0010] Aggregating pixel information corresponding to each of the groups according to index information corresponding to each of the groups to obtain target pixel information of each of the groups;
[0011] According to the storage type in the configuration information, the index information corresponding to each of the groups and the target pixel information of each of the groups are stored in a DICOM image file.
[0012] Optionally, storing the index information corresponding to each of the groups and the target pixel information of each of the groups in a DICOM image file according to the storage type in the configuration information includes:
[0013] When the storage type in the configuration information is the first storage type, obtaining an encryption key for each of the groups;
[0014] Using an encryption algorithm and an encryption key of each group to encrypt the index information corresponding to each group, and storing the encrypted index information in the first database according to the preset first storage method in the configuration information;
[0015] A first target DICOM image file corresponding to each group is generated according to the target pixel information of each group according to a preset first generation rule, and the first target DICOM image file is stored in the second database according to a preset second storage method in the configuration information.
[0016] Optionally, generating a first target DICOM image file corresponding to each group according to the target pixel information of each group according to a preset first generation rule includes:
[0017] Acquire the magic number, version number information and status bit information of each of the groups according to the configuration information;
[0018] Calculate the number of bytes of index information corresponding to each of the groups;
[0019] Using a preset cyclic redundancy check to check each DICOM image file to be stored in each of the groups to obtain a cyclic redundancy check code corresponding to each group;
[0020] Generate a file header for each of the packets according to the magic number, version number information, status bit information, number of bytes and cyclic redundancy check code of each of the packets;
[0021] Generate a first file body of each group according to target pixel information of each group;
[0022] A first target DICOM image file corresponding to each group is generated according to a preset first generation rule based on the file header of each group and the first file body of each group.
[0023] Optionally, the method further comprises:
[0024] When the storage type in the configuration information is the second storage type, generating a second target DICOM image file corresponding to each of the groups according to the index information corresponding to each of the groups and the target pixel information of each of the groups and according to a preset second generation rule;
[0025] The second target DICOM image file is stored in the second database according to the second storage method preset in the configuration information.
[0026] Optionally, generating the second target DICOM image file corresponding to each of the groups according to the index information corresponding to each of the groups and the target pixel information of each of the groups according to a preset second generation rule includes:
[0027] Get the file header of each group;
[0028] Generate a second file body according to the index information corresponding to each of the groups and the target pixel information of each of the groups;
[0029] A second target DICOM image file corresponding to each group is generated according to the file header of each group and the second file body of each group.
[0030] Optionally, aggregating pixel information corresponding to each group according to index information corresponding to each group to obtain target pixel information of each group includes:
[0031] Identify index information of each DICOM image file to be stored in each of the groups;
[0032] Determine pixel information of each DICOM image file to be stored according to the index information of each DICOM image file to be stored;
[0033] According to the sequence of index information of each DICOM image file to be stored in each group, pixel information of each DICOM image file to be stored in each group is aggregated to obtain target pixel information of each group.
[0034] Optionally, the method further comprises:
[0035] Identifying a padding type in the configuration information;
[0036] When the filling type in the configuration information is filling, parsing each DICOM image file to be stored in each of the groups to obtain pixel information of each DICOM image file to be stored;
[0037] Determine the pixel size value of each DICOM image file to be stored according to the pixel information of each DICOM image file to be stored;
[0038] According to the pixel size value of each DICOM image file to be stored, a maximum pixel value in the pixel size value is selected from each of the groups, and the maximum pixel value is rounded according to a preset rule to obtain a target pixel value;
[0039] Random bit filling is performed on each DICOM image file to be stored in each of the groups, and the pixel size value of each DICOM image file to be stored is updated to the target pixel value.
[0040] A second aspect of the present invention provides a storage device for DICOM image files, the device comprising:
[0041] A first parsing module is used to parse the received storage request of the DICOM image file and obtain a plurality of DICOM image files to be stored and configuration information;
[0042] A division module, used for dividing the plurality of DICOM image files to be stored into a plurality of groups according to the hierarchical information in the configuration information;
[0043] A second parsing module is used to parse each DICOM image file to be stored in each of the groups to obtain index information and pixel information corresponding to each of the groups;
[0044] an aggregation module, used for aggregating pixel information corresponding to each of the groups according to index information corresponding to each of the groups, to obtain target pixel information of each of the groups;
[0045] The storage module is used to store the index information corresponding to each of the groups and the target pixel information of each of the groups in a DICOM image file according to the storage type in the configuration information.
[0046] A third aspect of the present invention provides an electronic device, the electronic device comprising a processor and a memory, the processor being configured to implement the DICOM image file storage method when executing a computer program stored in the memory.
[0047] A fourth aspect of the present invention provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the method for storing a DICOM image file is implemented.
[0048] In summary, the DICOM image file storage method, device, electronic device and medium of the present invention, on the one hand, store the index information corresponding to each group and the target pixel information of each group in the DICOM image file according to the storage type in the configuration information, divide the acquired multiple DICOM image files to be stored into multiple groups, and integrate all the DICOM image files to be stored in each group into a large DICOM image file, thereby improving the storage efficiency of the DICOM image file, and at the same time improving the writing and reading efficiency, and in the process of transmitting the DICOM image file, the bandwidth can be fully utilized, thereby improving the uploading and downloading efficiency of the DICOM image file; on the other hand , pixel information corresponding to each group is aggregated according to the index information corresponding to each group to obtain target pixel information of each group. Since the target pixel information of each group is obtained by aggregating the pixel information corresponding to each group in the order of the index information corresponding to the same group, the phenomenon of missing the DICOM image file to be stored during the storage process is avoided, and the integrity and accuracy of the target pixel information of each group are improved; finally, each DICOM image file to be stored in each group is parsed to obtain the index information and pixel information corresponding to each group, and the pixel size values of all the DICOM image files to be stored in each group are updated to the same pixel value, thereby improving the reading efficiency of the DICOM image files. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 This is a flow chart of a method for storing DICOM image files provided in Embodiment 1 of the present invention.
[0050] Figure 2 This is the 6 status bit information currently used for each group provided by the first embodiment of the present invention.
[0051] Figure 3 It is a structural diagram of a storage device for DICOM image files provided in the second embodiment of the present invention.
[0052] Figure 4 It is a schematic diagram of the structure of an electronic device provided in Embodiment 3 of the present invention. DETAILED DESCRIPTION
[0053] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present invention and the features in the embodiments can be combined with each other without conflict.
[0054] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used in the specification of the present invention herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention.
[0055] Embodiment 1
[0056] Figure 1 This is a flow chart of a method for storing DICOM image files provided in Embodiment 1 of the present invention.
[0057] In this embodiment, the storage method of the DICOM image file can be applied to electronic devices. For electronic devices that need to store DICOM image files, the storage function of the DICOM image file provided by the method of the present invention can be directly integrated into the electronic device, or run in the electronic device in the form of a software development kit (SDK).
[0058] like Figure 1 As shown, the storage method of the DICOM image file specifically includes the following steps. According to different requirements, the order of the steps in the flowchart can be changed, and some steps can be omitted.
[0059] S11, parsing the received storage request of the DICOM image file, and obtaining a plurality of DICOM image files to be stored and configuration information.
[0060] In this embodiment, the DICOM image file to be stored may be obtained by losslessly compressing the acquired original DICOM image, or may be the original DICOM image directly acquired.
[0061] In this embodiment, parsing the received storage request for DICOM image files can obtain one or more DICOM image files to be stored. Specifically, the files to be stored in the storage request can be historical DICOM image files read from local storage, or can be DICOM image files currently transmitted by a DICOM imaging device.
[0062] In this embodiment, the configuration information may include: hierarchical information, filling type, storage type, encryption key, preset storage method and other information. Specifically, the preset storage method includes: preset first storage method, preset second storage method and other storage methods.
[0063] S12: Divide the plurality of DICOM image files to be stored into a plurality of groups according to the hierarchical information in the configuration information.
[0064] In this embodiment, the configuration information is configured with hierarchical information, and a division rule can be determined according to the hierarchical information. The multiple DICOM image files to be stored are divided into multiple groups according to the division rule.
[0065] In an optional embodiment, dividing the plurality of DICOM image files to be stored into a plurality of groups according to the hierarchical information in the configuration information comprises:
[0066] Extract multiple levels of ID information of each DICOM image file to be stored;
[0067] Calculate a first hash value of each of the level ID information;
[0068] Calculate a second hash value of the level information in the configuration information;
[0069] identifying a target first hash value that matches the second hash value from among the plurality of first hash values of the plurality of level ID information;
[0070] The target level ID information is determined according to the target first hash value, and the multiple DICOM image files to be stored are divided into multiple groups according to the target level ID information, wherein each group includes at least one DICOM image file to be stored.
[0071] Specifically, the multiple level ID information may include one or more of the following:
[0072] Patient ID information;
[0073] Check ID information;
[0074] Sequence ID information;
[0075] Image ID information.
[0076] In some other embodiments, the level ID information may also include other information that can identify the DICOM image file, which is not limited in this embodiment.
[0077] In this embodiment, the target level corresponding to the division rule is determined by a hash value matching method. For example, the target level corresponding to the division rule is a patient level. The multiple DICOM image files to be stored include DICOM image files to be stored of 6 patients. The multiple DICOM image files to be stored are divided into 6 groups according to the patient level.
[0078] In this embodiment, the multiple DICOM image files to be stored are divided into multiple levels, the size of each group of image files is flexibly controlled, and the management efficiency of each group of image files is improved.
[0079] S13, parsing each DICOM image file to be stored in each of the groups, and obtaining index information and pixel information corresponding to each of the groups.
[0080] In this embodiment, the index information corresponding to each group refers to the set of index information of all DICOM image files to be stored in each group, and the pixel information corresponding to each group refers to the set of pixel information of all DICOM image files to be stored in each group.
[0081] In other optional embodiments, the method further includes:
[0082] Identifying a padding type in the configuration information;
[0083] When the filling type in the configuration information is filling, parsing each DICOM image file to be stored in each of the groups to obtain pixel information of each DICOM image file to be stored;
[0084] Determine the pixel size value of each DICOM image file to be stored according to the pixel information of each DICOM image file to be stored;
[0085] According to the pixel size value of each DICOM image file to be stored, a maximum pixel value in the pixel size value is selected from each of the groups, and the maximum pixel value is rounded according to a preset rule to obtain a target pixel value;
[0086] Random bit filling is performed on each DICOM image file to be stored in each of the groups, and the pixel size value of each DICOM image file to be stored is updated to the target pixel value.
[0087] Furthermore, the method further comprises:
[0088] When the filling type in the configuration information is no filling, the pixel information corresponding to each of the groups is aggregated according to the index information corresponding to each of the groups to obtain a target DICOM image file for each of the groups.
[0089] In this embodiment, the pixel size values of all the DICOM image files to be stored in each group are changed to the same pixel value.
[0090] Exemplarily, each group includes three DICOM image files to be stored, the pixel size value of the first DICOM image file to be stored is M, the pixel size value of the second DICOM image file to be stored is N, and the pixel size value of the third DICOM image file to be stored is Q, wherein the pixel values of M, N and Q are not equal. When reading the third DICOM image file to be stored, it is necessary to read the first and second DICOM image files to be stored first, resulting in low efficiency in reading DICOM image files.
[0091] In this embodiment, by selecting the maximum pixel value N from the three DICOM image files to be stored, rounding N to P, and performing random bit padding on the three DICOM image files to be stored, so that the pixel size values of the three DICOM image files to be stored are all P, then the pixel size value read from the first DICOM image file to be stored is P×0; the pixel size value read from the second DICOM image file to be stored is P×1; the pixel size value read from the third DICOM image file to be stored is P×2, and there is no need to read from the first one in sequence, thereby improving the reading efficiency of the DICOM image files.
[0092] In some other embodiments, the method further comprises:
[0093] Extracting multiple target level ID information of each DICOM image file to be stored in each of the groups;
[0094] Obtaining target encryption keys corresponding to the multiple target level IDs from the configuration information;
[0095] An encryption algorithm is used to encrypt the multiple target level ID information corresponding to each of the groups using the target encryption key.
[0096] In this embodiment, the encryption algorithm may be symmetric encryption, asymmetric encryption, RSA, AES or other encryption algorithms.
[0097] In this embodiment, by encrypting the multiple target level ID information corresponding to each of the groups, the security of the patient information and the security of the DICOM image file are improved.
[0098] S14, aggregating pixel information corresponding to each of the groups according to index information corresponding to each of the groups to obtain target pixel information of each of the groups.
[0099] In this embodiment, the target pixel information refers to the pixel information corresponding to each group that is aggregated in the order of index information corresponding to the same group.
[0100] In an optional embodiment, aggregating pixel information corresponding to each group according to index information corresponding to each group to obtain target pixel information of each group includes:
[0101] Identify index information of each DICOM image file to be stored in each of the groups;
[0102] Determine pixel information of each DICOM image file to be stored according to the index information of each DICOM image file to be stored;
[0103] According to the sequence of index information of each DICOM image file to be stored in each group, pixel information of each DICOM image file to be stored in each group is aggregated to obtain target pixel information of each group.
[0104] In this embodiment, since the target pixel information of each group is obtained by aggregating the pixel information corresponding to each group in the order of the index information corresponding to the same group, the phenomenon of missing the DICOM image file to be stored during the storage process is avoided, and the integrity and accuracy of the target pixel information of each group are improved.
[0105] S15, storing the index information corresponding to each of the groups and the target pixel information of each of the groups in a DICOM image file according to the storage type in the configuration information.
[0106] In this embodiment, due to the different storage types in the configuration information, the DICOM image files of each group are stored in different ways, thereby improving the flexibility of DICOM image file storage.
[0107] In an optional embodiment, storing the index information corresponding to each of the groups and the target pixel information of each of the groups in a DICOM image file according to the storage type in the configuration information includes:
[0108] When the storage type in the configuration information is the first storage type, obtaining an encryption key for each of the groups;
[0109] Using an encryption algorithm and an encryption key of each group to encrypt the index information corresponding to each group, and storing the encrypted index information in the first database according to the preset first storage method in the configuration information;
[0110] A first target DICOM image file corresponding to each group is generated according to the target pixel information of each group according to a preset first generation rule, and the first target DICOM image file is stored in the second database according to a preset second storage method in the configuration information.
[0111] In this embodiment, the first storage type is that the first target DICOM image file does not include index information. The index information can be encrypted and stored separately in the first database according to the application scenario. Specifically, the preset first storage method in the configuration information is identified, and the index information corresponding to each group is written into the corresponding first database according to the first storage method. The preset first storage method in the configuration information can be: relational data, such as MySQL; document database: such as MongoDB; search engine: such as ElasticSearch; column database: such as Hive, parquet, etc.
[0112] In this embodiment, a first generation rule can be set in advance. The preset first generation rule can be aggregation according to the generation order of the DICOM image files to generate the first target DICOM image file, and the first target DICOM image file is stored in the second database according to the preset second storage method in the configuration information. Specifically, the preset second storage method in the configuration information can be: local storage, such as disk and SAN; network storage, such as SAMB and NFS; object storage: such as Ceph object storage, S3, Swift; big data storage: such as HDFS, Ceph distributed storage.
[0113] In this embodiment, due to the diversity of the preset first storage mode and the preset second storage mode in the configuration information, the diversity and flexibility of DICOM image file storage are improved.
[0114] In this embodiment, by encrypting the index information and storing the index information separately, when the pixel information of the DICOM image file is leaked, the patient's privacy will not be exposed, thereby improving the security of the patient's data and further improving the security of the DICOM image file.
[0115] Furthermore, generating a first target DICOM image file corresponding to each group according to the target pixel information of each group according to a preset first generation rule includes:
[0116] Acquire the magic number, version number information and status bit information of each of the groups according to the configuration information;
[0117] Calculate the number of bytes of index information corresponding to each of the groups;
[0118] Using a preset cyclic redundancy check to check each DICOM image file to be stored in each of the groups to obtain a cyclic redundancy check code corresponding to each group;
[0119] Generate a file header for each of the packets according to the magic number, version number information, status bit information, number of bytes and cyclic redundancy check code of each of the packets;
[0120] Generate a first file body of each group according to target pixel information of each group;
[0121] A first target DICOM image file corresponding to each group is generated according to a preset first generation rule based on the file header of each group and the first file body of each group.
[0122] In this embodiment, the magic number refers to a file format identification code, which allows the program to quickly know the format of the processed file, such as the magic number of a DICOM file is: DICM, the magic number of a PDF file is: %PDF-1.5, such as the format version number V1 of a DICM file; status bit information: such as a 16-byte status bit, such as Figure 2 The 6 status bits currently in use are shown, and the remaining 10 status bits are reserved; the number of bytes refers to the length of the index information.
[0123] In some other embodiments, a preset cyclic redundancy check may also be used to check the magic number, version number information, status bit information and number of bytes of each packet to obtain a cyclic redundancy check code corresponding to each packet;
[0124] Furthermore, the method further comprises:
[0125] When the storage type in the configuration information is the second storage type, generating a second target DICOM image file corresponding to each of the groups according to the index information corresponding to each of the groups and the target pixel information of each of the groups according to a preset second generation rule;
[0126] The second target DICOM image file is stored in the second database according to the second storage method preset in the configuration information.
[0127] Further, generating the second target DICOM image file corresponding to each of the groups according to the index information corresponding to each of the groups and the target pixel information of each of the groups according to a preset second generation rule includes:
[0128] Get the file header of each group;
[0129] Generate a second file body according to the index information corresponding to each of the groups and the target pixel information of each of the groups;
[0130] A second target DICOM image file corresponding to each group is generated according to the file header of each group and the second file body of each group.
[0131] In this embodiment, the second storage type is that the second target DICOM image file includes index information.
[0132] In this embodiment, by dividing the acquired multiple DICOM image files to be stored into multiple groups, and integrating all the DICOM image files to be stored in each group into a large DICOM image file, the storage efficiency of the DICOM image files is improved, and the writing and reading efficiency is improved. In addition, during the transmission of the DICOM image files, the bandwidth can be fully utilized, thereby improving the uploading and downloading efficiency of the DICOM image files.
[0133] In summary, the storage method of the DICOM image file described in this embodiment, on the one hand, stores the index information corresponding to each group and the target pixel information of each group in the DICOM image file according to the storage type in the configuration information, divides the acquired multiple DICOM image files to be stored into multiple groups, and integrates all the DICOM image files to be stored in each group into a large DICOM image file, thereby improving the storage efficiency of the DICOM image file, and at the same time improving the writing and reading efficiency, and in the process of transmitting the DICOM image file, the bandwidth can be fully utilized, thereby improving the uploading and downloading efficiency of the DICOM image file; on the other hand, according to each The index information corresponding to the grouping is used to aggregate the pixel information corresponding to each of the groupings to obtain the target pixel information of each grouping. Since the pixel information corresponding to each grouping is aggregated in the order of the index information corresponding to the same grouping to obtain the target pixel information of each grouping, the phenomenon of missing the DICOM image file to be stored during the storage process is avoided, and the completeness and accuracy of the target pixel information of each grouping is improved; finally, each DICOM image file to be stored in each group is parsed to obtain the index information and pixel information corresponding to each of the groupings, and the pixel size values of all the DICOM image files to be stored in each of the groupings are updated to the same pixel value, thereby improving the reading efficiency of the DICOM image files.
[0134] Embodiment 2
[0135] Figure 3 It is a structural diagram of a storage device for DICOM image files provided in the second embodiment of the present invention.
[0136] In some embodiments, the storage device 30 for DICOM image files may include a plurality of functional modules composed of program code segments. The program code of each program segment in the storage device 30 for DICOM image files may be stored in the memory of the electronic device and executed by the at least one processor to execute (see Figure 1Description) Function of storing DICOM image files.
[0137] In this embodiment, the storage device 30 of the DICOM image file can be divided into multiple functional modules according to the functions it performs. The functional modules may include: a first parsing module 301, a division module 302, a second parsing module 303, an aggregation module 304 and a storage module 305. The module referred to in the present invention refers to a series of computer program segments that can be executed by at least one processor and can complete fixed functions, which are stored in a memory. In this embodiment, the functions of each module will be described in detail in subsequent embodiments.
[0138] The first parsing module 301 is used to parse the received storage request of the DICOM image file and obtain a plurality of DICOM image files to be stored and configuration information.
[0139] In this embodiment, the DICOM image file to be stored may be obtained by losslessly compressing the acquired original DICOM image, or may be the original DICOM image directly acquired.
[0140] In this embodiment, parsing the received storage request for DICOM image files can obtain one or more DICOM image files to be stored. Specifically, the files to be stored in the storage request can be historical DICOM image files read from local storage, or can be DICOM image files currently transmitted by a DICOM imaging device.
[0141] In this embodiment, the configuration information may include: hierarchical information, filling type, storage type, encryption key, preset storage method and other information. Specifically, the preset storage method includes: preset first storage method, preset second storage method and other storage methods.
[0142] The division module 302 is used to divide the multiple DICOM image files to be stored into multiple groups according to the level information in the configuration information.
[0143] In this embodiment, the configuration information is configured with hierarchical information, and a division rule can be determined according to the hierarchical information. The multiple DICOM image files to be stored are divided into multiple groups according to the division rule.
[0144] In an optional embodiment, the division module 302 divides the plurality of DICOM image files to be stored into a plurality of groups according to the hierarchical information in the configuration information, including:
[0145] Extract multiple levels of ID information of each DICOM image file to be stored;
[0146] Calculate a first hash value of each of the level ID information;
[0147] Calculate a second hash value of the level information in the configuration information;
[0148] identifying a target first hash value that matches the second hash value from among the plurality of first hash values of the plurality of level ID information;
[0149] The target level ID information is determined according to the target first hash value, and the multiple DICOM image files to be stored are divided into multiple groups according to the target level ID information, wherein each group includes at least one DICOM image file to be stored.
[0150] Specifically, the multiple level ID information may include one or more of the following:
[0151] Patient ID information;
[0152] Check ID information;
[0153] Sequence ID information;
[0154] Image ID information.
[0155] In some other embodiments, the level ID information may also include other information that can identify the DICOM image file, which is not limited in this embodiment.
[0156] In this embodiment, the target level corresponding to the division rule is determined by a hash value matching method. For example, the target level corresponding to the division rule is a patient level. The multiple DICOM image files to be stored include DICOM image files to be stored of 6 patients. The multiple DICOM image files to be stored are divided into 6 groups according to the patient level.
[0157] In this embodiment, the multiple DICOM image files to be stored are divided into multiple levels, the size of each group of image files is flexibly controlled, and the management efficiency of each group of image files is improved.
[0158] The second parsing module 303 is used to parse each DICOM image file to be stored in each of the groups to obtain index information and pixel information corresponding to each of the groups.
[0159] In this embodiment, the index information corresponding to each group refers to the set of index information of all DICOM image files to be stored in each group, and the pixel information corresponding to each group refers to the set of pixel information of all DICOM image files to be stored in each group.
[0160] In other optional embodiments, a filling type in the configuration information is identified; when the filling type in the configuration information is filling, each DICOM image file to be stored in each of the groups is parsed to obtain pixel information of each DICOM image file to be stored; a pixel size value of each DICOM image file to be stored is determined based on the pixel information of each DICOM image file to be stored; a maximum pixel value among the pixel size values is selected from each of the groups based on the pixel size value of each DICOM image file to be stored, and the maximum pixel value is rounded according to a preset rule to obtain a target pixel value; random bit filling is performed on each DICOM image file to be stored in each of the groups, and the pixel size value of each DICOM image file to be stored is updated to the target pixel value.
[0161] Furthermore, when the filling type in the configuration information is no filling, the pixel information corresponding to each of the groups is aggregated according to the index information corresponding to each of the groups to obtain a target DICOM image file for each of the groups.
[0162] In this embodiment, the pixel size values of all the DICOM image files to be stored in each group are changed to the same pixel value.
[0163] Exemplarily, each group includes three DICOM image files to be stored, the pixel size value of the first DICOM image file to be stored is M, the pixel size value of the second DICOM image file to be stored is N, and the pixel size value of the third DICOM image file to be stored is Q, wherein the pixel values of M, N and Q are not equal. When reading the third DICOM image file to be stored, it is necessary to read the first and second DICOM image files to be stored first, resulting in low efficiency in reading DICOM image files.
[0164] In this embodiment, by selecting the maximum pixel value N from the three DICOM image files to be stored, rounding N to P, and performing random bit padding on the three DICOM image files to be stored, so that the pixel size values of the three DICOM image files to be stored are all P, then the pixel size value read from the first DICOM image file to be stored is P×0; the pixel size value read from the second DICOM image file to be stored is P×1; the pixel size value read from the third DICOM image file to be stored is P×2, and there is no need to read from the first one in sequence, thereby improving the reading efficiency of the DICOM image files.
[0165] In some other embodiments, multiple target level ID information of each DICOM image file to be stored in each of the groups is extracted; target encryption keys corresponding to the multiple target level IDs are obtained from the configuration information; and the multiple target level ID information corresponding to each of the groups is encrypted using the target encryption key using an encryption algorithm.
[0166] In this embodiment, the encryption algorithm may be symmetric encryption, asymmetric encryption, RSA, AES or other encryption algorithms.
[0167] In this embodiment, by encrypting the multiple target level ID information corresponding to each of the groups, the security of the patient information and the security of the DICOM image file are improved.
[0168] The aggregation module 304 is used to aggregate the pixel information corresponding to each of the groups according to the index information corresponding to each of the groups to obtain the target pixel information of each of the groups.
[0169] In this embodiment, the target pixel information refers to the pixel information corresponding to each group that is aggregated in the order of index information corresponding to the same group.
[0170] In an optional embodiment, the aggregation module 304 aggregates the pixel information corresponding to each group according to the index information corresponding to each group, and obtains the target pixel information of each group including:
[0171] Identify index information of each DICOM image file to be stored in each of the groups;
[0172] Determine pixel information of each DICOM image file to be stored according to the index information of each DICOM image file to be stored;
[0173] According to the sequence of index information of each DICOM image file to be stored in each group, pixel information of each DICOM image file to be stored in each group is aggregated to obtain target pixel information of each group.
[0174] In this embodiment, since the target pixel information of each group is obtained by aggregating the pixel information corresponding to each group in the order of the index information corresponding to the same group, the phenomenon of missing the DICOM image file to be stored during the storage process is avoided, and the integrity and accuracy of the target pixel information of each group are improved.
[0175] The storage module 305 is used to store the index information corresponding to each of the groups and the target pixel information of each of the groups in a DICOM image file according to the storage type in the configuration information.
[0176] In this embodiment, due to the different storage types in the configuration information, the DICOM image files of each group are stored in different ways, thereby improving the flexibility of DICOM image file storage.
[0177] In an optional embodiment, the storage module 305 stores the index information corresponding to each of the groups and the target pixel information of each of the groups in a DICOM image file according to the storage type in the configuration information, including: when the storage type in the configuration information is the first storage type, obtaining the encryption key of each of the groups; encrypting the index information corresponding to each of the groups using the encryption key of each of the groups using an encryption algorithm, and storing the encrypted index information in the first database according to the preset first storage method in the configuration information; generating the first target DICOM image file corresponding to each group according to the target pixel information of each of the groups according to a preset first generation rule, and storing the first target DICOM image file in the second database according to the preset second storage method in the configuration information.
[0178] In this embodiment, the first storage type is that the first target DICOM image file does not include index information. The index information can be encrypted and stored separately in the first database according to the application scenario. Specifically, the preset first storage method in the configuration information is identified, and the index information corresponding to each group is written into the corresponding first database according to the first storage method. The preset first storage method in the configuration information can be: relational data, such as MySQL; document database: such as MongoDB; search engine: such as ElasticSearch; column database: such as Hive, parquet, etc.
[0179] In this embodiment, a first generation rule can be set in advance. The preset first generation rule can be aggregation according to the generation order of the DICOM image files to generate the first target DICOM image file, and the first target DICOM image file is stored in the second database according to the preset second storage method in the configuration information. Specifically, the preset second storage method in the configuration information can be: local storage, such as disk and SAN; network storage, such as SAMB and NFS; object storage: such as Ceph object storage, S3, Swift; big data storage: such as HDFS, Ceph distributed storage.
[0180] In this embodiment, due to the diversity of the preset first storage mode and the preset second storage mode in the configuration information, the diversity and flexibility of DICOM image file storage are improved.
[0181] In this embodiment, by encrypting the index information and storing the index information separately, when the pixel information of the DICOM image file is leaked, the patient's privacy will not be exposed, thereby improving the security of the patient's data and further improving the security of the DICOM image file.
[0182] Furthermore, generating a first target DICOM image file corresponding to each group according to the target pixel information of each group according to a preset first generation rule includes:
[0183] Acquire the magic number, version number information and status bit information of each of the groups according to the configuration information;
[0184] Calculate the number of bytes of index information corresponding to each of the groups;
[0185] Using a preset cyclic redundancy check to check each DICOM image file to be stored in each of the groups to obtain a cyclic redundancy check code corresponding to each group;
[0186] Generate a file header for each of the packets according to the magic number, version number information, status bit information, number of bytes and cyclic redundancy check code of each of the packets;
[0187] Generate a first file body of each group according to target pixel information of each group;
[0188] A first target DICOM image file corresponding to each group is generated according to a preset first generation rule based on the file header of each group and the first file body of each group.
[0189] In this embodiment, the magic number refers to a file format identification code, which allows the program to quickly know the format of the processed file, such as the magic number of a DICOM file is: DICM, the magic number of a PDF file is: %PDF-1.5, such as the format version number V1 of a DICM file; status bit information: such as a 16-byte status bit, such as Figure 2 Shown are the 6 status bits currently used for each group, and the remaining 10 status bits are reserved; the number of bytes refers to the index information length.
[0190] In some other embodiments, a preset cyclic redundancy check may also be used to check the magic number, version number information, status bit information and number of bytes of each packet to obtain a cyclic redundancy check code corresponding to each packet;
[0191] Furthermore, when the storage type in the configuration information is the second storage type, a second target DICOM image file corresponding to each group is generated according to the index information corresponding to each group and the target pixel information of each group according to a preset second generation rule; and the second target DICOM image file is stored in the second database according to the preset second storage method in the configuration information.
[0192] Further, generating the second target DICOM image file corresponding to each of the groups according to the index information corresponding to each of the groups and the target pixel information of each of the groups according to a preset second generation rule includes:
[0193] Get the file header of each group;
[0194] Generate a second file body according to the index information corresponding to each of the groups and the target pixel information of each of the groups;
[0195] A second target DICOM image file corresponding to each group is generated according to the file header of each group and the second file body of each group.
[0196] In this embodiment, the second storage type is that the second target DICOM image file includes index information.
[0197] In this embodiment, by dividing the acquired multiple DICOM image files to be stored into multiple groups, and integrating all the DICOM image files to be stored in each group into a large DICOM image file, the storage efficiency of the DICOM image files is improved, and the writing and reading efficiency is improved. In addition, during the transmission of the DICOM image files, the bandwidth can be fully utilized, thereby improving the uploading and downloading efficiency of the DICOM image files.
[0198] In summary, the storage device for DICOM image files described in this embodiment, on the one hand, stores the index information corresponding to each group and the target pixel information of each group in the DICOM image file according to the storage type in the configuration information, divides the acquired multiple DICOM image files to be stored into multiple groups, and integrates all the DICOM image files to be stored in each group into a large DICOM image file, thereby improving the storage efficiency of the DICOM image files, and at the same time improving the writing and reading efficiency, and in the process of transmitting the DICOM image files, the bandwidth can be fully utilized, thereby improving the uploading and downloading efficiency of the DICOM image files; on the other hand, according to each The index information corresponding to the grouping is used to aggregate the pixel information corresponding to each of the groupings to obtain the target pixel information of each grouping. Since the pixel information corresponding to each grouping is aggregated in the order of the index information corresponding to the same grouping to obtain the target pixel information of each grouping, the phenomenon of missing the DICOM image file to be stored during the storage process is avoided, and the completeness and accuracy of the target pixel information of each grouping is improved; finally, each DICOM image file to be stored in each group is parsed to obtain the index information and pixel information corresponding to each of the groupings, and the pixel size values of all the DICOM image files to be stored in each of the groupings are updated to the same pixel value, thereby improving the reading efficiency of the DICOM image files.
[0199] Embodiment 3
[0200] See also Figure 4 FIG. 4 is a schematic diagram of the structure of an electronic device provided in Embodiment 3 of the present invention. In a preferred embodiment of the present invention, the electronic device 4 includes a memory 41 , at least one processor 42 , at least one communication bus 43 and a transceiver 44 .
[0201] Those skilled in the art should understand that Figure 4 The structure of the electronic device shown does not constitute a limitation of the embodiments of the present invention, and may be a bus structure or a star structure. The electronic device 4 may also include more or less other hardware or software than shown in the figure, or a different arrangement of components.
[0202] In some embodiments, the electronic device 4 is an electronic device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application-specific integrated circuits, programmable gate arrays, digital processors, and embedded devices. The electronic device 4 may also include client devices, which include but are not limited to any electronic product that can interact with a client through a keyboard, mouse, remote control, touchpad, or voice-controlled device, such as a personal computer, tablet computer, smart phone, digital camera, etc.
[0203] It should be noted that the electronic device 4 is only an example, and other existing or future electronic products that are suitable for the present invention should also be included in the protection scope of the present invention and included here by reference.
[0204] In some embodiments, the memory 41 is used to store program codes and various data, such as the storage device 30 of the DICOM image file installed in the electronic device 4, and realizes high-speed and automatic access to programs or data during the operation of the electronic device 4. The memory 41 includes a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, magnetic disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.
[0205] In some embodiments, the at least one processor 42 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips, etc. The at least one processor 42 is the control core (Control Unit) of the electronic device 4, and uses various interfaces and lines to connect various components of the entire electronic device 4, and executes various functions and processes data of the electronic device 4 by running or executing programs or modules stored in the memory 41, and calling data stored in the memory 41.
[0206] In some embodiments, the at least one communication bus 43 is configured to implement connection and communication between the memory 41 and the at least one processor 42, etc.
[0207] Although not shown, the electronic device 4 may also include a power source (such as a battery) for supplying power to each component. Optionally, the power source may be logically connected to the at least one processor 42 through a power management device, so that the power management device can manage charging, discharging, and power consumption management. The power source may also include one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components. The electronic device 4 may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
[0208] It should be understood that the embodiment is for illustration only and the scope of the patent application is not limited to this structure.
[0209] The above-mentioned integrated unit implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium and includes a number of instructions for enabling a computer device (which can be a personal computer, electronic device, or network device, etc.) or a processor to execute a part of the method described in each embodiment of the present invention.
[0210] In a further embodiment, in combination Figure 3 The at least one processor 42 can execute the operating device of the electronic device 4 and various installed application programs (such as the storage device 30 of the DICOM image file), program codes, etc., for example, the above-mentioned modules.
[0211] The memory 41 stores program codes, and the at least one processor 42 can call the program codes stored in the memory 41 to execute related functions. For example, Figure 3 Each module described in the embodiment is a program code stored in the memory 41 and is executed by the at least one processor 42, thereby realizing the functions of each module to achieve the purpose of storing DICOM image files.
[0212] In one embodiment of the present invention, the memory 41 stores a plurality of instructions, and the plurality of instructions are executed by the at least one processor 42 to implement the function of storing DICOM image files.
[0213] Specifically, the specific implementation method of the at least one processor 42 for the above instructions can refer to Figure 1 and Figure 2 The description of the relevant steps in the corresponding embodiments will not be repeated here.
[0214] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.
[0215] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, and may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0216] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, 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 hardware plus software functional modules.
[0217] It is obvious to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential features of the present invention. Therefore, from any point of view, the embodiments should be regarded as exemplary and non-restrictive, and the scope of the present invention is limited by the appended claims rather than the above description, and it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any figure mark in the claims should not be regarded as limiting the claims involved. In addition, it is obvious that the word "including" does not exclude other units or, and the singular does not exclude the plural. The multiple units or devices stated in the present invention can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.
[0218] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.
Claims
1. A method for storing DICOM image files, characterized in that: The method comprises: Parsing the storage request of the received DICOM image file, obtaining multiple DICOM image files to be stored and configuration information; Dividing the multiple DICOM image files to be stored into multiple groups according to the hierarchical information in the configuration information, including: extracting multiple hierarchical ID information of each DICOM image file to be stored; calculating the first hash value of each of the hierarchical ID information; calculating the second hash value of the hierarchical information in the configuration information; identifying a target first hash value matching the second hash value from the multiple first hash values of the multiple hierarchical ID information; determining the target hierarchical ID information according to the target first hash value, and dividing the multiple DICOM image files to be stored into multiple groups according to the target hierarchical ID information, wherein each group includes at least one DICOM image file to be stored, and the multiple hierarchical ID information includes one or more of the following combinations: patient ID information, examination ID information, sequence ID information, and image ID information; Parsing each DICOM image file to be stored in each of the groups to obtain index information and pixel information corresponding to each of the groups; Aggregating pixel information corresponding to each of the groups according to index information corresponding to each of the groups to obtain target pixel information of each of the groups; According to the storage type in the configuration information, the index information corresponding to each of the groups and the target pixel information of each of the groups are stored in a DICOM image file, including: When the storage type in the configuration information is the first storage type, obtaining an encryption key for each of the groups; using an encryption algorithm to encrypt the index information corresponding to each of the groups using the encryption key of each of the groups, and storing the encrypted index information in the first database according to the first storage method preset in the configuration information; generating a first target DICOM image file corresponding to each group according to the target pixel information of each of the groups according to a preset first generation rule, and storing the first target DICOM image file in the second database according to the second storage method preset in the configuration information; or When the storage type in the configuration information is the second storage type, a second target DICOM image file corresponding to each of the groups is generated according to the index information corresponding to each of the groups and the target pixel information of each of the groups according to a preset second generation rule; and the second target DICOM image file is stored in the second database according to the preset second storage method in the configuration information.
2. The storage method of DICOM image files according to claim 1, characterized in that: Generating the first target DICOM image file corresponding to each group according to the target pixel information of each group according to the preset first generation rule comprises: Acquire the magic number, version number information and status bit information of each of the groups according to the configuration information; Calculate the number of bytes of index information corresponding to each of the groups; Using a preset cyclic redundancy check to check each DICOM image file to be stored in each of the groups to obtain a cyclic redundancy check code corresponding to each group; Generate a file header for each of the packets according to the magic number, version number information, status bit information, number of bytes and cyclic redundancy check code of each of the packets; Generate a first file body of each group according to target pixel information of each group; A first target DICOM image file corresponding to each group is generated according to a preset first generation rule based on the file header of each group and the first file body of each group.
3. The storage method of DICOM image files according to claim 1, characterized in that: Generating the second target DICOM image file corresponding to each of the groups according to the index information corresponding to each of the groups and the target pixel information of each of the groups according to the preset second generation rule comprises: Get the file header of each group; Generate a second file body according to the index information corresponding to each of the groups and the target pixel information of each of the groups; A second target DICOM image file corresponding to each group is generated according to the file header of each group and the second file body of each group.
4. The storage method of DICOM image files according to claim 1, characterized in that: Aggregating pixel information corresponding to each group according to index information corresponding to each group to obtain target pixel information of each group includes: Identify index information of each DICOM image file to be stored in each of the groups; Determine pixel information of each DICOM image file to be stored according to the index information of each DICOM image file to be stored; According to the sequence of index information of each DICOM image file to be stored in each group, pixel information of each DICOM image file to be stored in each group is aggregated to obtain target pixel information of each group.
5. The storage method of DICOM image files according to claim 1, characterized in that: The method further comprises: Identifying a padding type in the configuration information; When the filling type in the configuration information is filling, parsing each DICOM image file to be stored in each of the groups to obtain pixel information of each DICOM image file to be stored; Determine the pixel size value of each DICOM image file to be stored according to the pixel information of each DICOM image file to be stored; According to the pixel size value of each DICOM image file to be stored, a maximum pixel value in the pixel size value is selected from each of the groups, and the maximum pixel value is rounded according to a preset rule to obtain a target pixel value; Random bit filling is performed on each DICOM image file to be stored in each of the groups, and the pixel size value of each DICOM image file to be stored is updated to the target pixel value.
6. A storage device for DICOM image files, characterized in that: The device is used to implement the storage method of the DICOM image file according to any one of claims 1 to 5, and the device comprises: A first parsing module is used to parse the received storage request of the DICOM image file and obtain a plurality of DICOM image files to be stored and configuration information; A division module, used for dividing the plurality of DICOM image files to be stored into a plurality of groups according to the hierarchical information in the configuration information; A second parsing module is used to parse each DICOM image file to be stored in each of the groups to obtain index information and pixel information corresponding to each of the groups; an aggregation module, used for aggregating pixel information corresponding to each of the groups according to index information corresponding to each of the groups, to obtain target pixel information of each of the groups; The storage module is used to store the index information corresponding to each of the groups and the target pixel information of each of the groups in a DICOM image file according to the storage type in the configuration information.
7. An electronic device, characterized in that: The electronic device comprises a processor and a memory, and the processor is used to implement the DICOM image file storage method according to any one of claims 1 to 5 when executing the computer program stored in the memory.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for storing a DICOM image file according to any one of claims 1 to 5 is implemented.
