WO2021238680A1 - 一种dicomdir文件的生成方法及系统 - Google Patents

一种dicomdir文件的生成方法及系统 Download PDF

Info

Publication number
WO2021238680A1
WO2021238680A1 PCT/CN2021/093861 CN2021093861W WO2021238680A1 WO 2021238680 A1 WO2021238680 A1 WO 2021238680A1 CN 2021093861 W CN2021093861 W CN 2021093861W WO 2021238680 A1 WO2021238680 A1 WO 2021238680A1
Authority
WO
WIPO (PCT)
Prior art keywords
dicom
image
dicomdir
file
text search
Prior art date
Application number
PCT/CN2021/093861
Other languages
English (en)
French (fr)
Inventor
周兴祥
于全文
Original Assignee
周兴祥
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 周兴祥 filed Critical 周兴祥
Priority to JP2022573315A priority Critical patent/JP2023527090A/ja
Publication of WO2021238680A1 publication Critical patent/WO2021238680A1/zh

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

Definitions

  • the invention belongs to the technical field of image processing, and specifically relates to a method and system for generating a DICOMDIR file.
  • DICOM images usually saved on CD or DVD are managed by DICOMDIR files, and the DICOM images in CD or DVD can be browsed through the image browsing software that comes with the disk.
  • Patent CN1567338A discloses a digital medical information burning method and system, which can realize the burning and saving of medical DICOM images or other medical information on CD or DVD media, without mentioning the generation and preservation of DICOMDIR.
  • Patent WO 2015/008650 A1 discloses a DICOMDIR production and compression storage method, which realizes the storage and management method of DICOMDIR files on CD or DVD.
  • the purpose of the present invention is to provide a method and system for generating DICOMDIR files, so as to realize the anonymization of patient information or examination information in image data.
  • the present invention provides the following solutions:
  • a method for generating a DICOMDIR file includes the following steps:
  • the extraction of DICOM images or DICOM animations of all DICOM files in the folder where the DICOMDIR file needs to be generated includes:
  • the horizontal projection of each text search area to determine the upper boundary and the lower boundary of the character line in each text search area specifically includes:
  • the vertical projection of each of the text search areas to determine the left and right boundaries and the number of characters of each character in each of the text search areas specifically includes
  • the text search area of the binary image is projected in the vertical direction, and the text search area is determined according to the average value of the vertical integral projection of the text character higher than the average vertical integral projection of the background, and the threshold range of the character width, height and spacing The left and right boundaries of each character and the number of characters.
  • the generating a DICOMDIR file from all the cropped DICOM images in the specified file specifically includes:
  • DICOMDIR creation function uses the DICOMDIR creation function to generate the number of DICOMDIR files from all the cropped DICOM images in the specified folder.
  • a DICOMDIR file generation system includes:
  • DICOM image or DICOM animation extraction module used to extract DICOM images or DICOM animations of all DICOM files in the folder where DICOMDIR files need to be generated
  • the to-be-processed DICOM image acquisition module is used to acquire the DICOM image or the first DICOM image of the DICOM animation to obtain the to-be-processed DICOM image;
  • the binarization processing module is used to perform binarization processing on the DICOM image to be processed to obtain a binary image
  • the text search area determination module is used to define the upper left corner, the upper right corner, the lower left corner and the lower right corner of the binary image as 4 text search areas;
  • the upper and lower boundary determination module is configured to perform horizontal projection on each of the text search areas to determine the upper and lower boundaries of the character line in each of the text search areas;
  • the left and right boundary determination module is configured to perform vertical projection on each of the text search areas to determine the left and right boundaries of each character in each of the text search areas and the number of characters;
  • the character search area determining module is used to determine the character search areas in the four text search areas according to the number of characters;
  • the cropping area determination module is used to determine the coordinates of the cropping area according to the upper and lower boundaries of the character line of the text search area where the characters exist, and the left and right boundaries of each character;
  • the cropping module is used to crop the DICOM image or each frame of the DICOM image of the DICOM animation according to the coordinates of the cropping area to obtain the cropped DICOM image, and save the cropped DICOM image to a designated file middle;
  • the return module is used to return to the step of "obtain the first DICOM image of a DICOM image or DICOM animation, and get the DICOM image to be processed", and crop the next DICOM image or DICOM animation until the folder where the DICOMDIR file needs to be generated is cut. All DICOM images and DICOM animations;
  • the DICOMDIR file generation module is used to generate DICOMDIR files from all the cropped DICOM images in the specified file.
  • the generating system further includes:
  • the DICOM TAG information extraction module is used to extract the DICOM TAG information of all DICOM files in the folder where the DICOMDIR file needs to be generated;
  • the DICOM TAG information modification module is used to modify the DICOM TAG information according to the TAG information specified by the user to be anonymized in the setting file to obtain the modified DICOM TAG information;
  • the modified DICOM TAG information storage module is used to write the modified DICOM TAG information into the DICOM file corresponding to the DICOM TAG information to obtain the DICOM file with the modified DICOM TAG information.
  • the upper and lower boundary determining module specifically includes:
  • the upper and lower boundary determination sub-module is used to project the text search area of the binary image in the horizontal direction, and determine the characters in the text search area according to the average value of the integral projection in the horizontal direction of the text character being higher than the average value of the background in the horizontal direction.
  • the upper and lower boundaries of the row are used to project the text search area of the binary image in the horizontal direction, and determine the characters in the text search area according to the average value of the integral projection in the horizontal direction of the text character being higher than the average value of the background in the horizontal direction.
  • the left and right boundary determination module specifically includes
  • the left and right boundary determination sub-module is used to project the text search area of the binary image in the vertical direction, according to the vertical integration projection average value of the text characters higher than the background vertical integration projection average value, and the character width, height and spacing
  • the threshold range determines the left and right boundaries of each character in the text search area and the number of characters.
  • the DICOMDIR file generation module specifically includes:
  • the size and size calculation sub-module is used to calculate the size and size of all the cropped DICOM images in the specified folder;
  • the number calculation sub-module of DICOMDIR files to be generated is used to calculate the number of DICOMDIR files to be generated according to the sum of the size of all the cropped DICOM images in the specified folder;
  • the DICOMDIR file generation sub-module is used to generate the number of DICOMDIR files from all the cropped DICOM images in the specified folder by using the DICOMDIR creation function.
  • the present invention provides a method and system for generating a DICOMDIR file.
  • the method of generating firstly obtains the DICOM image in the folder where the DICOMDIR file needs to be generated or the first DICOM image of the DICOM animation to obtain the DICOM image to be processed; Binarize the DICOM image to be processed to obtain a binary image; define the upper left corner, upper right corner, lower left corner, and lower right corner of the binary image as four text search areas; search for each text The area is horizontally projected to determine the upper boundary and the lower boundary of the character line in each text search area; each of the text search areas is projected vertically to determine the left boundary and the left boundary of each character in each text search area.
  • the right margin and the number of characters; the four text search areas where characters exist in the text search area are determined according to the number of characters; the upper and lower borders of the character line in the text search area where characters exist and the left border of each character And the right boundary, determine the coordinates of the cropping area; then, crop the DICOM image or each frame of the DICOM animation according to the coordinates of the crop area to obtain the cropped DICOM image, and then crop the DICOM image. Save the DICOM image in the specified file; after all the DICOM images or DICOM animations in the folder where the DICOMDIR file needs to be generated are cropped, all the cropped DICOM images in the specified file will be generated into DICOMDIR files.
  • the present invention first determines the text search area in the DICOM image, then uses horizontal projection and vertical projection to search for text characters, determines the coordinates of the cropped area, crops the DICOM image, and generates a DICOMDIR file from the cropped DICOM image , Realize the anonymization of patient information or examination information in the image data.
  • the present invention not only removes the characters existing in the DICOM image data, but also modifies the DICOM TAG specified in the DICOM image file that needs to be anonymized, and realizes the anonymization process for generating the DICODIR file.
  • Figure 1 is a flow chart of a method for generating DICOMDIR files provided by the present invention
  • Figure 2 is a schematic diagram of a method for generating a DICOMDIR file provided by the present invention
  • Fig. 3 is a schematic diagram of a cut rectangle provided by the present invention.
  • the purpose of the present invention is to provide a method and system for generating DICOMDIR files, so as to realize the anonymization of patient information or examination information in image data.
  • the present invention provides a method for generating a DICOMDIR file.
  • the method includes the following steps:
  • the DICOM TAG information of the DICOM image also contains the patient's information. Therefore, the DICOM TAG information of the DICOM image also needs to be anonymized.
  • the present invention also provides a method for anonymizing DICOM TAG information related to patients and diagnosis in DICOM images, which specifically includes: extracting the DICOM TAG information of all DICOM files in the folder where the DICOMDIR file needs to be generated; according to the user in the setting file Specify DICOM TAG information such as patient information that needs to be anonymized, modify the DICOM TAG information to obtain the modified DICOM TAG information; write the modified DICOM TAG information into the DICOM file corresponding to the DICOM TAG information, Get the DICOM file with the modified DICOM TAG information.
  • the DICOM TAG information that needs to be anonymized for setting includes patient information and examination information; DICOM files managed by DICOMDIR save subdirectories and other information to an XML or CSV file, and when the DICOMDIR file is created, the settings in the specified file are read
  • the setting information of the file, the setting information includes the content that needs to be anonymized as specified by the user, such as patient name, patient ID, diagnosis doctor name, when generating DICOMDIR, DICOM image saving subdirectory information (subdirectory or No subdirectories, user settings).
  • Step 101 Extract DICOM images or DICOM animations of all DICOM files in the folder where the DICOMDIR file needs to be generated.
  • Step 102 Obtain the DICOM image or the first DICOM image of the DICOM animation to obtain the DICOM image to be processed.
  • Steps 101 and 102 specifically include: specifying the folder where the DICOM images that need to generate DICOMDIR exist, reading all the DICOM image files existing in the folder, and reading the DICOM TAG information of all the images into the memory.
  • Steps 101 and 102 specifically include: specifying the folder where the DICOM images that need to generate DICOMDIR exist, reading all the DICOM image files existing in the folder, and reading the DICOM TAG information of all the images into the memory.
  • take DICOM image as the unit read the image data in each DICOM file to the memory, if it is an animated DICOM image, read the first frame image in the DICOM file to the memory.
  • Step 103 Binarize the DICOM image to be processed to obtain a binary image.
  • the Niblack local binarization method is used to binarize the to-be-processed DICOM image stored in the memory to obtain a frame of binary image.
  • Step 104 Define the upper left corner, upper right corner, lower left corner, and lower right corner of the binary image as four text search areas.
  • Patient information in the DICOM image data it is usually in the upper left corner, or upper right corner, or lower left corner, or lower right corner of the image.
  • Step 105 Perform horizontal projection on each text search area to determine the upper boundary and the lower boundary of the character line in each text search area.
  • performing horizontal projection on each of the text search areas to determine the upper and lower boundaries of the character lines in each of the text search areas specifically includes: performing horizontal projection on the text search area of the binary image, according to The average value of the integral projection in the horizontal direction of the text character is higher than the average value of the integral projection in the horizontal direction of the background, and the upper boundary and the lower boundary of the character line of the text search area are determined.
  • Step 106 Perform vertical projection on each of the text search areas to determine the left and right borders and the number of characters of each character in each of the text search areas.
  • step 106 vertical projection is performed on each of the text search areas to determine the left and right borders and the number of characters of each character in each of the text search areas, which specifically includes: the text search area of the binary image Perform vertical projection, and determine the left and right boundaries of each character in the text search area based on the average value of the vertical integral projection of the text characters higher than that of the background, and the threshold range of the character width, height and spacing And the number of characters.
  • Step 105 and step 106 specifically include: for the obtained binary image, according to the characteristics of the text area within a certain range, before the projection process, delete the area that is too small or the area that is too large, and only keep the area within the text area.
  • the binary image of each text search area is first projected in the horizontal direction, and the upper and lower boundaries of the character line are located and saved in the memory; then the binary image of the text search area is projected in the vertical direction. Locate the left and right boundaries of each character and save them to the memory.
  • the width, height, and aspect ratio of the text are within a certain threshold range.
  • Step 107 Determine, according to the number of characters, four text search areas in which characters exist in the text search areas.
  • Step 108 Determine the coordinates of the cropping area according to the upper and lower borders of the character line of the text search area where the characters exist, and the left and right borders of each character.
  • the maximum X and Y coordinates and the minimum X and Y coordinate ranges of each character area are calculated from the range of the entire image area
  • the rectangular area in the middle of the image that does not include characters is calculated as a trimming rectangle and the coordinates of the rectangle are stored in the memory.
  • the trimming rectangle range is shown in Figure 3, and there are text areas in the upper left corner and the upper right corner. If there are no text characters in each text search area, the rectangular coordinates of the cropping area (the dotted line in FIG. 3) are not saved.
  • Step 109 Crop the DICOM image or each frame of the DICOM image of the DICOM animation according to the coordinates of the cropping area to obtain a cropped DICOM image, and save the cropped DICOM image to a designated file; Go back to the step "Obtain the DICOM image or the first DICOM image of the DICOM animation in the folder where the DICOMDIR file needs to be generated, and get the DICOM image to be processed", and crop the next DICOM image or DICOM animation until the DICOMDIR file needs to be generated. All DICOM images and DICOM animations in the folder.
  • Step 110 Generate a DICOMDIR file from all the cropped DICOM images in the specified file.
  • step 110 all the cropped DICOM images in the specified file are generated into a DICOMDIR file, which specifically includes: calculating the sum of the sizes of all cropped DICOM images in the specified folder; and according to all cropped DICOM images in the specified folder Calculate the number of DICOMDIR files that need to be generated by the sum of the size of the DICOM image; use the DICOMDIR creation function to generate the number of DICOMDIR files from all the cropped DICOM images in the specified folder.
  • the DICOM file will be generated in the same directory as the DICOMDIR file according to the rules of DICOMDIR; if the file is set If the subdirectory where the DICOM file managed by DICOMDIR needs to be generated is specified in the file, the DICOM file will be generated and saved in the specified subdirectory according to the rules of DICOMDIR.
  • the present invention also provides a DICOMDIR file generation system, which includes:
  • DICOM image or DICOM animation extraction module used to extract DICOM images or DICOM animations of all DICOM files in the folder where DICOMDIR files need to be generated
  • the to-be-processed DICOM image acquisition module is used to acquire the DICOM image or the first DICOM image of the DICOM animation to obtain the to-be-processed DICOM image;
  • the binarization processing module is used to perform binarization processing on the DICOM image to be processed to obtain a binary image
  • the text search area determination module is used to define the upper left corner, the upper right corner, the lower left corner and the lower right corner of the binary image as 4 text search areas;
  • the upper and lower boundary determination module is used for horizontally projecting each of the text search areas to determine the upper and lower boundaries of the character line in each of the text search areas.
  • the upper and lower boundary determining module specifically includes: the upper and lower boundary determining sub-module, which is used to project the text search area of the binary image in the horizontal direction, according to the horizontal direction integral projection average of the text characters higher than the horizontal direction integral projection average of the background Value to determine the upper boundary and lower boundary of the character line in the text search area.
  • the left and right boundary determination module is used to vertically project each of the text search areas to determine the left and right boundaries and the number of characters of each character in each of the text search areas.
  • the left and right boundary determination module specifically includes a left and right boundary determination sub-module for vertical projection of the text search area of the binary image, and the average value of the integral projection according to the vertical direction of the text character is higher than that of the background.
  • the threshold range of character width, height and spacing determine the left and right borders and the number of characters of each character in the text search area.
  • the character search area determining module is used to determine the character search areas in the four text search areas according to the number of characters;
  • the cropping area determination module is used to determine the coordinates of the cropping area according to the upper and lower boundaries of the character line of the text search area where the characters exist, and the left and right boundaries of each character;
  • the cropping module is used to crop the DICOM image or each frame of the DICOM image of the DICOM animation according to the coordinates of the cropping area to obtain the cropped DICOM image, and save the cropped DICOM image to a designated file middle;
  • the return module is used to return to the step of "obtain the first DICOM image of a DICOM image or DICOM animation, and get the DICOM image to be processed", and crop the next DICOM image or DICOM animation until the folder where the DICOMDIR file needs to be generated is cut. All DICOM images and DICOM animations;
  • the DICOMDIR file generation module is used to generate DICOMDIR files from all the cropped DICOM images in the specified file.
  • the DICOMDIR file generating module specifically includes: a size and size calculation submodule, which is used to calculate the size and size of all cropped DICOM images in a specified folder; and a number calculation submodule for DICOMDIR files that need to be generated, It is used to calculate the number of DICOMDIR files that need to be generated according to the sum of the size of all the cropped DICOM images in the specified folder; the DICOMDIR file generation sub-module is used to use the DICOMDIR creation function to cut all the crops in the specified folder The subsequent DICOM image generates the number of DICOMDIR files.
  • the generation system also includes: DICOM TAG information extraction module, used to extract DICOM TAG information of all DICOM files in the folder where DICOMDIR files need to be generated; DICOM TAG information modification module, used to modify the DICOM TAG information according to the needs specified by the user in the configuration file Anonymized TAG information, modify the DICOM TAG information to obtain the modified DICOM TAG information; the modified DICOM TAG information storage module is used to write the modified DICOM TAG information into the corresponding DICOM TAG information In the DICOM file, the DICOM file with the modified DICOM TAG information is obtained.
  • DICOM TAG information extraction module used to extract DICOM TAG information of all DICOM files in the folder where DICOMDIR files need to be generated
  • DICOM TAG information modification module used to modify the DICOM TAG information according to the needs specified by the user in the configuration file Anonymized TAG information, modify the DICOM TAG information to obtain the modified DICOM TAG information
  • the modified DICOM TAG information storage module is used to write the modified DICOM TAG information
  • 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 themes, it describes a 4-layer tree structure. It is composed of Patient, Study, Series and Image.
  • the DICOM images saved in DICOM CD or DVD are managed by DICOMDIR files, and the attached DICOM image browsing software realizes the browsing of DICOM images managed by DICOMDIR.
  • DICOM TAG information that needs to be anonymized, including patient information, examination information, DICOM image storage subdirectory information managed by DICOMDIR, etc.
  • CSV Common-Separated Values
  • the setting information in the setting file is read from the setting file that needs to be anonymized, such as patient name, patient ID, diagnosis doctor’s name, when generating DICOMDIR, DICOM image save subdirectory information (sub-directory information is possible) Directory, there can be no sub-directories, user settings).
  • the patient name and ID information set in this example need to be anonymized.
  • the patient name needs to be modified to the TEST1 character string
  • the patient ID is modified to the 00000000 character string
  • the storage medium is a 640 trillion CD.
  • the DICOM files managed by the DICOMDIR file are saved in the subdirectory DCM.
  • DICOM folder that needs to generate DICOMDIR files.
  • the DSA image is a 16-bit grayscale image and the image resolution is 1024 ⁇ 768 pixels
  • the ultrasonic image is a 24-bit color image
  • its image resolution is 640 ⁇ 480 pixels.
  • All DICOM images in this folder are images of the same patient, the patient's name is Anonymous, and the examination date is 2012.11.07.
  • information such as the patient's name and gender is shown in the upper right corner of the image, and information such as the examination date and time is shown in the upper left corner of the image.
  • the DICOM files in this folder are all animated DICOM images.
  • the first frame of each DICOM file is read to the memory in frame units.
  • the 16-bit DSA image is transformed into an 8-bit gray-scale image, 24-bit by gray scale conversion.
  • the color image of the ultrasonic wave is transformed into an 8-bit gray-scale image through the conversion of color image to gray-scale image.
  • the Niblack local binarization method is used to binarize the image data.
  • the Niblack binarization method uses the mean value and variance in the neighborhood centered on the pixel to determine the binarized segmentation threshold of the pixel.
  • a window with a size of kxk centered on the pixel (i, j), the mean value of the gray value of each pixel in this window is m, and the variance is s, then the threshold t of this point is t m+c*s, where c is the adjustment ⁇ Parameters.
  • c is selected as -0.2
  • k is selected as 5.
  • the binary image of the first frame image of each DICOM file stored in the memory is obtained.
  • each text search area with 4 corners as a rectangular area, with a width and height of 128X160 pixels, which can include the text area at the corners.
  • the binary image of each text search area is first projected in the horizontal direction, and the upper and lower boundaries of the character line can be confirmed according to the feature that the average value of the integral projection in the horizontal direction of the characters is significantly higher than the average value of the horizontal integral projection in the background area.
  • the upper and lower boundary coordinates of the possible character area and save it to the memory; then perform vertical projection on the binary image of the text search area, according to the vertical integral projection average value of the character is higher than the vertical integral projection average of the background area, the character width, For features whose height and spacing are within a certain range, the left and right boundary coordinates of each character are determined and stored in the memory.
  • the maximum width and height of the text in the image is 20x12 pixels, and the average spacing is 5 pixels.
  • the ultrasound image has a text area of the examination date in the upper left corner, a text area such as the patient's name in the upper right corner, the lower left ROI and the lower right ROI There is no text character area.
  • the maximum X coordinate of the text in the upper left ROI area is 170, and the maximum Y coordinate is 48; the minimum X coordinate of the text in the upper right ROI area is 460, and the maximum Y coordinate is 64.
  • the image size is 640x480 pixels.
  • the X coordinate of the upper left corner of the cropped area is 170
  • the Y coordinate is 64
  • the X coordinate of the upper right corner is 460
  • the Y coordinate is 64
  • the X coordinate of the lower left corner is 170
  • the Y coordinate is 480
  • right The X coordinate of the lower corner is 460
  • the Y coordinate is 480
  • the width and height of the cropped area is 290x416 pixels.
  • the patient name (0010, 0010) in the TAG information stored in the memory obtained in (2) is modified as the TEST1 character string
  • the patient ID (0010, 0020) is the 00000000 character string.
  • Read the image data of each frame in the DICOM file use the trimming rectangle obtained in (5) to trim the image of each frame and save it in the DICOM file, and modify the image width (0028, 0011) and height in the DICOM file at the same time (0028, 0010)
  • the TAG value is the width and height of the cropped rectangular area; if there is no anonymization setting such as DICOM patient information in the setting file, no modification is made to the DICOM file.
  • the present invention provides a method and system for generating a DICOMDIR file.
  • the method of generating firstly obtains the DICOM image in the folder where the DICOMDIR file needs to be generated or the first DICOM image of the DICOM animation to obtain the DICOM image to be processed; Binarize the DICOM image to be processed to obtain a binary image; define the upper left corner, upper right corner, lower left corner, and lower right corner of the binary image as four text search areas; search for each text The area is horizontally projected to determine the upper boundary and the lower boundary of the character line in each text search area; the vertical projection is performed on each text search area to determine the left boundary and the left boundary of each character in each text search area The right margin and the number of characters; the four text search areas where characters exist in the text search area are determined according to the number of characters; the upper and lower borders of the character line in the text search area where characters exist and the left border of each character And the right boundary, determine the coordinates of the cropped area; then, crop the DICOM image or each frame of the DI
  • the present invention first determines the text search area in the DICOM image, then uses horizontal projection and vertical projection to search for text characters, determines the coordinates of the cropping area, crops the DICOM image, and generates a DICOMDIR file from the cropped DICOM image , The characters of the DICOM image are removed, and the patient information or examination information existing in the image data is anonymized.

Landscapes

  • Health & Medical Sciences (AREA)
  • Nuclear Medicine, Radiotherapy & Molecular Imaging (AREA)
  • Radiology & Medical Imaging (AREA)
  • Engineering & Computer Science (AREA)
  • Epidemiology (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Primary Health Care (AREA)
  • Public Health (AREA)
  • Processing Or Creating Images (AREA)
  • Image Analysis (AREA)
  • Medical Treatment And Welfare Office Work (AREA)
  • Measuring And Recording Apparatus For Diagnosis (AREA)
  • Image Processing (AREA)

Abstract

一种DICOMDIR文件的生成方法及系统,首先确定DICOM图像中的文字搜索区域,然后,采用水平投影和垂直投影的方式进行文字字符的搜索,确定裁剪区域的坐标,对DICOM图像进行裁剪,并将裁剪后的DICOM图像生成DICOMDIR文件,去除了DICOM图像的字符,实现了图像数据中存在的患者信息或是检查信息的匿名化处理。

Description

一种DICOMDIR文件的生成方法及系统
本申请要求于2020年5月27日提交中国专利局、申请号为202010460454.2、发明名称为“一种DICOMDIR文件的生成方法及系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明属于图像处理技术领域,具体涉及一种DICOMDIR文件的生成方法及系统。
背景技术
目前在医院中,CT、核磁共振、血管造影诊断装置及超音波诊断装置等产生的医学DICOM(Digital Imaging and Communications in Medicine)影像,可以在便携式的CD或是DVD媒体上保存为DICOM图像,交给患者保管或是转院时交给其他第三方医疗机构,实现了无胶片化管理。
通常保存到CD或是DVD上的DICOM图像,通过DICOMDIR文件进行管理,并可以通过随盘附带的影像浏览软件浏览CD或是DVD中的DICOM图像。
专利CN1567338A中,公开了一种数字医疗信息的烧录方法和系统,可以实现医学DICOM影像或是其他医学信息在CD或是DVD媒体的烧录保存,没有提及DICOMDIR的生成和保存问题。专利WO 2015/008650 A1公开了一种DICOMDIR制作及压缩保存方法,实现了DICOMDIR文件的CD或是DVD上的保存及管理方法。
但是,医生在学术会议发表或是特定研究场合,为了避免侵犯病人隐私权的问题,需要对生成的CD或是DVD的DICOMDIR文件及DICOM影像中的患者及检查等关联的DICOM TAG进行匿名化。由于,DICOM的SC(Second Capture)图像,或是超音波图像等,也会有患者的名字等 信息存在在图像数据中,因此,仅仅匿名化DOCOM或是DICOMDIR中的患者信息及检查信息等是不够的。
如何对图像数据中存在的患者信息或是检查信息等进行匿名化处理成为一个亟待解决的技术问题。
发明内容
本发明的目的是提供一种DICOMDIR文件的生成方法及系统,以实现对图像数据中存在的患者信息或是检查信息进行匿名化处理。
为实现所述目的,本发明提供了如下方案:
一种DICOMDIR文件的生成方法,所述生成方法包括如下步骤:
提取需要生成DICOMDIR文件的文件夹内的所有DICOM文件的DICOM图像或DICOM动画;
获取DICOM图像或DICOM动画的第一帧DICOM图像,得到待处理DICOM图像;
对所述待处理DICOM图像进行二值化处理,得到二值图像;
将所述二值图像的左上角、右上角、左下角和右下角定义为4个文字搜索区域;
对每个所述文字搜索区域进行水平投影确定每个所述文字搜索区域内字符行的上边界和下边界;
对每个所述文字搜索区域进行垂直投影确定每个所述文字搜索区域内的每个字符的左边界和右边界及字符个数;
根据字符个数确定4个所述文字搜索区域中存在字符的文字搜索区域;
根据存在字符的文字搜索区域的字符行的上边界和下边界及每个字符的左边界和右边界,确定裁剪区域的坐标;
根据所述裁剪区域的坐标对所述DICOM图像或对所述DICOM动画的每一帧DICOM图像进行裁剪,获得裁剪后的DICOM图像,并将裁剪后的DICOM图像保存至指定文件中;
返回步骤“获取DICOM图像或DICOM动画的第一帧DICOM图像, 得到待处理DICOM图像”,对下一个DICOM图像或DICOM动画进行裁剪,直到裁剪完需要生成DICOMDIR文件的文件夹内的所有DICOM图像和DICOM动画;
将指定文件中所有的裁剪后的DICOM图像生成DICOMDIR文件。
可选的,所述提取需要生成DICOMDIR文件的文件夹内的所有DICOM文件的DICOM图像或DICOM动画,之前还包括:
提取需要生成DICOMDIR文件的文件夹内的所有DICOM文件的DICOM TAG信息;
根据设定文件中用户指定的需要匿名化的TAG信息,对所述DICOM TAG信息进行修改,获得修改后的DICOM TAG信息;
将修改后的DICOM TAG信息写入所述DICOM TAG信息对应的DICOM文件中,得到DICOM TAG信息修改后的DICOM文件。
可选的,所述对每个所述文字搜索区域进行水平投影确定每个所述文字搜索区域内字符行的上边界和下边界,具体包括:
对二值图像的文字搜索区域进行水平方向投影,根据文字字符的水平方向积分投影平均值高于背景的水平方向积分投影平均值,确定所述文字搜索区域的字符行的上边界和下边界。
可选的,所述对每个所述文字搜索区域进行垂直投影确定每个所述文字搜索区域内的每个字符的左边界和右边界及字符个数,具体包括
对二值图像的文字搜索区域进行垂直方向投影,根据文字字符的垂直方向积分投影平均值高于背景的垂直方向积分投影平均值,及字符宽度、高度和间距的阈值范围,确定文字搜索区域中各个字符的左边界和右边界及字符个数。
可选的,所述将指定文件中所有的裁剪后的DICOM图像生成DICOMDIR文件,具体包括:
计算指定文件夹中所有的裁剪后的DICOM图像的尺寸大小的和;
根据指定文件夹中所有的裁剪后的DICOM图像的尺寸大小的和,计算需要生成的DICOMDIR文件的个数;
利用DICOMDIR创建函数将指定文件夹中所有的裁剪后的DICOM图像生成所述个数的DICOMDIR文件。
一种DICOMDIR文件的生成系统,所述生成系统包括:
DICOM图像或DICOM动画提取模块,用于提取需要生成DICOMDIR文件的文件夹内的所有DICOM文件的DICOM图像或DICOM动画;
待处理DICOM图像获取模块,用于获取DICOM图像或DICOM动画的第一帧DICOM图像,得到待处理DICOM图像;
二值化处理模块,用于对所述待处理DICOM图像进行二值化处理,得到二值图像;
文字搜索区域确定模块,用于将所述二值图像的左上角、右上角、左下角和右下角定义为4个文字搜索区域;
上下边界确定模块,用于对每个所述文字搜索区域进行水平投影确定每个所述文字搜索区域内字符行的上边界和下边界;
左右边界确定模块,用于对每个所述文字搜索区域进行垂直投影确定每个所述文字搜索区域内的每个字符的左边界和右边界及字符个数;
存在字符的文字搜索区域确定模块,用于根据字符个数确定4个所述文字搜索区域中存在字符的文字搜索区域;
裁剪区域确定模块,用于根据存在字符的文字搜索区域的字符行的上边界和下边界及每个字符的左边界和右边界,确定裁剪区域的坐标;
裁剪模块,用于根据所述裁剪区域的坐标对所述DICOM图像或对所述DICOM动画的每一帧DICOM图像进行裁剪,获得裁剪后的DICOM图像,并将裁剪后的DICOM图像保存至指定文件中;
返回模块,用于返回步骤“获取DICOM图像或DICOM动画的第一帧DICOM图像,得到待处理DICOM图像”,对下一个DICOM图像或DICOM动画进行裁剪,直到裁剪完需要生成DICOMDIR文件的文件夹内的所有DICOM图像和DICOM动画;
DICOMDIR文件生成模块,用于将指定文件中所有的裁剪后的DICOM图像生成DICOMDIR文件。
可选的,所述生成系统还包括:
DICOM TAG信息提取模块,用于提取需要生成DICOMDIR文件的文件夹内的所有DICOM文件的DICOM TAG信息;
DICOM TAG信息修改模块,用于根据设定文件中用户指定需要匿名化的TAG信息,对所述DICOM TAG信息进行修改,获得修改后的DICOM TAG信息;
修改后的DICOM TAG信息存储模块,用于将修改后的DICOM TAG信息写入所述DICOM TAG信息对应的DICOM文件中,得到DICOM TAG信息修改后的DICOM文件。
可选的,所述上下边界确定模块,具体包括:
上下边界确定子模块,用于对二值图像的文字搜索区域进行水平方向投影,根据文字字符的水平方向积分投影平均值高于背景的水平方向积分投影平均值,确定所述文字搜索区域的字符行的上边界和下边界。
可选的,所述左右边界确定模块,具体包括
左右边界确定子模块,用于对二值图像的文字搜索区域进行垂直方向投影,根据文字字符的垂直方向积分投影平均值高于背景的垂直方向积分投影平均值,及字符宽度、高度和间距的阈值范围,确定文字搜索区域中各个字符的左边界和右边界及字符个数。
可选的,所述DICOMDIR文件生成模块,具体包括:
尺寸大小的和计算子模块,用于计算指定文件夹中所有的裁剪后的DICOM图像的尺寸大小的和;
需要生成的DICOMDIR文件的个数计算子模块,用于根据指定文件夹中所有的裁剪后的DICOM图像的尺寸大小的和,计算需要生成的DICOMDIR文件的个数;
DICOMDIR文件生成子模块,用于利用DICOMDIR创建函数将指定文件夹中所有的裁剪后的DICOM图像生成所述个数的DICOMDIR文件。
本发明的有益效果是:
本发明提出了一种DICOMDIR文件的生成方法及系统,所述生成方法,首先,获取需要生成DICOMDIR文件的文件夹内的DICOM图像或DICOM动画的第一帧DICOM图像,得到待处理DICOM图像;对所述待处理DICOM图像进行二值化处理,得到二值图像;将所述二值图像的左上角、右上角、左下角和右下角定义为4个文字搜索区域;对每个所述文字搜索区域进行水平投影确定每个所述文字搜索区域内字符行的上边 界和下边界;对每个所述文字搜索区域进行垂直投影确定每个所述文字搜索区域内的每个字符的左边界和右边界及字符个数;根据字符个数确定4个所述文字搜索区域中存在字符的文字搜索区域;根据存在字符的文字搜索区域的字符行的上边界和下边界及每个字符的左边界和右边界,确定裁剪区域的坐标;然后,根据所述裁剪区域的坐标对所述DICOM图像或对所述DICOM动画的每一帧DICOM图像进行裁剪,获得裁剪后的DICOM图像,并将裁剪后的DICOM图像保存至指定文件中;需要生成DICOMDIR文件的文件夹内的DICOM图像或DICOM动画全部裁剪完成后,将指定文件中所有的裁剪后的DICOM图像生成DICOMDIR文件。本发明首先确定DICOM图像中的文字搜索区域,然后,采用水平投影和垂直投影的方式进行文字字符的搜索,确定裁剪区域的坐标,对DICOM图像进行裁剪,并将裁剪后的DICOM图像生成DICOMDIR文件,实现了图像数据中存在的患者信息或是检查信息的匿名化处理。
本发明在去除了DICOM图像数据中存在的字符的同时,也修改了DICOM图像文件中指定的需要匿名化的DICOM TAG,实现了生成DICODIR文件的匿名化处理。
说明书附图
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1本发明提供的一种DICOMDIR文件的生成方法的流程图;
图2为本发明提供的一种DICOMDIR文件的生成方法的原理图;
图3为本发明提供的剪裁矩形示意图。
具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没 有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
本发明的目的是提供一种DICOMDIR文件的生成方法及系统,以实现对图像数据中存在的患者信息或是检查信息进行匿名化处理。
为使本发明的所述目的、特征和优点能够更加明显易懂,下面结合附图和具体实施方式对本发明作进一步详细的说明。
如图1和2所示,本发明提供一种DICOMDIR文件的生成方法,所述生成方法包括如下步骤:
在DICOMDIR文件的生成过程中,DICOM图像的DICOM TAG信息也存在患者的信息,因此,也需要对DICOM图像的DICOM TAG信息进行匿名化。本发明还提供了DICOM影像中的患者关联及诊断关联的DICOM TAG信息的匿名化方法,具体包括:提取需要生成DICOMDIR文件的文件夹内的所有DICOM文件的DICOM TAG信息;根据设定文件中用户指定的需要匿名化的患者信息等DICOM TAG信息,对所述DICOM TAG信息进行修改,获得修改后的DICOM TAG信息;将修改后的DICOM TAG信息写入所述DICOM TAG信息对应的DICOM文件中,得到DICOM TAG信息修改后的DICOM文件。设定需要匿名化的DICOM TAG信息包括患者信息和检查信息;DICOMDIR管理的DICOM文件保存子目录等信息到一个XML或是CSV文件中,DICOMDIR文件做成时读取该指定文件中内的设定文件的设定信息,所述设定信息包括用户规定的需要匿名化的内容,比如患者名字,患者ID,诊断医生名字,生成DICOMDIR时,DICOM图像保存子目录信息(可以有子目录,也可以没有子目录,用户设定)。
步骤101,提取需要生成DICOMDIR文件的文件夹内的所有DICOM文件的DICOM图像或DICOM动画。
步骤102,获取DICOM图像或DICOM动画的第一帧DICOM图像,得到待处理DICOM图像。
步骤101和102具体包括:指定需要生成DICOMDIR的DICOM影像存在的文件夹,读取该文件夹中存在的全部DICOM影像文件,读取全部图像的DICOM TAG信息进入内存。同时以DICOM图像为单位,读取 每个DICOM文件中的图像数据到内存,如果是动画DICOM图像,读取DICOM文件中的第一帧图像到内存。
步骤103,对所述待处理DICOM图像进行二值化处理,得到二值图像。
具体的,考虑到医学图像灰度分布不均等特征,采用Niblack局部二值化方法对保存到内存中的待处理DICOM图像进行二值化处理,得到一帧二值图像。
步骤104,将所述二值图像的左上角、右上角、左下角和右下角定义为4个文字搜索区域。
具体的,如果DICOM图像数据中存在患者信息,一般是在图像的左上角,或是右上角,或是左下角,或是右下角,设定图像的4个角部的4个ROI区域为文字搜索区域。
步骤105,对每个所述文字搜索区域进行水平投影确定每个所述文字搜索区域内字符行的上边界和下边界。
步骤106所述对每个所述文字搜索区域进行水平投影确定每个所述文字搜索区域内字符行的上边界和下边界,具体包括:对二值图像的文字搜索区域进行水平方向投影,根据文字字符的水平方向积分投影平均值高于背景的水平方向积分投影平均值,确定所述文字搜索区域的字符行的上边界和下边界。
步骤106,对每个所述文字搜索区域进行垂直投影确定每个所述文字搜索区域内的每个字符的左边界和右边界及字符个数。
步骤106所述对每个所述文字搜索区域进行垂直投影确定每个所述文字搜索区域内的每个字符的左边界和右边界及字符个数,具体包括:对二值图像的文字搜索区域进行垂直方向投影,根据文字字符的垂直方向积分投影平均值高于背景的垂直方向积分投影平均值,及字符宽度、高度和间距的阈值范围,确定文字搜索区域中各个字符的左边界和右边界及字符个数。
步骤105和步骤106具体包括:对得到的二值图像,根据文字面积大小在一定的范围内的特点,在投影处理前,删除过小或是过大的面积区域,只保留文字面积范围内的区域,然后做投影处理;对各个文字搜索区域的 2值图像先进行水平方向的投影,定位字符行的上下边界并保存到内存;然后再对文字搜索区域的二值图像进行垂直方向的投影,定位出每个字符的左右边界并保存到内存。
根据医学图像上存在的字符是英文字母或阿拉伯数字或是汉字的情况,文字的宽度,高度及宽高比在一定的阈值范围之内。计算出各个块状区域的宽度,高度和宽度及高度的比值后,使用字符的块状区域的宽度,高度及宽高比特征,判定出存在的字符区域并保存字符的坐标数值到内存。
步骤107,根据字符个数确定4个所述文字搜索区域中存在字符的文字搜索区域。
步骤108,根据存在字符的文字搜索区域的字符行的上边界和下边界及每个字符的左边界和右边界,确定裁剪区域的坐标。
具体的,根据步骤105、106和107中计算得到的结果,如果文字搜索区域存在字符区域,则计算出每个字符区域的最大X和Y坐标及最小X和Y坐标范围,从整个图像区域的矩形中计算出不包括字符的图像中间部分的矩形区域作为剪裁矩形并保存该矩形坐标到内存,剪裁矩形范围如图3所示,左上角和右上角存在文字区域。如果各个文字搜索区域中均不存在文字字符,则不保存剪裁区域(图3中的虚线部分)的矩形坐标。
步骤109,根据所述裁剪区域的坐标对所述DICOM图像或对所述DICOM动画的每一帧DICOM图像进行裁剪,获得裁剪后的DICOM图像,并将裁剪后的DICOM图像保存至指定文件中;返回步骤“获取需要生成DICOMDIR文件的文件夹内的DICOM图像或DICOM动画的第一帧DICOM图像,得到待处理DICOM图像”,对下一个DICOM图像或DICOM动画进行裁剪,直到裁剪完需要生成DICOMDIR文件的文件夹内的所有DICOM图像和DICOM动画。
具体的,如果图像中不存在文字区域,则只是修改保存在内存中TAG信息中的需要修改的患者名(0010,0010),患者ID(0010,0020)及其他需要修改的信息(xxxx,xxxx),并把修改后的TAG信息重新保存到各个DICOM文件中;如果图像中存在文字区域,除了修改保存在内存中TAG信息中的需要修改的患者信息及其他信息之外,读取每一帧的DICOM图像数 据,使用步骤108得到的剪裁矩形剪裁每一帧的图像后保存到DICOM文件中,同时修改该当DICOM文件中的图像宽度(0028,0011)和高度(0028,0010)的TAG值为剪裁矩形区域的宽度及高度。
步骤110,将指定文件中所有的裁剪后的DICOM图像生成DICOMDIR文件。
步骤110所述将指定文件中所有的裁剪后的DICOM图像生成DICOMDIR文件,具体包括:计算指定文件夹中所有的裁剪后的DICOM图像的尺寸大小的和;根据指定文件夹中所有的裁剪后的DICOM图像的尺寸大小的和,计算需要生成的DICOMDIR文件的个数;利用DICOMDIR创建函数将指定文件夹中所有的裁剪后的DICOM图像生成所述个数的DICOMDIR文件。
具体的,计算指定文件夹中全部DICOM图像的文件尺寸大小的和,根据设定文件中存在的生成CD还是DVD的DICOMDIR文件标识,计算需要生成的DICOMDIR文件的个数(CD或是DVD的枚数),然后使用DICOMDIR创建函数生成DICOMDIR文件,如果设定文件中没有指定需要生成的该DICOMDIR管理的DICOM文件保存子目录,则在DICOMDIR文件相同目录下按照DICOMDIR的规则生成DICOM文件;如果设定文件中指定了需要生成的该DICOMDIR管理的DICOM文件保存的子目录,则按照DICOMDIR的规则生成DICOM文件保存到指定的子目录中。
本发明还提供一种DICOMDIR文件的生成系统,所述生成系统包括:
DICOM图像或DICOM动画提取模块,用于提取需要生成DICOMDIR文件的文件夹内的所有DICOM文件的DICOM图像或DICOM动画;
待处理DICOM图像获取模块,用于获取DICOM图像或DICOM动画的第一帧DICOM图像,得到待处理DICOM图像;
二值化处理模块,用于对所述待处理DICOM图像进行二值化处理,得到二值图像;
文字搜索区域确定模块,用于将所述二值图像的左上角、右上角、左下角和右下角定义为4个文字搜索区域;
上下边界确定模块,用于对每个所述文字搜索区域进行水平投影确定每个所述文字搜索区域内字符行的上边界和下边界。
所述上下边界确定模块,具体包括:上下边界确定子模块,用于对二值图像的文字搜索区域进行水平方向投影,根据文字字符的水平方向积分投影平均值高于背景的水平方向积分投影平均值,确定所述文字搜索区域的字符行的上边界和下边界。
左右边界确定模块,用于对每个所述文字搜索区域进行垂直投影确定每个所述文字搜索区域内的每个字符的左边界和右边界及字符个数。
所述左右边界确定模块,具体包括左右边界确定子模块,用于对二值图像的文字搜索区域进行垂直方向投影,根据文字字符的垂直方向积分投影平均值高于背景的垂直方向积分投影平均值,及字符宽度、高度和间距的阈值范围,确定文字搜索区域中各个字符的左边界和右边界及字符个数。
存在字符的文字搜索区域确定模块,用于根据字符个数确定4个所述文字搜索区域中存在字符的文字搜索区域;
裁剪区域确定模块,用于根据存在字符的文字搜索区域的字符行的上边界和下边界及每个字符的左边界和右边界,确定裁剪区域的坐标;
裁剪模块,用于根据所述裁剪区域的坐标对所述DICOM图像或对所述DICOM动画的每一帧DICOM图像进行裁剪,获得裁剪后的DICOM图像,并将裁剪后的DICOM图像保存至指定文件中;
返回模块,用于返回步骤“获取DICOM图像或DICOM动画的第一帧DICOM图像,得到待处理DICOM图像”,对下一个DICOM图像或DICOM动画进行裁剪,直到裁剪完需要生成DICOMDIR文件的文件夹内的所有DICOM图像和DICOM动画;
DICOMDIR文件生成模块,用于将指定文件中所有的裁剪后的DICOM图像生成DICOMDIR文件。
所述DICOMDIR文件生成模块,具体包括:尺寸大小的和计算子模块,用于计算指定文件夹中所有的裁剪后的DICOM图像的尺寸大小的和;需要生成的DICOMDIR文件的个数计算子模块,用于根据指定文件夹中所有的裁剪后的DICOM图像的尺寸大小的和,计算需要生成的 DICOMDIR文件的个数;DICOMDIR文件生成子模块,用于利用DICOMDIR创建函数将指定文件夹中所有的裁剪后的DICOM图像生成所述个数的DICOMDIR文件。
所述生成系统还包括:DICOM TAG信息提取模块,用于提取需要生成DICOMDIR文件的文件夹内的所有DICOM文件的DICOM TAG信息;DICOM TAG信息修改模块,用于根据设定文件中用户指定的需要匿名化的TAG信息,对所述DICOM TAG信息进行修改,获得修改后的DICOM TAG信息;修改后的DICOM TAG信息存储模块,用于将修改后的DICOM TAG信息写入所述DICOM TAG信息对应的DICOM文件中,得到DICOM TAG信息修改后的DICOM文件。
为了说明本发明的技术方案,本发明还提供一个具体的实施方式。
DICOMDIR是一个可变长度迷你database文件。由group(0002,xxxx)和group(0004,xxxx)为主题,描述的是一个4层的树状结构(tree structure)。由Patient,Study,Series和Image构成。DICOM CD或是DVD中保存的DICOM图像,通过DICOMDIR文件进行管理,并由附带的DICOM图像浏览软件实现由DICOMDIR管理的DICOM图像的浏览。
(1)设定需要匿名化的DICOM TAG信息,包括患者信息,检查信息,DICOMDIR管理的DICOM图像保存子目录信息等到CSV(Comma-SeparatedValues,逗号分隔值)文件中,DICOMDIR文件做成时读取该设定文件内的设定信息,从所述设定文件中读取需要匿名化的内容,比如患者名字,患者ID,诊断医生名字,生成DICOMDIR时,DICOM图像保存子目录信息(可以有子目录,也可以没有子目录,用户设定)。
在该设定文件中,本实例设定患者名字及ID信息需要匿名化,匿名化时患者名字需要修改为TEST1字符串,患者ID修改为00000000字符串,保存媒体是640兆的CD,同时设定DICOMDIR文件管理的DICOM文件保存于子目录DCM中。
(2)指定一个需要生成DICOMDIR文件的DICOM文件夹,该文件夹中有8个DSA动画DICOM图像,10个超音波动画图像,其中DSA图像是16位的灰度图像,图像分辨率是1024×768像素,超音波图像是 24位的彩色图像,其图像分辨率是640×480像素。该文件夹中全部的DICOM图像为同一患者的图像,患者名字为Anonymous,检查日期是2012.11.07。在超音波图像中患者名字和性别等信息表示在图像的右上角,检查日期和时间等信息表示在图像的左上角。其中DSA图像中没有文字信息存在图像上,超音波图像中图像的右上角存在患者ID和患者名字信息。打开读取该目录中的全部文件,并读取全部18个DICOM图像的DICOM TAG信息到内存。
然后以DICOM文件为单位,读取每个DICOM文件中的图像数据到内存。该文件夹中的DICOM文件全部是动画DICOM图像,以帧为单位读取各个DICOM文件中的第一帧到内存,16位的DSA图像通过灰度变换变为8位的灰度图像,24位的超音波彩色图像通过彩色图像到灰度图像的变换转变彩色图像为8位的灰度图像。
(3)考虑到医学图像灰度分布不均的特点,采用Niblack局部二值化方法对图像数据进行二值化。Niblack二值化方法,是以像素点为中心的邻域内的均值与方差共同决定该像素的二值化分割阈值。以像素(i,j)为中心大小是kxk的窗口,这个窗口内各个像素灰度值的均值为m,方差为s,则该点阈值t为t=m+c*s,其中c是调整量参数。针对本实例的DSA和超音波图像,c选择为-0.2,k选择为5。
用Niblack二值化方法进行二值化后,得到保存在内存中的各个DICOM文件的第一帧图像的二值图像。
(4)对得到的二值图像,根据文字字符面积大小的阈值,去除阈值范围之外的块状区域。设定4角每个文字搜索区域为矩形区域,其宽高分别为128X160像素,能包括角部的文字区域。对各个文字搜索区域的二值图像先进行水平方向投影,根据文字字符水平方向积分投影平均值明显高于背景区域的水平积分投影平均值的特征,即可确认字符行的上边界和下边界。得到可能字符区域的上下边界坐标并保存到内存;然后再对文字搜索区域的二值图像进行垂直方向投影,根据字符垂直方向积分投影平均值高于背景区域的垂直积分投影平均值,字符宽度,高度和间距在一定范围内的特征,确定各个字符的左右边界坐标并保存到内存。该图像中文字的最大宽高为20x12像素,平均间距为5个像素。
使用保存在内存中各个文字搜索区域中的字符个数信息,判定4个文字搜索区域中存在文字字符的文字搜索区域。根据文字搜索区域中是否有文字字符存在的特征,判定出该超音波图像中左上角和右上角有文字存在,判定出DSA图像中不存在文字区域。
(5)根据(4)中计算得到的结果,DSA图像中不存在文字区域,超音波图像的左上角存在检查日期的文字区域,右上角存在患者名字等文字区域,左下角ROI及右下角ROI不存在文字字符区域。左上角ROI区域的文字的最大X坐标是170,最大Y坐标是48;右上角ROI的文字的最小X坐标是460,最大Y坐标是64。图像大小为640x480像素,计算出剪裁区域的左上角X坐标是170,Y坐标是64,右上角的X坐标是460,Y坐标是64,左下角的X坐标是170,Y坐标是480,右下角X坐标是460,Y坐标是480,剪裁区域的宽高是290x416像素。
(6)根据(5)中得到的结果,DSA图像中不存在文字区域,修改(2)中得到的DSA图像保存在内存中TAG信息中的患者名字(0010,0010)为TEST1字符串,患者ID(0010,0020)为00000000字符串后保存到DSA的DICOM文件中。
超音波图像中存在文字区域,除了修改(2)中得到的保存在内存中TAG信息中的患者名字(0010,0010)为TEST1字符串,患者ID(0010,0020)为00000000字符串之外,读取DICOM文件中每一帧的图像数据,使用(5)中得到的剪裁矩形剪裁每一帧的图像后保存到DICOM文件中,同时修改该DICOM文件中的图像宽度(0028,0011)和高度(0028,0010)TAG值为剪裁矩形区域的宽度及高度;如果设定文件中不存在DICOM患者信息等匿名化设定,则不对DICOM文件做任何修改。
(7)计算出指定文件夹中全部DICOM图像的文件尺寸大小的和,指定的文件夹中18个动画DICOM文件大小的和是976兆大小;根据设定文件中设定生成640兆的CD的条件,计算出需要生成的DICOMDIR文件的个数是2个(CD数2枚)。然后调用DICOMDIR创建函数生成2个DICOMDIR文件,设定文件中设定了DICOMDIR管理的DICOM文件保存子目录是DCM,在生成DICOMDIR文件的同时,按照DICOMDIR的规则保存该DICOMDIR管理的DICOM文件到DCM子目录中。
与现有技术相比,本发明的有益效果是:
本发明提出了一种DICOMDIR文件的生成方法及系统,所述生成方法,首先,获取需要生成DICOMDIR文件的文件夹内的DICOM图像或DICOM动画的第一帧DICOM图像,得到待处理DICOM图像;对所述待处理DICOM图像进行二值化处理,得到二值图像;将所述二值图像的左上角、右上角、左下角和右下角定义为4个文字搜索区域;对每个所述文字搜索区域进行水平投影确定每个所述文字搜索区域内字符行的上边界和下边界;对每个所述文字搜索区域进行垂直投影确定每个所述文字搜索区域内的每个字符的左边界和右边界及字符个数;根据字符个数确定4个所述文字搜索区域中存在字符的文字搜索区域;根据存在字符的文字搜索区域的字符行的上边界和下边界及每个字符的左边界和右边界,确定裁剪区域的坐标;然后,根据所述裁剪区域的坐标对所述DICOM图像或对所述DICOM动画的每一帧DICOM图像进行裁剪,获得裁剪后的DICOM图像,并将裁剪后的DICOM图像保存至指定文件中;需要生成DICOMDIR文件的文件夹内的DICOM图像或DICOM动画全部裁剪完成后,将指定文件中所有的裁剪后的DICOM图像生成DICOMDIR文件。本发明首先确定DICOM图像中的文字搜索区域,然后,采用水平投影和垂直投影的方式进行文字字符的搜索,确定裁剪区域的坐标,对DICOM图像进行裁剪,并将裁剪后的DICOM图像生成DICOMDIR文件,去除了DICOM图像的字符,实现了图像数据中存在的患者信息或是检查信息的匿名化处理。

Claims (10)

  1. 一种DICOMDIR文件的生成方法,其特征在于,所述生成方法包括如下步骤:
    提取需要生成DICOMDIR文件的文件夹内的所有DICOM文件的DICOM图像或DICOM动画;
    获取DICOM图像或DICOM动画的第一帧DICOM图像,得到待处理DICOM图像;
    对所述待处理DICOM图像进行二值化处理,得到二值图像;
    将所述二值图像的左上角、右上角、左下角和右下角定义为4个文字搜索区域;
    对每个所述文字搜索区域进行水平投影确定每个所述文字搜索区域内字符行的上边界和下边界;
    对每个所述文字搜索区域进行垂直投影确定每个所述文字搜索区域内的每个字符的左边界和右边界及字符个数;
    根据字符个数确定4个所述文字搜索区域中存在字符的文字搜索区域;
    根据存在字符的文字搜索区域的字符行的上边界和下边界及每个字符的左边界和右边界,确定裁剪区域的坐标;
    根据所述裁剪区域的坐标对所述DICOM图像或对所述DICOM动画的每一帧DICOM图像进行裁剪,获得裁剪后的DICOM图像,并将裁剪后的DICOM图像保存至指定文件中;
    返回步骤“获取DICOM图像或DICOM动画的第一帧DICOM图像,得到待处理DICOM图像”,对下一个DICOM图像或DICOM动画进行裁剪,直到裁剪完需要生成DICOMDIR文件的文件夹内的所有DICOM图像和DICOM动画;
    将指定文件中所有的裁剪后的DICOM图像生成DICOMDIR文件。
  2. 根据权利要求1所述的DICOMDIR文件的生成方法,其特征在于,所述提取需要生成DICOMDIR文件的文件夹内的所有DICOM文件的DICOM图像或DICOM动画,之前还包括:
    提取需要生成DICOMDIR文件的文件夹内的所有DICOM文件中的DICOM TAG信息;
    根据设定文件中用户指定的需要匿名化的TAG信息,对所述DICOM TAG信息进行修改,获得修改后的DICOM TAG信息;
    将修改后的DICOM TAG信息写入所述DICOM TAG信息对应的DICOM文件中,得到DICOM TAG信息修改后的DICOM文件。
  3. 根据权利要求1所述的DICOMDIR文件的生成方法,其特征在于,所述对每个所述文字搜索区域进行水平投影确定每个所述文字搜索区域内字符行的上边界和下边界,具体包括:
    对二值图像的文字搜索区域进行水平方向投影,根据文字字符的水平方向积分投影平均值高于背景的水平方向积分投影平均值,确定所述文字搜索区域的字符行的上边界和下边界。
  4. 根据权利要求1所述的DICOMDIR文件的生成方法,其特征在于,所述对每个所述文字搜索区域进行垂直投影确定每个所述文字搜索区域内的每个字符的左边界和右边界及字符个数,具体包括
    对二值图像的文字搜索区域进行垂直方向投影,根据文字字符的垂直方向积分投影平均值高于背景的垂直方向积分投影平均值,及字符宽度、高度和间距的阈值范围,确定文字搜索区域中各个字符的左边界和右边界及字符个数。
  5. 根据权利要求1所述的DICOMDIR文件的生成方法,其特征在于,所述将指定文件中所有的裁剪后的DICOM图像生成DICOMDIR文件,具体包括:
    计算指定文件夹中所有的裁剪后的DICOM图像的尺寸大小的和;
    根据指定文件夹中所有的裁剪后的DICOM图像的尺寸大小的和,计算需要生成的DICOMDIR文件的个数;
    利用DICOMDIR创建函数将指定文件夹中所有的裁剪后的DICOM图像生成所述个数的DICOMDIR文件。
  6. 一种DICOMDIR文件的生成系统,其特征在于,所述生成系统包括:
    DICOM图像或DICOM动画提取模块,用于提取需要生成DICOMDIR文件的文件夹内的所有DICOM文件的DICOM图像或DICOM动画;
    待处理DICOM图像获取模块,用于获取DICOM图像或DICOM动画的第一帧DICOM图像,得到待处理DICOM图像;
    二值化处理模块,用于对所述待处理DICOM图像进行二值化处理,得到二值图像;
    文字搜索区域确定模块,用于将所述二值图像的左上角、右上角、左下角和右下角定义为4个文字搜索区域;
    上下边界确定模块,用于对每个所述文字搜索区域进行水平投影确定每个所述文字搜索区域内字符行的上边界和下边界;
    左右边界确定模块,用于对每个所述文字搜索区域进行垂直投影确定每个所述文字搜索区域内的每个字符的左边界和右边界及字符个数;
    存在字符的文字搜索区域确定模块,用于根据字符个数确定4个所述文字搜索区域中存在字符的文字搜索区域;
    裁剪区域确定模块,用于根据存在字符的文字搜索区域的字符行的上边界和下边界及每个字符的左边界和右边界,确定裁剪区域的坐标;
    裁剪模块,用于根据所述裁剪区域的坐标对所述DICOM图像或对所述DICOM动画的每一帧DICOM图像进行裁剪,获得裁剪后的DICOM图像,并将裁剪后的DICOM图像保存至指定文件中;
    返回模块,用于返回步骤“获取DICOM图像或DICOM动画的第一帧DICOM图像,得到待处理DICOM图像”,对下一个DICOM图像或DICOM动画进行裁剪,直到裁剪完需要生成DICOMDIR文件的文件夹内的所有DICOM图像和DICOM动画;
    DICOMDIR文件生成模块,用于将指定文件中所有的裁剪后的DICOM图像生成DICOMDIR文件。
  7. 根据权利要求6所述的DICOMDIR文件的生成系统,其特征在于,所述生成系统还包括:
    DICOM TAG信息提取模块,用于提取需要生成DICOMDIR文件的文件夹内的所有DICOM文件的DICOM TAG信息;
    DICOM TAG信息修改模块,用于根据设定文件中用户指定的需要匿名化的TAG信息,对所述DICOM TAG信息进行修改,获得修改后的DICOM TAG信息;
    修改后的DICOM TAG信息存储模块,用于将修改后的DICOM TAG信息写入所述DICOM TAG信息对应的DICOM文件中,得到DICOM TAG信息修改后的DICOM文件。
  8. 根据权利要求6所述的DICOMDIR文件的生成系统,其特征在于,所述上下边界确定模块,具体包括:
    上下边界确定子模块,用于对二值图像的文字搜索区域进行水平方向投影,根据文字字符的水平方向积分投影平均值高于背景的水平方向积分投影平均值,确定所述文字搜索区域的字符行的上边界和下边界。
  9. 根据权利要求6所述的DICOMDIR文件的生成系统,其特征在于,所述左右边界确定模块,具体包括
    左右边界确定子模块,用于对二值图像的文字搜索区域进行垂直方向投影,根据文字字符的垂直方向积分投影平均值高于背景的垂直方向积分投影平均值,及字符宽度、高度和间距的阈值范围,确定文字搜索区域中各个字符的左边界和右边界及字符个数。
  10. 根据权利要求6所述的DICOMDIR文件的生成系统,其特征在于,所述DICOMDIR文件生成模块,具体包括:
    尺寸大小的和计算子模块,用于计算指定文件夹中所有的裁剪后的DICOM图像的尺寸大小的和;
    需要生成的DICOMDIR文件的个数计算子模块,用于根据指定文件夹中所有的裁剪后的DICOM图像的尺寸大小的和,计算需要生成的DICOMDIR文件的个数;
    DICOMDIR文件生成子模块,用于利用DICOMDIR创建函数将指定文件夹中所有的裁剪后的DICOM图像生成所述个数的DICOMDIR文件。
PCT/CN2021/093861 2020-05-27 2021-05-14 一种dicomdir文件的生成方法及系统 WO2021238680A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2022573315A JP2023527090A (ja) 2020-05-27 2021-05-14 Dicomdirファイル作成方法及びdicomdirファイル作成システム

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010460454.2 2020-05-27
CN202010460454.2A CN111613305B (zh) 2020-05-27 2020-05-27 一种dicomdir文件的生成方法及系统

Publications (1)

Publication Number Publication Date
WO2021238680A1 true WO2021238680A1 (zh) 2021-12-02

Family

ID=72200562

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/093861 WO2021238680A1 (zh) 2020-05-27 2021-05-14 一种dicomdir文件的生成方法及系统

Country Status (3)

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

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111613305B (zh) * 2020-05-27 2024-04-30 周兴祥 一种dicomdir文件的生成方法及系统
CN112071403B (zh) * 2020-09-09 2023-09-12 周兴祥 含有图标图像的dicomdir文件生成方法及系统

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101295332A (zh) * 2008-04-30 2008-10-29 深圳市蓝韵实业有限公司 一种dicom文件病人信息匿名化处理方法
US20140063219A1 (en) * 2012-08-28 2014-03-06 General Electric Company System and method including a portable user profile for medical imaging systems
CN108986877A (zh) * 2017-05-30 2018-12-11 西门子保健有限责任公司 确定匿名剂量报告图像
CN111145874A (zh) * 2018-11-02 2020-05-12 北京赛迈特锐医疗科技有限公司 医学影像底层基础数据管理系统及其管理方法
CN111613305A (zh) * 2020-05-27 2020-09-01 周兴祥 一种dicomdir文件的生成方法及系统

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104036292A (zh) * 2014-06-12 2014-09-10 西安华海盈泰医疗信息技术有限公司 一种医学影像数字胶片中文字区域提取方法及提取系统
CN105160343A (zh) * 2015-08-12 2015-12-16 蓝网科技股份有限公司 应用于胶片按需打印系统的信息识别方法和装置
KR102000745B1 (ko) * 2017-03-17 2019-07-16 (주) 프로큐라티오 개인의료정보데이터 관리방법 및 시스템

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101295332A (zh) * 2008-04-30 2008-10-29 深圳市蓝韵实业有限公司 一种dicom文件病人信息匿名化处理方法
US20140063219A1 (en) * 2012-08-28 2014-03-06 General Electric Company System and method including a portable user profile for medical imaging systems
CN108986877A (zh) * 2017-05-30 2018-12-11 西门子保健有限责任公司 确定匿名剂量报告图像
CN111145874A (zh) * 2018-11-02 2020-05-12 北京赛迈特锐医疗科技有限公司 医学影像底层基础数据管理系统及其管理方法
CN111613305A (zh) * 2020-05-27 2020-09-01 周兴祥 一种dicomdir文件的生成方法及系统

Also Published As

Publication number Publication date
JP2023527090A (ja) 2023-06-26
CN111613305B (zh) 2024-04-30
CN111613305A (zh) 2020-09-01

Similar Documents

Publication Publication Date Title
US11967074B2 (en) Method and system for computer-aided triage
WO2021238680A1 (zh) 一种dicomdir文件的生成方法及系统
US8737702B2 (en) Systems and methods for automated extraction of measurement information in medical videos
KR102251245B1 (ko) 관심 영역별 추가 정보 제공 장치 및 방법
JP6805736B2 (ja) 類似症例画像検索プログラム、類似症例画像検索装置及び類似症例画像検索方法
US10902602B1 (en) Method and system for computer-aided triage of stroke
Josephine Selle et al. Automated recognition of ROIs for breast thermograms of lateral view-a pilot study
CN114494230A (zh) 乳腺病灶分割装置、模型训练方法及电子设备
CN110738639B (zh) 医学图像检测结果的展示方法、装置、设备及存储介质
CN116825269A (zh) 体检报告的处理方法、装置、电子设备和可读存储介质
US11615895B2 (en) Systems and methods for automatically managing image data
CN111161240A (zh) 血管分类方法、计算机设备和可读存储介质
US11978274B2 (en) Document creation support apparatus, document creation support method, and document creation support program
CN112419339B (zh) 医学图像分割模型训练方法及系统
KR102659323B1 (ko) 인공지능 학습용 의료영상 데이터 구축을 위한 마스킹 방법 및 시스템
CN114972026A (zh) 图像处理方法和存储介质
Zhao et al. Development of an approach to extracting coronary arteries and detecting stenosis in invasive coronary angiograms
Xiong et al. CAS_NeXt: Towards Accurate and Topology-Preserving Coronary Artery Segmentation in Digital Substraction Angiography
Li et al. A Web abdominal anatomical structure database system
WO2022239593A1 (ja) 文書作成支援装置、文書作成支援方法、及び文書作成支援プログラム
JP7480997B2 (ja) 画像処理装置、画像処理方法、およびプログラム
WO2022215530A1 (ja) 医用画像装置、医用画像方法、及び医用画像プログラム
Azcarraga et al. Identity concealment when uploading pictures of patients in a tele-medicine system
WO2022224848A1 (ja) 文書作成支援装置、文書作成支援方法、及び文書作成支援プログラム
Mihova et al. Applications of open source frameworks for advanced medical image processing.

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21813269

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2022573315

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21813269

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 12/05/2023)