METHOD AND SYSTEM FOR DISPLAYING AN X-RAYSIMATE, X-RAYSIMUM AND STORAGE MEDIUM
Patent Information
- Application Number
- DE602021041391
- Authority / Receiving Office
- DE · DE
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2021-09-18
- Publication Date
- 2025-10-29
- Estimated Expiration
- 2041-09-18
AI Technical Summary
Existing X-ray imaging systems face challenges in displaying both high-density and low-density tissue regions simultaneously due to local image overexposure, making it difficult to see details in both areas clearly.
A method and system that automatically determine a to-be-optimized region in an X-ray image, calculate a window width and level based on maximum and minimum grayscale values, and adjust the image display accordingly to enhance clarity without manual user intervention.
The system effectively improves image display resolution by automatically optimizing window settings for overexposed or underexposed regions, enhancing visibility of both bright and dark areas without complex user operations.
Description
TECHNICAL FIELD
[0001] The present invention relates to the medical field, and in particular, to a method and system for displaying an X-ray image, an X-ray machine, and a non-volatile computer readable storage medium.BACKGROUND
[0002] In an X-ray machine such as a medical C-arm machine, an X-ray source and an X-ray receiver (such as a flat panel detector) are installed opposite to each other, so that X-rays generated by the X-ray source penetrate an object and are incident on and detected by the X-ray receiver.
[0003] However, in actual application, local image overexposure caused by a large density difference of human tissue in a target region of interest is a common image quality problem. That is, an image of low-density tissue or a thin body part is overexposed, and an image of high-density tissue or a thick body part is relatively dark. In this case, it is difficult to see all details at the same time. For example, when a chest image is scanned, the lung region is obviously overexposed.
[0004] FIG. 1 shows an X-ray image of a patient's thoracic and lumbar vertebrae. As shown in FIG. 1, an image of the thoracic vertebrae is overexposed, and an image of the lumbar vertebrae is over-dark, which makes it difficult for a doctor to clearly see the thoracic vertebrae and the lumbar vertebrae at the same time, while actually information of both the thoracic vertebrae and the lumbar vertebrae is usually required.
[0005] In this case, to meet different filtering requirements, currently, filters of different thickness are mainly disposed between the X-ray source and the X-ray receiver to filter out different amounts of X-rays, and an ideal image requirement is achieved by switching different filters. In addition, in some applications, required images are obtained by manually optimizing exposure parameters.
[0006] US 2015 / 277554 A1 relates to a method, a computing device and a computer program product to automatically apply window leveling to an image, such as a medical image. In the context of a method, a gaze location within an image is determined based upon a determination that a user is staring at the gaze location. The method also determines a region of interest within the image based upon the gaze location and determines pixel values for pixels within the region of interest. The method also establishes window level values based upon the pixel values for pixels within the region of interest and applies window leveling based upon the window level values established based upon the pixel values for pixels within the region of interest.
[0007] US 2011 / 002519 A1 relates to a mammography apparatus which has a determination unit, a setting unit, a generating unit and a display unit. The determination unit determines whether a radiographic image of a breast contains an implant part based on a pixel value distribution in a predetermined region concerning data of the radiographic image. The setting unit changes a setting of a parameter for a tone conversion process based on a determination made by the determination unit. The generating unit generates a display image based on the radiographic image by application of the parameter. The display unit displays the display image.
[0008] US 5 542 003 A relates to a method and apparatus in which a medical imagery workstation provides an end-user interface which when activated, windows and levels a whole image or a region of interest within the image utilizing the pixel values within a selection area. The method and apparatus customizes the pixel values when the entire image is selected before calculating the window and levels to produce a higher contrast, then redraws the entire image utilizing the newly calculated window and level values. The present invention provides a method and apparatus to enable an operator to define a region of interest, that when activated, the image is redrawn utilizing only the pixel values from the region of interest, maximizing the brightness and contrast of the selected.
[0009] Tortajada M, et al., "Breast peripheral area correction in digital mammo-grams", Comput Biol Med. 2014 Jul;50:32-40, PMID: 24845018, presents an automatic method to enhance an overexposed peripheral breast area providing a more homogeneous and improved view of a whole mammogram. The method automatically restores the overexposed area by equalising the image using information from the intensity of non-overexposed neighbour pixels. The correction is based on a multiplicative model and on the computation of the distance map from the breast boundary.
[0010] WO 2020 / 070834 A1 discloses a producing method for a learned model, comprising a step for optimizing a learning model such that the value of a loss function becomes small. The loss function is configured such that a relatively larger value is outputted when the contrast of a predetermined area in a brightness-adjusted image becomes high with respect to teacher data, compared to when the contrast of the predetermined area in the brightness-adjusted image becomes low with respect to the teacher data.
[0011] Hara T, Inoue Y, Ukisu R, Hata H, "Methods for optimizing the display conditions of brain magnetic resonance images", Jpn J Radiol. 2017, 35(10):622-627, doi:10.1007 / s11604-017-0669-0, investigates a method for optimizing the display conditions of brain magnetic resonance (MR) images. The authors retrospectively analyzed brain MR images of 120 adults classified into screening, acute cerebral infarction, and brain tumor groups (n = 40 each). Two observers independently displayed the images on a monitor and optimized the display conditions using the W / L and U / L methods. For both observers and all groups, the time required for optimization was significantly shorter for the U / L method than for the W / L method. The appropriateness of the window setting for the U / L method was equal to or better than that for the W / L method.
[0012] In addition, persons skilled in the art are still working to find other solutions.SUMMARY
[0013] The invention is defined the appended claims.
[0014] In view of this, in one aspect, embodiments of the present invention provide a method for displaying an X-ray image, and in another aspect, provide a system for displaying an X-ray image, an X-ray machine, and a computer readable storage medium, so as to improve image display resolution of a current to-be-optimized region. The invention is defined by the attached set of claims. Further details of the disclosed method, devices and system are described below, which are helpful for understanding the claimed invention.
[0015] An embodiment of the present invention proposes a method for displaying an X-ray image, including: obtaining a captured current image of a target region; determining at least one to-be-optimized region in the current image, wherein the to-be-optimized region includes an underexposed dark region; and for each to-be-optimized region, obtaining a maximum grayscale value and a minimum grayscale value in the to-be-optimized region, determining a window width and a window level for the to-be-optimized region according to the maximum grayscale value and the minimum grayscale value, and displaying the current image based on the window width and the window level.
[0016] In the claimed implementation, the determining at least one to-be-optimized region in the current image includes: detecting whether a to-be-optimized region exists in the current image, and determining each detected to-be-optimized region as a to-be-optimized region in the current image.
[0017] In the claimed implementation, the detecting whether a to-be-optimized region exists in the current image, and determining each detected to-be-optimized region as a to-be-optimized region in the current image includes: detecting a pixel whose brightness value is less than a preset second brightness threshold in the current image, to obtain an over-dark pixel; and when a quantity of over-dark pixels reaches a preset second quantity threshold, determining that a to-be-optimized underexposed dark region exists in the current image, determining a to-be-optimized region corresponding to the dark region based on distribution of the over-dark pixels, and determining the to-be-optimized region as a to-be-optimized region in the current image.
[0018] In an implementation not covered by the claims, the determining at least one to-be-optimized region in the current image includes: obtaining at least one to-be-optimized region manually selected by a user from the current image, and determining the at least one to-be-optimized region as at least one to-be-optimized region in the current image.
[0019] In the claimed implementation, the determining a window width and a window level for the to-be-optimized region according to the maximum grayscale value and the minimum grayscale value includes: using a difference between the maximum grayscale value and the minimum grayscale value as the window width for the to-be-optimized region; and using an average value of the maximum grayscale value and the minimum grayscale value or an average value of all pixels in the to-be-optimized region as the window level for the to-be-optimized region.
[0020] An embodiment of the present invention proposes a system for displaying an X-ray image, including: a first unit, configured to obtain a captured current image of a target region; a second unit, configured to determine at least one to-be-optimized region in the current image, wherein the to-be-optimized region includes an underexposed dark region; and a third unit, configured to: for each to-be-optimized region, obtain a maximum grayscale value and a minimum grayscale value in the to-be-optimized region, determine a window width and a window level for the to-be-optimized region according to the maximum grayscale value and the minimum grayscale value, and display the current image based on the window width and the window level.
[0021] In the claimed implementation, the second unit detects whether a to-be-optimized region exists in the current image, and determines each detected to-be-optimized region as a to-be-optimized region in the current image
[0022] In the claimed implementation, the second unit detects a pixel whose brightness value is less than a preset second brightness threshold in the current image, to obtain an over-dark pixel; and when a quantity of over-dark pixels reaches a preset second quantity threshold, determines that a to-be-optimized underexposed dark region exists in the current image, and determines a to-be-optimized region corresponding to the dark region based on distribution of the over-dark pixels.
[0023] In an implementation not covered by the claims, the second unit obtains at least one to-be-optimized region manually selected by a user from the current image, and determines the at least one to-be-optimized region as at least one to-be-optimized region in the current image.
[0024] In the claimed implementation, the third unit includes: an obtaining module, configured to: for each to-be-optimized region, obtain a maximum grayscale value and a minimum grayscale value in the to-be-optimized region; a determining module, configured to use a difference between the maximum grayscale value and the minimum grayscale value that are obtained by the obtaining module as the window width for the to-be-optimized region; and use an average value of the maximum grayscale value and the minimum grayscale value or an average value of all pixels in the to-be-optimized region as the window level for the to-be-optimized region; and a display module, configured to display the current image based on the window width and the window level determined by the determining module.
[0025] An embodiment of the present invention proposes an X-ray machine, including the system for displaying an X-ray image in any implementation above.
[0026] An embodiment of the present invention proposes a computer readable storage medium on which a computer program is stored, where the computer program can be executed by a processor to implement the method for displaying an X-ray image in any implementation above.
[0027] It can be learned from the foregoing solutions that, in the embodiments of the present invention, a window width and a window level for clearly displaying a to-be-optimized region can be automatically calculated according to a maximum grayscale value and a minimum grayscale value in the over-bright and / or over-dark to-be-optimized region in a current image, and then the current image is displayed based on the window width and the window level, so that each to-be-optimized region in the current image can be clearly displayed without requiring manual adjustment by a user.
[0028] In addition, the over-bright and / or over-dark to-be-optimized region can be automatically detected by a system, thereby further improving system intelligence and operation convenience.BRIEF DESCRIPTION OF THE DRAWINGS
[0029] To enable a person of ordinary skill in the art to understand the foregoing and other features and advantages of the present invention more clearly, embodiments according to the present invention are described in detail below with reference to the accompany drawings. In the accompany drawings: FIG. 1 is an X-ray image of a patient's thoracic and lumbar vertebrae. FIG. 2 is an example flowchart of a method for displaying an X-ray image according to an embodiment of the present invention. FIG. 3A is a display image obtained after a window width and a window level are adjusted for a to-be-optimized region on a thoracic vertebrae side shown in a frame 31 of the X-ray image shown in FIG. 1 according to an embodiment of the present invention. FIG. 3B is a display image obtained after a window width and a window level are adjusted for a to-be-optimized region on a lumbar vertebrae side shown in a frame 32 of the X-ray image shown in FIG. 1 according to an embodiment of the present invention. FIG. 4 is an example structural diagram of a system for displaying an X-ray image according to an embodiment of the present invention. FIG. 5 is an example structural diagram of another system for displaying an X-ray image according to an embodiment of the present invention.
[0030] Reference numerals are as follows: Reference signMeaningS21-S23Steps31To-be-optimized region on a thoracic vertebrae side32To-be-optimized region on a lumbar vertebrae side410First unit420Second unit430Third unit431Obtaining module432Determining module433Display module51Memory52Processor53Display54Bus DETAILED DESCRIPTION
[0031] In embodiments of the present invention, a captured X-ray image actually includes all image information. When the image is displayed, to meet display requirements of both a bright region and a dark region, a display tradeoff is made. Consequently, neither an overexposed bright region nor an underexposed dark region is in an optimal display condition. Therefore, in the embodiments, to avoid an excessively complex operation on an image collection side, image display resolution is optimized from a perspective of image display.
[0032] Therefore, in the embodiments of the present invention, a window technology is considered to improve image display resolution of a current to-be-optimized region. The window technology is a display technology used in X-ray examination to observe normal tissue or lesions of different density, and includes a window width and a window level. Because various normal or lesion tissue structures have different grayscale values, when details of a certain tissue structure are to be displayed, a window width and a window level suitable for observing the tissue structure need to be selected for optimal display. The window width is a grayscale value range displayed on an X-ray image. Tissue structures in the grayscale value range are displayed using different simulated grayscales. A tissue structure whose grayscale value is higher than values in the range is displayed in a white shadow, and no grayscale difference exists. On the contrary, a tissue structure whose grayscale value is lower than the values in the range is displayed in a dark shadow, and no grayscale difference exists If the window width is increased, the grayscale value range shown in the image is increased, and more tissue structures with different density are displayed, but a grayscale difference between the structures is reduced. When the window width is decreased, fewer tissue structures are displayed, but a grayscale difference between the structures is increased. The window level is a center position of a window, and grayscale values of a grayscale value range included in the same window width are also different when window levels are different.
[0033] At present, to observe different tissue structures, users need to select different window widths and window levels based on experience. However, in the implementation that users choose different window widths and window levels based on their experience for different tissue structures, on one hand, high requirements are imposed on user experience, and on the other hand, it is not convenient to perform operations, and multiple tests may be required to find satisfactory window widths and window levels.
[0034] In view of this, in the embodiments of the present invention, a window width and a window level for clearly displaying a to-be-optimized region in a current image can be automatically selected by a system based on the to-be-optimized region.
[0035] To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention is further described in detail below with reference to the embodiments.
[0036] FIG. 2 is an example flowchart of a method for displaying an X-ray image according to an embodiment of the present invention. As shown in FIG. 2, the method may include the following steps: Step S21: Obtain a captured current image of a target region.
[0037] In this step, the target region may be a to-be-imaged region required by a user in a clinical operation, and the target region may change according to an actual application. When the target region changes, the image obtained in step S21 also correspondingly changes.
[0038] In specific implementation, after an organ program is determined, the solution in this embodiment may be executed in real time, and correspondingly, step S21 is also performed in real time. Alternatively, the solution may be periodically performed, and correspondingly, step S21 is also periodically performed. Alternatively, the solution may be triggered by a condition, and correspondingly, step S21 may be triggered when the target region is initially determined and when the target region changes.
[0039] Step S22: Determine at least one to-be-optimized region in the current image.
[0040] In this embodiment, the user may manually select at least one to-be-optimized region from the current image. For example, the user selects a to-be-optimized region corresponding to a bright region on a bright thoracic vertebrae side in FIG. 1, and for another example, selects a to-be-optimized region corresponding to a dark region on a dark lumbar vertebrae side in FIG. 1. Accordingly, a system may determine the at least one to-be-optimized region selected by the user as at least one to-be-optimized region in the current image. Further, the to-be-optimized region may be further identified in the current image. In this case, the bright region refers to a region that is determined as a bright region based on experience of the user, and the dark region is a region that is determined as a dark region based on experience of the user.
[0041] Alternatively, in this embodiment, the system may automatically determine the to-be-optimized region in the current image. Correspondingly, in this embodiment, whether a to-be-optimized region exists in the current image may be detected, and each detected to-be-optimized region is determined as a to-be-optimized region in the current image. The to-be-optimized region includes an overexposed bright region and / or an underexposed dark region. For example, in specific implementation, a pixel whose brightness value is greater than a preset first brightness threshold in the current image may be detected based on a histogram technology, to obtain an overexposed pixel; and when a quantity of overexposed pixels reaches a preset first quantity threshold, it is determined that a to-be-optimized overexposed bright region exists in the current image, and a to-be-optimized region corresponding to the bright region may be determined based on distribution of the overexposed pixels; otherwise, it may be determined that no to-be-optimized overexposed bright region exists in the current image; and / or a pixel whose brightness value is less than a preset second brightness threshold in the current image is detected based on the histogram technology, to obtain an over-dark pixel; and when a quantity of over-dark pixels reaches a preset second quantity threshold, it is determined that a to-be-optimized underexposed dark region exists in the current image, and a to-be-optimized region corresponding to the dark region may be determined based on distribution of the over-dark pixels; otherwise, it may be determined that no to-be-optimized underexposed dark region exists in the current image. The second brightness threshold is less than or equal to the first brightness threshold. In specific implementation, for example, grayscale gradient distribution of the bright region and / or the dark region may be determined by using an image gradient calculation algorithm, so as to detect an edge of the bright region and / or the dark region, and then a bright region boundary and / or a dark region boundary are fitted by using an edge curve. In this case, the bright region may be a region in which the quantity of pixels whose brightness is greater than the preset first brightness threshold reaches the first quantity threshold, and the dark region may be a region in which the quantity of pixels whose brightness is less than the preset second brightness threshold reaches the second quantity threshold.
[0042] In addition, in other embodiments, the bright region may also refer to a region in which an exposure degree is higher than a first exposure degree, and the dark region may also refer to a region in which the exposure degree is lower than a second exposure degree. The second exposure degree is less than the first exposure degree.
[0043] Step S23: For each to-be-optimized region, obtain a maximum grayscale value and a minimum grayscale value in the to-be-optimized region, determine a window width and a window level for the to-be-optimized region according to the maximum grayscale value and the minimum grayscale value, and display the current image based on the window width and the window level.
[0044] The maximum grayscale value and the minimum grayscale value in this step may be a maximum grayscale value and a minimum grayscale value that are in all pixels of the to-be-optimized region, or may be a maximum pixel value and a minimum pixel value that are in a specific pixel interval of the to-be-optimized region.
[0045] In addition, there may be multiple methods for determining the window width and the window level for the to-be-optimized region according to the maximum grayscale value and the minimum grayscale value. For example, assuming that a minimum grayscale value in a certain to-be-optimized region is A and a maximum grayscale value is B, the window width (WW) may be B-A, and the window level (WL) may be (A+B) / 2. Alternatively, the window level (WL) may be an average value of all pixels in the to-be-optimized region. In addition, in another implementation, the window width and the window level may also be calculated by using another calculation method, which is not limited herein.
[0046] FIG. 3A is a display image obtained after a window width and a window level are adjusted for a to-be-optimized region on a thoracic vertebrae side shown in a frame 31 of the X-ray image shown in FIG. 1. FIG. 3B is a display image obtained after a window width and a window level are adjusted for a to-be-optimized region on a lumbar vertebrae side shown in a frame 32 of the X-ray image shown in FIG. 1. It may be learned that a display image obtained after a window width and a window level are automatically adjusted for a specific to-be-optimized region can clearly display the to-be-optimized region.
[0047] The foregoing describes in detail a method for displaying an X-ray image in the embodiments of the present invention, and the following further describes in detail a system for displaying an X-ray image in the embodiments of the present invention. The system for displaying an X-ray image in the embodiments of the present invention may be configured to implement the method for displaying an X-ray image in the embodiments of the present invention. For details not disclosed in the system embodiments of the present invention, refer to corresponding descriptions in the method embodiments of the present invention. Details are not described herein again.
[0048] FIG. 4 is an example structural diagram of a system for displaying an X-ray image according to an embodiment of the present invention. As shown in FIG. 4, the system includes a first unit 410, a second unit 420, and a third unit 430.
[0049] The first unit 410 is configured to obtain a captured current image of a target region.
[0050] The second unit 420 is configured to determine at least one to-be-optimized region in the current image. In specific implementation, the second unit 420 may obtain at least one to-be-optimized region manually selected by a user from the current image, and determine the at least one to-be-optimized region as at least one to-be-optimized region in the current image. Alternatively, the second unit 420 may detect whether a to-be-optimized region exists in the current image, and determine each detected to-be-optimized region as a to-be-optimized region in the current image For example, the second unit 420 detects a pixel whose brightness value is greater than a preset first brightness threshold in the current image based on a histogram technology, to obtain an overexposed pixel; and when a quantity of overexposed pixels reaches a preset first quantity threshold, determine that a to-be-optimized overexposed bright region exists in the current image, and determine a to-be-optimized region corresponding to the bright region based on distribution of the overexposed pixels; otherwise, may determine that no to-be-optimized overexposed bright region exists in the current image; and / or detects a pixel whose brightness value is less than a preset second brightness threshold in the current image, to obtain an over-dark pixel; and when a quantity of over-dark pixels reaches a preset second quantity threshold, determines that a to-be-optimized underexposed dark region exists in the current image, and determines a to-be-optimized region corresponding to the dark region based on distribution of the over-dark pixels; otherwise, may determine that no to-be-optimized underexposed dark region exists in the current image. In specific implementation, for example, grayscale gradient distribution of the bright region and / or the dark region may be determined by using an image gradient calculation algorithm, so as to detect an edge of the bright region and / or the dark region, and then a bright region boundary and / or a dark region boundary are fitted by using an edge curve.
[0051] The third unit 430 is configured to: for each to-be-optimized region, obtain a maximum grayscale value and a minimum grayscale value in the to-be-optimized region, determine a window width and a window level for the to-be-optimized region according to the maximum grayscale value and the minimum grayscale value, and display the current image based on the window width and the window level. The maximum grayscale value and the minimum grayscale value may be a maximum grayscale value and a minimum grayscale value that are in all pixels of the to-be-optimized region, or may be a maximum pixel value and a minimum pixel value that are in a specific pixel interval of the to-be-optimized region.
[0052] In specific implementation, the third unit 430 may include an obtaining module 431, a determining module 432, and a display module 433.
[0053] The obtaining module 431 is configured to: for each to-be-optimized region, obtain a maximum grayscale value and a minimum grayscale value in the to-be-optimized region.
[0054] The determining module 432 is configured to determine a window width and a window level for the to-be-optimized region according to the maximum grayscale value and the minimum grayscale value that are obtained by the obtaining module 431; for example, may use a difference between the maximum grayscale value and the minimum grayscale value as the window width for the to-be-optimized region; and use an average value of the maximum grayscale value and the minimum grayscale value or an average value of all pixels in the to-be-optimized region as the window level for the to-be-optimized region. Alternatively, the determining module 432 may determine the window width and the window level by using another calculation method.
[0055] The display module 433 is configured to display the current image based on the window width and the window level determined by the determining module 432.
[0056] FIG. 5 is a schematic structural diagram of another system for displaying an X-ray image according to an embodiment of the present invention. As shown in FIG. 5, the system may include at least one memory 51, at least one processor 52, and at least one display 53. In addition, some other components, such as a communications port, may be further included. These components communicate with each other by using a bus 54.
[0057] The at least one memory 51 is configured to store a computer program. In an implementation, the computer program may be understood as including each module in the system for displaying an X-ray image shown in FIG. 4. In addition, the at least one memory 51 may further store an operating system and the like. The operating system includes but is not limited to an Android operating system, a Symbian operating system, a Windows operating system, a Linux operating system, and the like.
[0058] The at least one display 53 is configured to display a captured current image, man-machine interaction information, display the current image based on an adjusted window width and window level, and the like.
[0059] The at least one processor 52 is configured to invoke the computer program stored in the at least one memory 51 to perform the method for displaying an X-ray image in the embodiments of the present invention. The processor 52 may be a CPU, a processing unit / module, an ASIC, a logic module, a programmable gate array, or the like. It may receive and send data by using the communications port.
[0060] An embodiment of the present invention further provides an X-ray machine, including the system for displaying an X-ray image in any one of the foregoing implementations.
[0061] It should be noted that not all steps and modules in the procedures and the structural diagrams are necessary, and some steps or modules may be omitted according to an actual need. An execution sequence of the steps is not fixed and may be adjusted according to needs. Division of the modules is merely functional division for ease of description. During actual implementation, one module may be implemented separately by a plurality of modules, and functions of the plurality of modules may alternatively be implemented by the same module. The modules may be located in the same device or in different devices.
[0062] It may be understood that hardware modules in the foregoing implementations may be implemented in a mechanical manner or an electronic manner. For example, one hardware module may include a specially designed permanent circuit or logic device (such as a dedicated processor, such as an FPGA or an ASIC) configured to complete a particular operation. The hardware module may alternatively include a programmable logical device or circuit (for example, including a general processor or another programmable processor) configured temporarily by software and configured to perform a specific operation. Whether the hardware module is specifically implemented in the mechanical manner, by using the dedicated permanent circuit, or by using the provisionally configured circuit (such as a circuit configured by software) may be decided in consideration of costs and time.
[0063] In addition, an embodiment of the present invention further provides a computer-readable storage medium, storing a computer program, the computer program, when executed by a processor, implementing the method for displaying the X-ray image in the embodiments of the present invention. Specifically, a system or an apparatus provided with a storage medium may be provided. The storage medium stores software program code for implementing the functions of any one of the foregoing implementations, and a computer (or a CPU or MPU) of the system or the apparatus is enabled to read and execute program code stored in the storage medium. In addition, an operating system and the like operated on a computer are enabled to some or all of actual operations by using instructions based on the program code. The program code read from the storage medium may be written into a memory inserted into an expansion board inserted in the computer or a memory written to an expansion unit connected to the computer, and then the instructions based on the program enable a CPU or the like installed on the expansion board or the expansion unit to perform some and all actual operations, thereby implementing the functions of any one of the foregoing implementations. Implementations for providing the storage medium of the program code include a floppy disk, a hard disk, a magneto-optical disk, an optical disc (for example, a CD-ROM, a CD-R, a CD-RW, a DVD-ROM, a DVD-RAM, a DVD-RW, or a DVD+RW), a magnetic tape, a non-volatile storage card, and a ROM. Optionally, the program code may be downloaded from a server computer by using a communication network.
[0064] It can be learned from the foregoing solutions that, in the embodiments of the present invention, a window width and a window level for clearly displaying a to-be-optimized region can be automatically calculated according to a maximum grayscale value and a minimum grayscale value in the over-bright and / or over-dark to-be-optimized region in a current image, and then the current image is displayed based on the window width and the window level, so that each to-be-optimized region in the current image can be clearly displayed without requiring manual adjustment by a user.
[0065] In addition, the over-bright and / or over-dark to-be-optimized region can be automatically detected by a system, thereby further improving system intelligence and operation convenience.
[0066] The foregoing descriptions are merely exemplary embodiments of the present invention, but are not intended to limit the present invention.
Claims
1. A computer-implemented method for displaying an X-ray image, comprising: obtaining a captured current image of a target region (S21); determining at least one to-be-optimized region in the current image (S22), comprising: detecting whether a to-be-optimized region exists in the current image by detecting a pixel whose brightness value is less than a preset brightness threshold in the current image, to obtain an over-dark pixel, and, when a quantity of over-dark pixels reaches a preset quantity threshold, determining that a to-be-optimized underexposed dark region exists in the current image, determining the to-be-optimized region corresponding to the dark region based on distribution of the over-dark pixels, and determining the to-be-optimized region as a to-be-optimized region in the current image; and determining each detected to-be-optimized region as a to-be-optimized region in the current image; for each to-be-optimized region, obtaining a maximum grayscale value and a minimum grayscale value in the to-be-optimized region, determining a window width and a window level for the to-be-optimized region according to the maximum grayscale value and the minimum grayscale value; and displaying the current image based on the window width and the window level (S23), wherein the determining a window width and a window level for the to-be-optimized region according to the maximum grayscale value and the minimum grayscale value comprises: using a difference between the maximum grayscale value and the minimum grayscale value as the window width for the to-be-optimized region; and using an average value of the maximum grayscale value and the minimum grayscale value or an average value of all pixels in the to-be-optimized region as the window level for the to-be-optimized region.
2. A system for displaying an X-ray image, comprising: a first unit (410), configured to obtain a captured current image of a target region; a second unit (420), configured to determine at least one to-be-optimized region in the current image, wherein the second unit (420) is configured to: detect whether a to-be-optimized region exists in the current image by detecting a pixel whose brightness value is less than a preset brightness threshold in the current image to obtain an over-dark pixel, and, when a quantity of over-dark pixels reaches a preset quantity threshold, determining that a to-be-optimized underexposed dark region exists in the current image, and determining the to-be-optimized region corresponding to the dark region based on distribution of the over-dark pixels, and determine each detected to-be-optimized region as a to-be-optimized region in the current image; and a third unit (430), configured to: for each to-be-optimized region, obtain a maximum grayscale value and a minimum grayscale value in the to-be-optimized region, determine a window width and a window level for the to-be-optimized region according to the maximum grayscale value and the minimum grayscale value, and display the current image based on the window width and the window level; wherein the third unit (430) comprises: an obtaining module (431) configured to: for each to-be-optimized region, obtain a maximum grayscale value and a minimum grayscale value in the to-be-optimized region; a determining module (432) configured to use a difference between the maximum grayscale value and the minimum grayscale value that are obtained by the obtaining module (431) as the window width for the to-be-optimized region; and use an average value of the maximum grayscale value and the minimum grayscale value or an average value of all pixels in the to-be-optimized region as the window level for the to-be-optimized region; and a display module (433) configured to display the current image based on the window width and the window level determined by the determining module (432).
3. An X-ray machine, comprising the system for displaying an X-ray image according to claim 2.
4. A computer readable storage medium on which a computer program is stored, wherein the computer program can be executed by a processor to implement the computer-implemented method for displaying an X-ray image according claim 1.