CN111613305A - Method and system for generating DICOMDIR file - Google Patents

Method and system for generating DICOMDIR file Download PDF

Info

Publication number
CN111613305A
CN111613305A CN202010460454.2A CN202010460454A CN111613305A CN 111613305 A CN111613305 A CN 111613305A CN 202010460454 A CN202010460454 A CN 202010460454A CN 111613305 A CN111613305 A CN 111613305A
Authority
CN
China
Prior art keywords
dicom
character
image
file
dicomdir
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010460454.2A
Other languages
Chinese (zh)
Other versions
CN111613305B (en
Inventor
周兴祥
于全文
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Individual
Original Assignee
Individual
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Individual filed Critical Individual
Priority to CN202010460454.2A priority Critical patent/CN111613305B/en
Publication of CN111613305A publication Critical patent/CN111613305A/en
Priority to PCT/CN2021/093861 priority patent/WO2021238680A1/en
Priority to JP2022573315A priority patent/JP2023527090A/en
Application granted granted Critical
Publication of CN111613305B publication Critical patent/CN111613305B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G16INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
    • G16HHEALTHCARE INFORMATICS, i.e. INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR THE HANDLING OR PROCESSING OF MEDICAL OR HEALTHCARE DATA
    • G16H30/00ICT specially adapted for the handling or processing of medical images
    • G16H30/20ICT specially adapted for the handling or processing of medical images for handling medical images, e.g. DICOM, HL7 or PACS
    • GPHYSICS
    • G16INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
    • G16HHEALTHCARE INFORMATICS, i.e. INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR THE HANDLING OR PROCESSING OF MEDICAL OR HEALTHCARE DATA
    • G16H30/00ICT specially adapted for the handling or processing of medical images
    • G16H30/40ICT specially adapted for the handling or processing of medical images for processing medical images, e.g. editing

Abstract

The invention discloses a method and a system for generating a DICOMDIR file, which are characterized in that firstly, a character search area in a DICOM image is determined, then, character search is carried out in a horizontal projection and vertical projection mode, the coordinate of a cutting area is determined, the DICOM image is cut, the cut DICOM image is generated into the DICOMDIR file, the characters of the DICOM image are removed, and anonymization processing of patient information or inspection information in image data is realized.

Description

Method and system for generating DICOMDIR file
Technical Field
The invention relates to the technical field of image processing, in particular to a method and a system for generating a DICOMDIR file.
Background
In hospitals, medical DICOM (digital Imaging and Communications in medicine) images generated by CT, mri, angiographic diagnostic apparatuses, ultrasound diagnostic apparatuses, and the like are stored as DICOM images on portable CD or DVD media, and are handed to other third-party medical institutions for patient storage or transfer, thereby realizing filmless management.
The DICOM images stored on the CD or DVD are managed by a DICOMDIR file, and can be viewed by a video viewing software attached to the CD or DVD.
In patent CN1567338A, a method and a system for burning digital medical information are disclosed, which can realize the burning storage of medical DICOM images or other medical information in CD or DVD media, and do not mention the problem of generating and storing DICOMDIR. WO 2015/008650A 1 discloses a method for producing, compressing and storing DICOMDIR, which realizes the storage and management method of DICOMDIR files on CDs or DVDs.
However, in order to avoid the problem of infringing the privacy of patients in the case of medical doctors issuing in academic conferences or in special research occasions, it is necessary to anonymize the patient-related and diagnosis-related DICOMTAG in the generated DICOMDIR file and DICOM image of CD or DVD. Since information such as the name of a patient may be present in image data, such as an sc (second capture) image or an ultrasound image of DICOM, it is not sufficient to anonymize only patient information and examination information in DOCOM or DICOMDIR.
How to anonymize patient information or examination information in image data becomes a technical problem to be solved urgently.
Disclosure of Invention
The invention aims to provide a method and a system for generating a DICOMDIR file, which are used for realizing anonymization processing on patient information or examination information existing in image data.
In order to achieve the purpose, the invention provides the following scheme:
a method for generating a DICOMDIR file, the method comprising the steps of:
extracting DICOM images or DICOM animations of all DICOM files in a folder needing to generate the DICOMDIR files;
obtaining a DICOM image or a first frame DICOM image of a DICOM animation to obtain a DICOM image to be processed;
carrying out binarization processing on the DICOM image to be processed to obtain a binary image;
defining the upper left corner, the upper right corner, the lower left corner and the lower right corner of the binary image as 4 character search areas;
horizontally projecting each character search area to determine the upper boundary and the lower boundary of the character line in each character search area;
performing vertical projection on each character search area to determine the left boundary and the right boundary of each character in each character search area and the number of the characters;
determining a character search area with characters in the 4 character search areas according to the number of the characters;
determining the coordinates of a cutting area according to the upper boundary and the lower boundary of a character line of a character search area with characters and the left boundary and the right boundary of each character;
cutting the DICOM image or each frame of DICOM image of the DICOM animation according to the coordinates of the cutting area to obtain a cut DICOM image, and storing the cut DICOM image into a designated file;
returning to the step of obtaining the DICOM image or the first frame DICOM image of the DICOM animation to obtain a DICOM image to be processed, and cutting the next DICOM image or DICOM animation until all DICOM images and DICOM animation in the folder needing to generate the DICOMDIR file are cut;
and generating a DICOMDIR file from all the cut DICOM images in the designated file.
Optionally, the extracting a DICOM image or a DICOM animation of all DICOM files in a folder in which the DICOM dir file needs to be generated further includes:
extracting DICOM TAG information of all DICOM files in a folder needing to generate the DICOMDIR files;
modifying the DICOM TAG information according to the TAG information which is designated by a user in a set file and needs anonymization to obtain the modified DICOM TAG information;
and writing the modified DICOM TAG information into a DICOM file corresponding to the DICOM TAG information to obtain the DICOM file modified by the DICOM TAG information.
Optionally, the horizontally projecting each text search area to determine an upper boundary and a lower boundary of a character row in each text search area specifically includes:
and projecting the character search area of the binary image in the horizontal direction, and determining the upper boundary and the lower boundary of the character line of the character search area according to the fact that the average value of the integral projection of the character in the horizontal direction is higher than the average value of the integral projection of the character in the horizontal direction of the background.
Optionally, the vertical projection is performed on each word search area to determine the left boundary and the right boundary of each character and the number of characters in each word search area, and specifically includes
And performing vertical projection on a character search area of the binary image, and determining the left boundary and the right boundary of each character and the number of the characters in the character search area according to the fact that the average value of the vertical integral projection of the character is higher than the average value of the vertical integral projection of the background and the threshold ranges of the width, the height and the interval of the characters.
Optionally, the generating a DICOM dir file from all the cut DICOM images in the designated file specifically includes:
calculating the sum of the sizes of all the cut DICOM images in the appointed folder;
calculating the number of DICOMDIR files to be generated according to the sum of the sizes of all the cut DICOM images in the appointed folder;
and generating the number of DICOMDIR files by using a DICOMDIR creating function to all the cut DICOM images in the appointed folder.
A system for generating a DICOMDIR file, the system comprising:
the DICOM image or DICOM animation extracting module is used for extracting DICOM images or DICOM animation of all DICOM files in a folder needing to generate the DICOMDIR files;
the DICOM image acquisition module to be processed is used for acquiring a DICOM image or a first frame DICOM image of the DICOM animation to obtain the DICOM image to be processed;
the binarization processing module is used for carrying out binarization processing on the DICOM image to be processed to obtain a binary image;
a character search area determining module, configured to define an upper left corner, an upper right corner, a lower left corner, and a lower right corner of the binary image as 4 character search areas;
the upper and lower boundary determining module is used for horizontally projecting each character searching area to determine the upper boundary and the lower boundary of the character line in each character searching area;
the left and right boundary determining module is used for performing vertical projection on each character searching area to determine the left boundary and the right boundary of each character in each character searching area and the number of the characters;
the character search area determination module is used for determining character search areas with characters in 4 character search areas according to the number of the characters;
the cutting area determining module is used for determining the coordinates of the cutting area according to the upper boundary and the lower boundary of the character row of the character search area with the characters and the left boundary and the right boundary of each character;
the cutting module is used for cutting the DICOM image or each frame of DICOM image of the DICOM animation according to the coordinates of the cutting area to obtain the cut DICOM image, and storing the cut DICOM image into a specified file;
the return module is used for returning to the step of obtaining the DICOM image or the first frame DICOM image of the DICOM animation to obtain a DICOM image to be processed, and cutting the next DICOM image or DICOM animation until all DICOM images and DICOM animation in the folder needing to generate the DICOMDIR file are cut;
and the DICOMDIR file generating module is used for generating the DICOMDIR file from all the cut DICOM images in the appointed file.
Optionally, the generating system further includes:
the DICOM TAG information extraction module is used for extracting DICOM TAG information of all DICOM files in a folder needing to generate the DICOM DIR files;
the DICOM TAG information modifying module is used for modifying the DICOM TAG information according to the TAG information which is designated by a user in a set file and needs anonymization to obtain the modified DICOM TAG information;
and the modified DICOM TAG information storage module is used for writing the modified DICOM TAG information into a DICOM file corresponding to the DICOM TAG information to obtain the DICOM file modified by the DICOM TAG information.
Optionally, the upper and lower boundary determining module specifically includes:
and the upper and lower boundary determining submodule is used for projecting the character searching area of the binary image in the horizontal direction, and determining the upper boundary and the lower boundary of the character line of the character searching area according to the fact that the average value of the integral projection of the character in the horizontal direction is higher than the average value of the integral projection of the character in the horizontal direction of the background.
Optionally, the left-right boundary determining module specifically includes
And the left and right boundary determining submodule is used for performing vertical direction projection on a character searching area of the binary image, and determining the left boundary, the right boundary and the number of characters of each character in the character searching area according to the vertical direction integral projection average value of the character characters which is higher than the vertical direction integral projection average value of the background and the threshold range of the width, the height and the interval of the character.
Optionally, the DICOMDIR file generating module specifically includes:
the size and sum calculating submodule is used for calculating the sum of the sizes of all the cut DICOM images in the appointed folder;
the number calculation submodule of the DICOMDIR files required to be generated is used for calculating the number of the DICOMDIR files required to be generated according to the sum of the sizes of all the cut DICOM images in the appointed folder;
and the DICOMDIR file generation submodule is used for generating the number of the DICOMDIR files from all the cut DICOM images in the appointed folder by utilizing a DICOMDIR creating function.
Compared with the prior art, the invention has the beneficial effects that:
the invention provides a method and a system for generating a DICOMDIR file, wherein the method comprises the steps of firstly, obtaining a DICOM image in a folder needing to generate the DICOMDIR file or a first frame DICOM image of DICOM animation to obtain a DICOM image to be processed; carrying out binarization processing on the DICOM image to be processed to obtain a binary image; defining the upper left corner, the upper right corner, the lower left corner and the lower right corner of the binary image as 4 character search areas; horizontally projecting each character search area to determine the upper boundary and the lower boundary of the character line in each character search area; performing vertical projection on each character search area to determine the left boundary and the right boundary of each character in each character search area and the number of the characters; determining a character search area with characters in the 4 character search areas according to the number of the characters; determining the coordinates of a cutting area according to the upper boundary and the lower boundary of a character line of a character search area with characters and the left boundary and the right boundary of each character; then, the DICOM image or each frame of DICOM image of the DICOM animation is cut according to the coordinates of the cutting area to obtain the cut DICOM image, and the cut DICOM image is stored in a designated file; after the DICOM images or DICOM animation in the folder needing to generate the DICOMDIR file are completely cut, all the cut DICOM images in the appointed file are generated into the DICOMDIR file. The invention firstly determines the character search area in the DICOM image, then searches the character characters by adopting the modes of horizontal projection and vertical projection, determines the coordinates of the cutting area, cuts the DICOM image, and generates the DICOMDIR file from the cut DICOM image, thereby realizing the anonymization processing of the patient information or the checking information in the image data.
The invention modifies the DICOM TAG which is appointed in the DICOM image file and needs anonymization while removing the characters in the DICOM image data, thereby realizing the anonymization processing for generating the DICOM image file.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings without inventive exercise.
FIG. 1 is a flow chart of a method for generating a DICOMDIR file according to the present invention;
FIG. 2 is a schematic diagram of a method for generating a DICOMDIR file according to the present invention;
FIG. 3 is a schematic diagram of a cropping rectangle provided by the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The invention aims to provide a method and a system for generating a DICOMDIR file, which are used for realizing anonymization processing on patient information or examination information existing in image data.
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
As shown in fig. 1 and 2, the present invention provides a method for generating a DICOMDIR file, wherein the method comprises the following steps:
in the process of generating the DICOM dir file, the DICOM TAG information of the DICOM image also contains information of the patient, so that anonymization of the DICOM TAG information of the DICOM image is also required. The invention also provides an anonymization method of DICOM TAG information related to patient association and diagnosis in DICOM images, which specifically comprises the following steps: extracting DICOM TAG information of all DICOM files in a folder needing to generate the DICOMDIR files; modifying the DICOM TAG information according to DICOM TAG information such as patient information needing anonymization and designated by a user in a set file to obtain the modified DICOM TAG information; and writing the modified DICOM TAG information into a DICOM file corresponding to the DICOM TAG information to obtain the DICOM file modified by the DICOM TAG information. Setting DICOM TAG information needing anonymization to include patient information and examination information; the DICOM file managed by the DICOMDIR stores the information such as subdirectories and the like into an XML or CSV file, when the DICOMDIR file is made, the setting information of the setting file in the designated file is read, the setting information comprises the content which is specified by a user and needs anonymization, such as patient name, patient ID and diagnostician name, and when the DICOMDIR is generated, the DICOM image stores the subdirectory information (the subdirectory can be included, or the subdirectory can not be included and is set by the user).
Step 101, extracting DICOM images or DICOM animations of all DICOM files in the folder needing to generate the DICOMDIR files.
And step 102, acquiring the DICOM image or a first frame DICOM image of the DICOM animation to obtain a DICOM image to be processed.
Steps 101 and 102 specifically include: and designating a folder in which the DICOM images needing to generate the DICOMDIR exist, reading all DICOM image files in the folder, and reading DICOM TAG information of all images to enter a memory. And simultaneously, taking the DICOM image as a unit, reading the image data in each DICOM file to a memory, and if the image is an animation DICOM image, reading the first frame image in the DICOM file to the memory.
And 103, performing binarization processing on the DICOM image to be processed to obtain a binary image.
Specifically, in consideration of the characteristics of uneven gray distribution of the medical image, a Niblack local binarization method is adopted to carry out binarization processing on the DICOM image to be processed, which is stored in the memory, so as to obtain a frame of binary image.
And 104, defining the upper left corner, the upper right corner, the lower left corner and the lower right corner of the binary image as 4 character search areas.
Specifically, if there is patient information in the DICOM image data, generally, 4 ROI regions at 4 corners of the image are set as text search regions at the upper left corner, the upper right corner, the lower left corner, or the lower right corner of the image.
And 105, horizontally projecting each character search area to determine the upper boundary and the lower boundary of the character line in each character search area.
Step 106, performing horizontal projection on each text search area to determine an upper boundary and a lower boundary of a character row in each text search area, specifically including: and projecting the character search area of the binary image in the horizontal direction, and determining the upper boundary and the lower boundary of the character line of the character search area according to the fact that the average value of the integral projection of the character in the horizontal direction is higher than the average value of the integral projection of the character in the horizontal direction of the background.
And 106, vertically projecting each character search area to determine the left boundary and the right boundary of each character in each character search area and the number of the characters.
Step 106, performing vertical projection on each text search area to determine the left boundary and the right boundary of each character and the number of characters in each text search area, specifically including: and performing vertical projection on a character search area of the binary image, and determining the left boundary and the right boundary of each character and the number of the characters in the character search area according to the fact that the average value of the vertical integral projection of the character is higher than the average value of the vertical integral projection of the background and the threshold ranges of the width, the height and the interval of the characters.
The steps 105 and 106 specifically include: deleting the undersized or oversized area region of the obtained binary image before projection processing according to the characteristic that the area size of the characters is within a certain range, only reserving the region within the area range of the characters, and then performing projection processing; projecting the 2-value image of each character search area in the horizontal direction, positioning the upper and lower boundaries of the character line and storing the character line in an internal memory; and then, projecting the binary image of the character search area in the vertical direction, positioning the left and right boundaries of each character and storing the left and right boundaries in a memory.
According to the situation that the characters existing on the medical image are English letters or Arabic numerals or Chinese characters, the width, height and width-height ratio of the characters are within a certain threshold range. After the width, height, ratio of width to height of each block area are calculated, the width, height and width-height characteristics of the block areas of the characters are used for judging the existing character areas and storing the coordinate values of the characters in a memory.
And step 107, determining character search areas with characters in the 4 character search areas according to the number of the characters.
And step 108, determining the coordinates of the cutting area according to the upper boundary and the lower boundary of the character row of the character search area with the characters and the left boundary and the right boundary of each character.
Specifically, according to the results calculated in steps 105, 106, and 107, if the text search area has a character area, the maximum X and Y coordinates and the minimum X and Y coordinate ranges of each character area are calculated, a rectangular area of the middle portion of the image excluding the character is calculated from the rectangles of the entire image area as a cropping rectangle, and the rectangular coordinates are stored in the memory, the cropping rectangle ranges are as shown in fig. 3, and text areas exist in the upper left corner and the upper right corner. If no literal character exists in each literal search region, the rectangular coordinates of the cropped region (dotted line portion in FIG. 3) are not saved.
Step 109, cutting the DICOM image or each frame DICOM image of the DICOM animation according to the coordinates of the cutting area to obtain a cut DICOM image, and storing the cut DICOM image into a designated file; and returning to the step of obtaining the DICOM image or the first frame DICOM image of the DICOM animation in the folder needing to generate the DICOMDIR file to obtain the DICOM image to be processed, and cutting the next DICOM image or DICOM animation until all the DICOM images and DICOM animation in the folder needing to generate the DICOMDIR file are cut.
Specifically, if no text area exists in the image, only the patient name (0010) needing to be modified, the patient ID (0010,0020) and other information (xxxx ) needing to be modified in the TAG information stored in the memory are modified, and the modified TAG information is stored in each DICOM file again; if the image has a text area, in addition to modifying the patient information and other information which need to be modified in the TAG information stored in the memory, the DICOM image data of each frame is read, the image of each frame is cut by using the cutting rectangle obtained in the step 108 and then stored in a DICOM file, and meanwhile, the TAG values of the image width (0028,0011) and the height (0028,0010) in the DICOM file are modified to be the width and the height of the cutting rectangle area.
And step 110, generating the DICOMDIR file from all the cut DICOM images in the appointed file.
Step 110, generating a DICOM dir file from all the cut DICOM images in the designated file, specifically including: calculating the sum of the sizes of all the cut DICOM images in the appointed folder; calculating the number of DICOMDIR files to be generated according to the sum of the sizes of all the cut DICOM images in the appointed folder; and generating the number of DICOMDIR files by using a DICOMDIR creating function to all the cut DICOM images in the appointed folder.
Specifically, the sum of the file sizes of all DICOM images in a designated folder is calculated, the number of DICOMDIR files (the number of CDs or DVDs) needing to be generated is calculated according to a DICOMDIR file identifier which is used for generating CDs or DVDs and exists in a set file, then a DICOMDIR creating function is used for generating the DICOMDIR files, and if a DICOM file storage sub-directory which needs to be generated and is managed by the DICOMDIR is not designated in the set file, the DICOM files are generated under the same directory of the DICOMDIR files according to rules of the DIROMDIROMDIRs; if the setting file designates the subdirectory for storing the DICOM file managed by the DICOMDIR which needs to be generated, the DICOM file is generated according to the rule of the DICOMDIR and is stored in the designated subdirectory.
The invention also provides a DICOMDIR file generation system, which comprises:
the DICOM image or DICOM animation extracting module is used for extracting DICOM images or DICOM animation of all DICOM files in a folder needing to generate the DICOMDIR files;
the DICOM image acquisition module to be processed is used for acquiring a DICOM image or a first frame DICOM image of the DICOM animation to obtain the DICOM image to be processed;
the binarization processing module is used for carrying out binarization processing on the DICOM image to be processed to obtain a binary image;
a character search area determining module, configured to define an upper left corner, an upper right corner, a lower left corner, and a lower right corner of the binary image as 4 character search areas;
and the upper and lower boundary determining module is used for horizontally projecting each character searching area to determine the upper boundary and the lower boundary of the character line in each character searching area.
The upper and lower boundary determining module specifically includes: and the upper and lower boundary determining submodule is used for projecting the character searching area of the binary image in the horizontal direction, and determining the upper boundary and the lower boundary of the character line of the character searching area according to the fact that the average value of the integral projection of the character in the horizontal direction is higher than the average value of the integral projection of the character in the horizontal direction of the background.
And the left and right boundary determining module is used for performing vertical projection on each character searching area to determine the left boundary and the right boundary of each character in each character searching area and the number of the characters.
The left and right boundary determining module specifically comprises a left and right boundary determining submodule for performing vertical direction projection on a character search area of the binary image, and determining the left boundary, the right boundary and the number of characters of each character in the character search area according to the vertical direction integral projection average value of the character characters which is higher than the vertical direction integral projection average value of the background and the threshold ranges of the width, the height and the interval of the characters.
The character search area determination module is used for determining character search areas with characters in 4 character search areas according to the number of the characters;
the cutting area determining module is used for determining the coordinates of the cutting area according to the upper boundary and the lower boundary of the character row of the character search area with the characters and the left boundary and the right boundary of each character;
the cutting module is used for cutting the DICOM image or each frame of DICOM image of the DICOM animation according to the coordinates of the cutting area to obtain the cut DICOM image, and storing the cut DICOM image into a specified file;
the return module is used for returning to the step of obtaining the DICOM image or the first frame DICOM image of the DICOM animation to obtain a DICOM image to be processed, and cutting the next DICOM image or DICOM animation until all DICOM images and DICOM animation in the folder needing to generate the DICOMDIR file are cut;
and the DICOMDIR file generating module is used for generating the DICOMDIR file from all the cut DICOM images in the appointed file.
The DICOMDIR file generation module specifically comprises: the size and sum calculating submodule is used for calculating the sum of the sizes of all the cut DICOM images in the appointed folder; the number calculation submodule of the DICOMDIR files required to be generated is used for calculating the number of the DICOMDIR files required to be generated according to the sum of the sizes of all the cut DICOM images in the appointed folder; and the DICOMDIR file generation submodule is used for generating the number of the DICOMDIR files from all the cut DICOM images in the appointed folder by utilizing a DICOMDIR creating function.
The generation system further includes: the DICOM TAG information extraction module is used for extracting DICOM TAG information of all DICOM files in a folder needing to generate the DICOM DIR files; the DICOM TAG information modifying module is used for modifying the DICOM TAG information according to the TAG information which is designated by a user in a set file and needs anonymization to obtain the modified DICOM TAG information; and the modified DICOM TAG information storage module is used for writing the modified DICOM TAG information into a DICOM file corresponding to the DICOM TAG information to obtain the DICOM file modified by the DICOM TAG information.
In order to illustrate the technical solution of the present invention, the present invention also provides a specific embodiment.
DICOMDIR is a variable length mini database file. With group (0002, xxxx) and group (0004, xxxx) as topics, a 4-level tree structure is described. Composed of Patient, student, Series and Image. DICOM images stored in DICOM CDs or DVDs are managed by a DICOMDIR file, and DICOM image browsing software attached thereto realizes DICOM image browsing managed by DICOMDIR.
(1) Setting DICOM TAG information needing anonymization, including patient information, examination information, DICOM image storage subdirectory information managed by DICOMDIR, and the like, into a CSV (Comma-Separated Values) file, reading the setting information in the setting file when the DICOMDIR file is made, reading contents needing anonymization, such as patient name, patient ID, and diagnostician name, from the setting file, and storing the subdirectory information (with or without subdirectory or user setting) when the DICOMDIR is generated.
In the setting file, the patient name and the ID information are set to be anonymized in the embodiment, the patient name is required to be modified into a TEST1 character string during anonymization, the patient ID is modified into a 00000000 character string, the storage medium is a CD of 640 megabits, and the DICOM file for setting DICOMDIR file management is stored in a subdirectory DCM.
(2) A DICOM folder for generating DICOMDIR file is specified, wherein the folder contains 8 DSA animation DICOM images and 10 ultrasound animation images, wherein the DSA images are 16-bit grayscale images, the image resolution is 1024 × 768 pixels, and the ultrasound images are 24-bit color images, and the image resolution is 640 × 480 pixels. All DICOM images in this folder are images of the same patient, named Anonymous and checked for 2012.11.07. In the ultrasound image, information such as the name and sex of the patient is shown in the upper right corner of the image, and information such as the date and time of examination is shown in the upper left corner of the image. Wherein no text information exists in the DSA image, and the patient ID and the patient name information exist in the upper right corner of the image in the ultrasonic image. And opening and reading all files in the directory, and reading DICOM TAG information of all 18 DICOM images to a memory.
And then, taking the DICOM file as a unit, reading the image data in each DICOM file into a memory. All the DICOM files in the folder are moving DICOM images, the first frame in each DICOM file is read to a memory by taking a frame as a unit, a 16-bit DSA image is converted into an 8-bit gray-scale image through gray-scale conversion, and a 24-bit ultrasonic color image is converted into an 8-bit gray-scale image through color-to-gray-scale image conversion.
(3) And (4) in consideration of the characteristic of uneven gray level distribution of the medical image, carrying out binarization on the image data by adopting a Niblack local binarization method. The Niblack binarization method is characterized in that the mean value and the variance in a neighborhood taking a pixel point as a center jointly determine a binarization segmentation threshold value of the pixel. And taking the pixel (i, j) as a center, and taking the window with the size kxk, wherein the mean value of the gray values of all pixels in the window is m, the variance is s, and the point threshold t is m + c s, wherein c is an adjustment quantity parameter. For the DSA and ultrasound images of the present example, c was chosen to be-0.2 and k was chosen to be 5.
And after binarization is carried out by a Niblack binarization method, obtaining a binary image of the first frame image of each DICOM file stored in the memory.
(4) And removing block areas outside the threshold range of the obtained binary image according to the threshold of the area size of the character. Each character search area with 4 corners is set to be a rectangular area with the width and height of 128X160 pixels, and can include character areas with corners. And (3) projecting the binary image of each character search area in the horizontal direction, and confirming the upper boundary and the lower boundary of the character line according to the characteristic that the integral projection average value in the horizontal direction of the character is obviously higher than that in the background area. Obtaining the coordinates of the upper and lower boundaries of the possible character area and storing the coordinates into a memory; and then, carrying out vertical direction projection on the binary image in the character search area, determining the left and right boundary coordinates of each character according to the characteristics that the average value of the integral projection in the vertical direction of the character is higher than that of the integral projection in the vertical direction of the background area, and the width, height and spacing of the character are within a certain range, and storing the left and right boundary coordinates of each character in a memory. The maximum width and height of the characters in the image is 20x 12 pixels, and the average distance is 5 pixels.
And judging the character search areas with the character characters in the 4 character search areas by using the character number information stored in each character search area in the memory. And judging whether characters exist in the upper left corner and the upper right corner of the ultrasonic image according to the character of whether the character exists in the character search area, and judging that no character area exists in the DSA image.
(5) According to the result obtained by the calculation in (4), no text region exists in the DSA image, a text region of the examination date exists in the upper left corner of the ultrasonic image, a text region of the patient name exists in the upper right corner, and no text region exists in the lower left corner ROI and the lower right corner ROI. The maximum X coordinate of the text of the ROI area in the upper left corner is 170, and the maximum Y coordinate is 48; the text of the upper right ROI has a minimum X coordinate of 460 and a maximum Y coordinate of 64. The image size is 640X 480 pixels, and it is calculated that the upper left-hand X coordinate of the cropping zone is 170, the Y coordinate is 64, the upper right-hand X coordinate is 460, the Y coordinate is 64, the lower left-hand X coordinate is 170, the Y coordinate is 480, the lower right-hand X coordinate is 460, the Y coordinate is 480, and the width and height of the cropping zone is 290X 416 pixels.
(6) According to the result obtained in the step (5), no character region exists in the DSA image, the patient name (0010 ) in the TAG information stored in the memory of the DSA image obtained in the step (2) is modified to be TEST1 character string, and the patient ID (0010,0020) is 00000000 character string and then is stored in the DICOM file of the DSA.
The ultrasonic image has character areas, except that the patient name (0010) in the TAG information stored in the memory obtained in the step (2) is modified to be TEST1 character string, the patient ID (0010,0020) is 00000000 character string, the image data of each frame in the DICOM file is read, the image of each frame is cut by using the cutting rectangle obtained in the step (5) and then stored in the DICOM file, and meanwhile, the image width (0028,0011) and the height (0028,0010) of the TAG value in the DICOM file are modified to be the width and the height of the cutting rectangle area; if the settings file does not have the anonymization settings such as DICOM patient information, the DICOM file is not modified.
(7) Calculating the sum of the sizes of all DICOM images in the specified folder, wherein the sum of the sizes of 18 animation DICOM images in the specified folder is 976 million; the number of DICOMDIR files to be generated is calculated to be 2 (2 CDs) according to the conditions for generating 640 Mm of CDs set in the setting file. And then, calling a DICOMDIR creating function to generate 2 DICOMDIR files, setting a DICOM file storage subdirectory managed by the DICOMDIR in the file to be DCM, and storing the DICOM file managed by the DICOMDIR into the DCM subdirectory according to the rules of the DICOMDIR while generating the DICOMDIR file.
Compared with the prior art, the invention has the beneficial effects that:
the invention provides a method and a system for generating a DICOMDIR file, wherein the method comprises the steps of firstly, obtaining a DICOM image in a folder needing to generate the DICOMDIR file or a first frame DICOM image of DICOM animation to obtain a DICOM image to be processed; carrying out binarization processing on the DICOM image to be processed to obtain a binary image; defining the upper left corner, the upper right corner, the lower left corner and the lower right corner of the binary image as 4 character search areas; horizontally projecting each character search area to determine the upper boundary and the lower boundary of the character line in each character search area; performing vertical projection on each character search area to determine the left boundary and the right boundary of each character in each character search area and the number of the characters; determining a character search area with characters in the 4 character search areas according to the number of the characters; determining the coordinates of a cutting area according to the upper boundary and the lower boundary of a character line of a character search area with characters and the left boundary and the right boundary of each character; then, the DICOM image or each frame of DICOM image of the DICOM animation is cut according to the coordinates of the cutting area to obtain the cut DICOM image, and the cut DICOM image is stored in a designated file; after the DICOM images or DICOM animation in the folder needing to generate the DICOMDIR file are completely cut, all the cut DICOM images in the appointed file are generated into the DICOMDIR file. The method comprises the steps of firstly determining a character search area in a DICOM image, then searching character characters by adopting a horizontal projection and vertical projection mode, determining the coordinates of a cutting area, cutting the DICOM image, generating a DICOMDIR file from the cut DICOM image, removing the characters of the DICOM image, and realizing anonymization processing of patient information or inspection information in image data.
The equivalent embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts between the equivalent embodiments can be referred to each other.
The principles and embodiments of the present invention have been described herein using specific examples, which are provided only to help understand the method and the core concept of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, the specific embodiments and the application range may be changed. In summary, this summary should not be construed to limit the present invention.

Claims (10)

1. A method for generating a DICOMDIR file, the method comprising the steps of:
extracting DICOM images or DICOM animations of all DICOM files in a folder needing to generate the DICOMDIR files;
obtaining a DICOM image or a first frame DICOM image of a DICOM animation to obtain a DICOM image to be processed;
carrying out binarization processing on the DICOM image to be processed to obtain a binary image;
defining the upper left corner, the upper right corner, the lower left corner and the lower right corner of the binary image as 4 character search areas;
horizontally projecting each character search area to determine the upper boundary and the lower boundary of the character line in each character search area;
performing vertical projection on each character search area to determine the left boundary and the right boundary of each character in each character search area and the number of the characters;
determining a character search area with characters in the 4 character search areas according to the number of the characters;
determining the coordinates of a cutting area according to the upper boundary and the lower boundary of a character line of a character search area with characters and the left boundary and the right boundary of each character;
cutting the DICOM image or each frame of DICOM image of the DICOM animation according to the coordinates of the cutting area to obtain a cut DICOM image, and storing the cut DICOM image into a designated file;
returning to the step of obtaining the DICOM image or the first frame DICOM image of the DICOM animation to obtain a DICOM image to be processed, and cutting the next DICOM image or DICOM animation until all DICOM images and DICOM animation in the folder needing to generate the DICOMDIR file are cut;
and generating a DICOMDIR file from all the cut DICOM images in the designated file.
2. The method of generating a DICOMDIR file in claim 1, wherein the extracting all DICOM images or DICOM animations of DICOM files in the folder in which the DICOMDIR file is to be generated further comprises:
extracting DICOM TAG information in all DICOM files in a folder needing to generate the DICOMDIR files;
modifying the DICOM TAG information according to the TAG information which is designated by a user in a set file and needs anonymization to obtain the modified DICOM TAG information;
and writing the modified DICOM TAG information into a DICOM file corresponding to the DICOM TAG information to obtain the DICOM file modified by the DICOM TAG information.
3. The method of claim 1, wherein the horizontally projecting each of the word search areas to determine the upper and lower boundaries of the character lines within each of the word search areas comprises:
and projecting the character search area of the binary image in the horizontal direction, and determining the upper boundary and the lower boundary of the character line of the character search area according to the fact that the average value of the integral projection of the character in the horizontal direction is higher than the average value of the integral projection of the character in the horizontal direction of the background.
4. The method of claim 1, wherein the vertically projecting each of the word search areas determines the left and right boundaries and the number of characters of each character in each of the word search areas, and further comprises
And performing vertical projection on a character search area of the binary image, and determining the left boundary and the right boundary of each character and the number of the characters in the character search area according to the fact that the average value of the vertical integral projection of the character is higher than the average value of the vertical integral projection of the background and the threshold ranges of the width, the height and the interval of the characters.
5. The method for generating a DICOM dir file according to claim 1, wherein the generating the DICOM image after cutting out all the designated files into the DICOM dir file specifically comprises:
calculating the sum of the sizes of all the cut DICOM images in the appointed folder;
calculating the number of DICOMDIR files to be generated according to the sum of the sizes of all the cut DICOM images in the appointed folder;
and generating the number of DICOMDIR files by using a DICOMDIR creating function to all the cut DICOM images in the appointed folder.
6. A system for generating a DICOMDIR file, the system comprising:
the DICOM image or DICOM animation extracting module is used for extracting DICOM images or DICOM animation of all DICOM files in a folder needing to generate the DICOMDIR files;
the DICOM image acquisition module to be processed is used for acquiring a DICOM image or a first frame DICOM image of the DICOM animation to obtain the DICOM image to be processed;
the binarization processing module is used for carrying out binarization processing on the DICOM image to be processed to obtain a binary image;
a character search area determining module, configured to define an upper left corner, an upper right corner, a lower left corner, and a lower right corner of the binary image as 4 character search areas;
the upper and lower boundary determining module is used for horizontally projecting each character searching area to determine the upper boundary and the lower boundary of the character line in each character searching area;
the left and right boundary determining module is used for performing vertical projection on each character searching area to determine the left boundary and the right boundary of each character in each character searching area and the number of the characters;
the character search area determination module is used for determining character search areas with characters in 4 character search areas according to the number of the characters;
the cutting area determining module is used for determining the coordinates of the cutting area according to the upper boundary and the lower boundary of the character row of the character search area with the characters and the left boundary and the right boundary of each character;
the cutting module is used for cutting the DICOM image or each frame of DICOM image of the DICOM animation according to the coordinates of the cutting area to obtain the cut DICOM image, and storing the cut DICOM image into a specified file;
the return module is used for returning to the step of obtaining the DICOM image or the first frame DICOM image of the DICOM animation to obtain a DICOM image to be processed, and cutting the next DICOM image or DICOM animation until all DICOM images and DICOM animation in the folder needing to generate the DICOMDIR file are cut;
and the DICOMDIR file generating module is used for generating the DICOMDIR file from all the cut DICOM images in the appointed file.
7. The system of claim 6, wherein the system further comprises:
the DICOM TAG information extraction module is used for extracting DICOM TAG information of all DICOM files in a folder needing to generate the DICOM DIR files;
the DICOM TAG information modifying module is used for modifying the DICOM TAG information according to the TAG information which is designated by a user in a set file and needs anonymization to obtain the modified DICOM TAG information;
and the modified DICOM TAG information storage module is used for writing the modified DICOM TAG information into the DICOM file corresponding to the DICOM TAG information to obtain the DICOM file modified by the DICOM TAG information.
8. The system for generating a DICOMDIR file according to claim 6, wherein the upper and lower boundary determining module comprises:
and the upper and lower boundary determining submodule is used for projecting the character searching area of the binary image in the horizontal direction, and determining the upper boundary and the lower boundary of the character line of the character searching area according to the fact that the average value of the integral projection of the character in the horizontal direction is higher than the average value of the integral projection of the character in the horizontal direction of the background.
9. The system of claim 6, wherein the left and right boundary determining module comprises
And the left and right boundary determining submodule is used for performing vertical direction projection on a character searching area of the binary image, and determining the left boundary, the right boundary and the number of characters of each character in the character searching area according to the vertical direction integral projection average value of the character characters which is higher than the vertical direction integral projection average value of the background and the threshold range of the width, the height and the interval of the character.
10. The system of claim 6, wherein the DICOMDIR file generation module comprises:
the size and sum calculating submodule is used for calculating the sum of the sizes of all the cut DICOM images in the appointed folder;
the number calculation submodule of the DICOMDIR files required to be generated is used for calculating the number of the DICOMDIR files required to be generated according to the sum of the sizes of all the cut DICOM images in the appointed folder;
and the DICOMDIR file generation submodule is used for generating the number of the DICOMDIR files from all the cut DICOM images in the appointed folder by utilizing a DICOMDIR creating function.
CN202010460454.2A 2020-05-27 2020-05-27 DICOMDIR file generation method and system Active CN111613305B (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
CN202010460454.2A CN111613305B (en) 2020-05-27 2020-05-27 DICOMDIR file generation method and system
PCT/CN2021/093861 WO2021238680A1 (en) 2020-05-27 2021-05-14 Method and system for generating dicomdir file
JP2022573315A JP2023527090A (en) 2020-05-27 2021-05-14 DICOMDIR file creation method and DICOMDIR file creation system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010460454.2A CN111613305B (en) 2020-05-27 2020-05-27 DICOMDIR file generation method and system

Publications (2)

Publication Number Publication Date
CN111613305A true CN111613305A (en) 2020-09-01
CN111613305B CN111613305B (en) 2024-04-30

Family

ID=72200562

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010460454.2A Active CN111613305B (en) 2020-05-27 2020-05-27 DICOMDIR file generation method and system

Country Status (3)

Country Link
JP (1) JP2023527090A (en)
CN (1) CN111613305B (en)
WO (1) WO2021238680A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112071403A (en) * 2020-09-09 2020-12-11 苏州小艺物联科技有限公司 DICOMDIR file generation method and system containing icon images
WO2021238680A1 (en) * 2020-05-27 2021-12-02 周兴祥 Method and system for generating dicomdir file

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101295332A (en) * 2008-04-30 2008-10-29 深圳市蓝韵实业有限公司 DICOM file patient information anonymization processing method
US20140063219A1 (en) * 2012-08-28 2014-03-06 General Electric Company System and method including a portable user profile for medical imaging systems
CN104036292A (en) * 2014-06-12 2014-09-10 西安华海盈泰医疗信息技术有限公司 Medical imaging digital film text area extracting method and system
CN105160343A (en) * 2015-08-12 2015-12-16 蓝网科技股份有限公司 Information identification method and device applied to film on-demand-printing system
CN110419043A (en) * 2017-03-17 2019-11-05 普罗克拉提欧有限公司 Personal medical information data managing method and system
CN111145874A (en) * 2018-11-02 2020-05-12 北京赛迈特锐医疗科技有限公司 Medical image underlying basic data management system and management method thereof

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3410324B1 (en) * 2017-05-30 2019-05-08 Siemens Healthcare GmbH Determining an anonymous dose report image
CN111613305B (en) * 2020-05-27 2024-04-30 周兴祥 DICOMDIR file generation method and system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101295332A (en) * 2008-04-30 2008-10-29 深圳市蓝韵实业有限公司 DICOM file patient information anonymization processing method
US20140063219A1 (en) * 2012-08-28 2014-03-06 General Electric Company System and method including a portable user profile for medical imaging systems
CN104036292A (en) * 2014-06-12 2014-09-10 西安华海盈泰医疗信息技术有限公司 Medical imaging digital film text area extracting method and system
CN105160343A (en) * 2015-08-12 2015-12-16 蓝网科技股份有限公司 Information identification method and device applied to film on-demand-printing system
CN110419043A (en) * 2017-03-17 2019-11-05 普罗克拉提欧有限公司 Personal medical information data managing method and system
CN111145874A (en) * 2018-11-02 2020-05-12 北京赛迈特锐医疗科技有限公司 Medical image underlying basic data management system and management method thereof

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021238680A1 (en) * 2020-05-27 2021-12-02 周兴祥 Method and system for generating dicomdir file
CN112071403A (en) * 2020-09-09 2020-12-11 苏州小艺物联科技有限公司 DICOMDIR file generation method and system containing icon images
WO2022052884A1 (en) * 2020-09-09 2022-03-17 周兴祥 Method and system for generating dicomdir file containing icon image
CN112071403B (en) * 2020-09-09 2023-09-12 周兴祥 DICOMDIR file generation method and system containing icon images

Also Published As

Publication number Publication date
JP2023527090A (en) 2023-06-26
WO2021238680A1 (en) 2021-12-02
CN111613305B (en) 2024-04-30

Similar Documents

Publication Publication Date Title
US11967074B2 (en) Method and system for computer-aided triage
US11145059B2 (en) Medical scan viewing system with enhanced training and methods for use therewith
CN106560827B (en) Control method
US11749413B2 (en) Method for controlling information terminal, and recording medium
US20210110196A1 (en) Deep Learning Network for Salient Region Identification in Images
CN106560828B (en) Control method
US20160247300A1 (en) Control method of information terminal and recording medium
CN111613305A (en) Method and system for generating DICOMDIR file
US20220415491A1 (en) Method and system for computer-aided triage of stroke
US10235583B2 (en) Electronically shredding a document
CN111291813B (en) Image labeling method, device, computer equipment and storage medium
US20220020482A1 (en) Systems and methods for augmented reality-enhanced field services support
US11462315B2 (en) Medical scan co-registration and methods for use therewith
JP2017191457A (en) Report creation apparatus and control method thereof
JP6805736B2 (en) Similar case image search program, similar case image search device and similar case image search method
US9538920B2 (en) Standalone annotations of axial-view spine images
US10916343B2 (en) Reduce discrepancy of human annotators in medical imaging by automatic visual comparison to similar cases
US20190108637A1 (en) Displaying methods and systems
CN113260988A (en) Character acquisition, page processing and knowledge graph construction method, device and medium
US20110320218A1 (en) Medical image processing server and managing method for medical image processing server
CN111161240A (en) Blood vessel classification method, computer device and readable storage medium
KR102659323B1 (en) Masking method and system for building medical image data for artificial intelligence learning
KR102133708B1 (en) Method and system and for sharing medical image between medical institutions
CN112837324A (en) Automatic tumor image region segmentation system and method based on improved level set
CN111710379A (en) Personal medical information processing method, system, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant