Algorithms for contrast enhancement of electronic portal images

Algorithms for contrast enhancement of electronic portal images

Radiation Physics and Chemistry ∎ (∎∎∎∎) ∎∎∎–∎∎∎ Contents lists available at ScienceDirect Radiation Physics and Chemistry journal homepage: www.els...

1MB Sizes 0 Downloads 49 Views

Radiation Physics and Chemistry ∎ (∎∎∎∎) ∎∎∎–∎∎∎

Contents lists available at ScienceDirect

Radiation Physics and Chemistry journal homepage: www.elsevier.com/locate/radphyschem

Algorithms for contrast enhancement of electronic portal images S. Díez a,n, S. Sánchez b a b

Medical Physics Department, Hospital Clinico Universitario de Valencia, Avenida Blasco Ibaez, 17, 46010 Valencia, Spain Institute for Instrumentation in Molecular Imaging (I3M). Centro Mixto UPV – CSIC – CIEMAT, Camino de Vera s/n, 46022 Valencia, Spain

H I G H L I G H T S

   

Two Algorithms are implemented to improve the contrast of Electronic Portal Images. The multi-leaf and conformed beam are automatically segmented into Portal Images. Hidden anatomical and bony structures in portal images are revealed. The task related to the patient setup verification is facilitated by the contrast enhancement then achieved.

art ic l e i nf o

a b s t r a c t

Article history: Received 14 October 2014 Received in revised form 12 May 2015 Accepted 19 May 2015

An implementation of two new automatized image processing algorithms for contrast enhancement of portal images is presented as suitable tools which facilitate the setup verification and visualization of patients during radiotherapy treatments. In the first algorithm, called Automatic Segmentation and Histogram Stretching (ASHS), the portal image is automatically segmented in two sub-images delimited by the conformed treatment beam: one image consisting of the imaged patient obtained directly from the radiation treatment field, and the second one is composed of the imaged patient outside it. By segmenting the original image, a histogram stretching can be independently performed and improved in both regions. The second algorithm involves a two-step process. In the first step, a Normalization to Local Mean (NLM), an inverse restoration filter is applied by dividing pixel by pixel a portal image by its blurred version. In the second step, named Lineally Combined Local Histogram Equalization (LCLHE), the contrast of the original image is strongly improved by a Local Contrast Enhancement (LCE) algorithm, revealing the anatomical structures of patients. The output image is lineally combined with a portal image of the patient. Finally the output images of the previous algorithms (NLM and LCLHE) are lineally combined, once again, in order to obtain a contrast enhanced image. These two algorithms have been tested on several portal images with great results. & 2015 Elsevier Ltd. All rights reserved.

Keywords: Portal image Contrast enhancement Segmentation Histogram stretching Normalization to Local Mean Local Contrast Enhancement & Lineally Combined Local Histogram Equalization

1. Introduction Maximizing the dose delivered in a tumor while minimizing the dose in surrounding healthy tissues is the principal guideline in radiotherapy. For this task, a rigorous daily treatment setup verification is required, and great efforts have been made to develop more suitable techniques to image and verify patient setup while being treated. Conformal radiotherapy has become a standard technique in radiotherapy treatments nowadays. This procedure consists in irradiating a tumor from several directions, known as ports, with mega-voltage radiation fields and conforming each field with a multi-leaf collimator attached to a linear accelerator (LINAC). n

Corresponding author. E-mail addresses: [email protected] (S. Díez), [email protected] (S. Sánchez).

Following the principles of X-ray imaging is how the portal imaging technique arose. With the aim to acquire an image of the treatment in progress, or which is about to commence to previously verify the patient setup, the treatment beam itself is used to image the patient using an image acquisition system known as Electronic Portal Imaging Device (EPID). Although new accelerators can perform kV cone-beam CT as a tool for patient positioning and verification (giving a very good image quality), MV imaging (aka portal imaging) is still in use, either in monoenergetic linacs or in routine patient verifications. Portal imaging can be acquired during daily patient irradiation, and serves as a tool for verifying how the irradiation has actually been done. The major limitation of the portal image visualization comes from the range of energies of the radiation treatment fields used in radiotherapy with which the patient is irradiated as well as

http://dx.doi.org/10.1016/j.radphyschem.2015.05.034 0969-806X/& 2015 Elsevier Ltd. All rights reserved.

Please cite this article as: Díez, S., Sánchez, S., Algorithms for contrast enhancement of electronic portal images. Radiat. Phys. Chem. (2015), http://dx.doi.org/10.1016/j.radphyschem.2015.05.034i

S. Díez, S. Sánchez / Radiation Physics and Chemistry ∎ (∎∎∎∎) ∎∎∎–∎∎∎

2

Fig. 1. Images of a prostate treatment. (a) DRR of the Antero-Posterior beam used to define the beam characteristics. (b) Portal Image of the same beam, taken from on the patient, prior to the actual treatment. User has to compare (a) and (b) and verify that they match geometrically, using bone references.

Table 1 Characteristics of the EPID used as the image acquisition system. Accelerator portal imaging system Detector Number of pixels Pixel dimension Total area Readout speed

Table 2 Algorithm flowchart: automatic segmentation and histogram stretching.

Elekta Precise IviewGT ASi 1024  1024 400 μm 409.6  409.6 mm2 3.5 images/s

imaged (Antonuk, 2002; Herman et al., 2000; Kirby and Glendinning, 2006; Langmack, 2001). In contrast, defined between two objects of intensities I1 and I2 by

C=

I1 − I2 I1 + I1

(1)

depends on differences between attenuation coefficients of water μwater and bone μbone , which are basically the main structures present inside a patient. Low contrast portal images are produced with common radiation treatment fields due to the fact that at mega-voltage energies, ∼6 MV, Comptom scattering becomes the dominant interaction which contributes to both attenuation coefficients μbone and μtissue . The Comptom Scattering cross section depends on the electron density of a material, which in the case of bone and water are comparable ( ρwater = 3.34 × 1023 electrons/cm3 to ρbone = 5.81 × 1023 electrons/cm3) preventing their differentiation (Herman et al., 2001). The key point of this work is to compare the X-ray quality image used to define the treatment field and its shape (DRR or Digital Reconstructed Radiograph, see Fig. 1(a)) within the Treatment Planning System, and those acquired in the LINAC which should exactly match the DRRs (Fig. 1(b)). From Fig. 1, it is obvious that portal images have lower contrast and definition than DRRs, hence we need to enhance them to facilitate the comparison. Usually, portal images are acquired in a two step process during the first treatment session. First, a wide image is taken from the patient and after that, a second one is acquired irradiating only with the treatment beam (Fig. 1(b)). In this way, bone references can be used to compare with the DRR (Fig. 1(a)). The lack of contrast in portal images can be addressed computationally by means of two classical algorithms. The first of them, known as Window and Level Adjustment, attempts to

improve the contrast by stretching the image histogram between the predefined pixel values lowin and highin . The gap between lowin and highin is known as the “Window”. Every pixel in the image below lowin or above highin is mapped to the predefined pixel values lowout and highout , respectively. Any pixel value inside the window is lineally mapped between lowout and highout . Let Pin be a pixel value of the input image and Pout an output pixel value of the enhanced image, then, mathematically, the window and level adjustment algorithm can be defined as

Please cite this article as: Díez, S., Sánchez, S., Algorithms for contrast enhancement of electronic portal images. Radiat. Phys. Chem. (2015), http://dx.doi.org/10.1016/j.radphyschem.2015.05.034i

S. Díez, S. Sánchez / Radiation Physics and Chemistry ∎ (∎∎∎∎) ∎∎∎–∎∎∎

3

Fig. 2. (a) Conformed beam without patient. (b) Mask created from image (a). (c) Input image: portal image of the patient. (d) Segmented image of the patient inside the treatment beam. (e) Segmented image of the patient outside the treatment beam. (f) Output image: ASHS image.

Pout

⎧lowout ⎪ ⎪highout ⎪ =⎨ ⎪ (Pin − lowin ) ⎪ ⎪ ⎩

if Pin < lowout if Pin > highout ⎛ high − lowout ⎞ out ⎟⎟ + lowout ⎜⎜ ⎝ highin − lowin ⎠ if lowout ≤ Pin ≤ highout

(2)

Another classical algorithm for contrast enhancement of images is the histogram equalization (HE) algorithm. There are, basically, two ways to enhance the contrast by HE algorithm: considering the image as a whole to linearize the cumulative

distribution function (CDF) of pixels related to gray levels, which is termed as histogram equalization, or dividing the image into n sub-images and to perform a histogram equalization on each one, which is known as Local Histogram Equalization (LHE). In this regard, HE is a contrast enhancement procedure which attempts to obtain as a result a flat histogram in the output image. For a i × j gray-scaled image (Iij) of L levels,1 the occurrence probability of pixels with gray-level k is

1

In the case of portal images it is usual to deal with 16-bits images.

Please cite this article as: Díez, S., Sánchez, S., Algorithms for contrast enhancement of electronic portal images. Radiat. Phys. Chem. (2015), http://dx.doi.org/10.1016/j.radphyschem.2015.05.034i

S. Díez, S. Sánchez / Radiation Physics and Chemistry ∎ (∎∎∎∎) ∎∎∎–∎∎∎

4

equipment used are summarized in Table 1.

Table 3 Algorithm flowchart: NLM þ LCLHE.

2.2. Hardware features The specifications of the hardware used for imaging processing are as follows. A computer with 15.4 GB of RAM memory, a processor Intel Core i7-4770 CPU 3.40 GHz  8, and a 64-bits operation system. The softwares used were GNU Octave 3.8.1 and ImageJ 1.48g. 2.3. Portal images' features All the portal images in the present work acquired by the EPID are 16-bit images (65 535 gray levels) of 1024  1024 pixels.

3. Algorithms for contrast enhancement of portal images 3.1. Automatic Segmentation and Histogram Equalization

pr (rk ) =

nk , n

0≤k
(3)

where n = i × j and nk is the number of pixels with gray-level nk. In the HE technique, a transformation function T(r) is seek such that pr (rk ) would be approximately the same for all gray levels in the image. It can be proved that such a function is defined by the CDF: k

sk = T (rk ) =

k

∑ pr (rl ) = ∑ l= 0

l= 0

nl ≡ CDFk (rk ), n

0≤k
(4)

Then, the general equalization formula for the pixel rk is

h (rk ) =

sk − CDFmin (L − 1) (i × j ) − CDFmin

(5)

where CDFmin is the minimum non-zero value of the cumulative distribution, i  j is the number of pixels in the image, and L is the number of gray levels used, i.e. 65 535 in 16-bit images. A consequence of having approximately equal probabilities for pixels occurrences is that the cdf will be linearized, i.e.

CDFk (rk ) = Crk

(6)

2. Materials and methods 2.1. EPID & LINAC features Images processed in this work were obtained with an amorphous silicon EPID thanks to the staff and facilities of the Hospital Clínico Universitario de Valencia, Spain. The specifications of the

The key idea is to implement an algorithm that automatically segments the original portal image, using a mask, into two regions that are independently processed: one region corresponding to the patient imaged inside the treatment beam, and the other region outside of it. Then, a histogram stretching is applied separately on both sub-images. For this purpose, an algorithm called Automatic Segmentation and Histogram Stretching (ASHS) was developed. The whole steps are summarized in the algorithm flowchart (Table 2) and Fig. 2. In the first step of the ASHS algorithm, a single-exposed image of the conformed beam without patient is acquired for masks to be created, see Fig. 2(a) and (b). A portal image of the conformed beam is used for avoiding difficulties in edge detection like unconnected borders induced by variations in the patient thickness. In the second step, the contour of the conformed beam is extracted by applying a Sobel filter to the input image in x and y directions. Then, a thresholding process is implemented to binarize the image by establishing a suitable threshold value τs, so that any pixel value above τs is set as 1 (white) and under it as 0 (black). The thresholding task is improved by applying a 12  12 average filter to the image resulting from applying the Sobel filter. After this, τs is set by extracting the 20% of the mean value resulting from averaging the two maximums pixel values in an image profile. The contour field then obtained is too coarse. Hence, a skeletonization is carried out obtaining a contour of one pixel thick. After the skeletonization is done, then, the edge is cleaned using a spur remove algorithm (Pratt, 2007; MATLAB). Finally, the mask is created by filling the field contour with white pixels. Similar procedures of image segmentation are implemented in Crooks and Fallone (1993). Once the mask is created, the portal image with patient is segmented into two images in which contrast is independently enhanced by applying a histogram stretching like the one described by Eq. (2). 3.2. Normalization to Local Mean and Lineally Combined Local Histogram Equalization The second algorithm involves the combination of two algorithms: NLM and LCLHE. The flowchart (Table 3) and Fig. 3 summarize the steps followed in this algorithm. 3.2.1. Normalization to Local Mean Initially, a 101  101 average filter is applied three times to completely degrade the image and obtain a smoothed image. Then, a pixel by pixel division between the original image and its smoothed version is performed, which enhances the contrast. In

Please cite this article as: Díez, S., Sánchez, S., Algorithms for contrast enhancement of electronic portal images. Radiat. Phys. Chem. (2015), http://dx.doi.org/10.1016/j.radphyschem.2015.05.034i

S. Díez, S. Sánchez / Radiation Physics and Chemistry ∎ (∎∎∎∎) ∎∎∎–∎∎∎

5

Fig. 3. (a) Input image in NLM: portal image of the patient. (b) Background image. (c) Restored image resulting from divide images (a) and (b). (d) Input image in LCLHE: portal image of the patient. (e) Resulting image after a Local Histogram Equalization. (f) Linear combination between images (d) and (f). (g) Output image: linear combination between images (c) and (f).

Please cite this article as: Díez, S., Sánchez, S., Algorithms for contrast enhancement of electronic portal images. Radiat. Phys. Chem. (2015), http://dx.doi.org/10.1016/j.radphyschem.2015.05.034i

S. Díez, S. Sánchez / Radiation Physics and Chemistry ∎ (∎∎∎∎) ∎∎∎–∎∎∎

6

the output image, the visualization of the radiation field inside is clearly improved, see Fig. 3(c). This approach is based on those used in image restoration, for further information (Pratt, 2007; Gonzalez et al., 2008). 3.2.2. Lineally Combined Local Histogram Equalization In first place, a local histogram equalization is applied on the input image Fig. 3(d), where a kernel of 101  101 has been used. The result of this process is shown in Fig. 3(e). The contrast then achieved is overwhelming, although any information of the radiation field has been lost. In the final step of the LCLHE, the original image is linearly combined with the processed image after a Local Histogram Equalization (LHE) is applied, according to the equation ′ gmn = gmn + α·hmn

(7)

where gmn is the input portal image, see Fig. 3(d), hmn corresponds to the LHE output image Fig. 3(e), α controls the strength of combination and is set to α ¼ 0.25. The output image from LCLHE is shown in Fig. 3(f). In this figure it is remarkable that anatomical structures have been successfully reveled. 3.3. NLM and LCLHE linear combination In the final step of the algorithm the output images from NLM and LCLHE algorithms are lineally combined as follows: ′ gmn = NLMmn + α·LCLHEmn

(8)

′ where gmn is the (m,n)th matrix element of resultant image Fig. 3 (g), NLMmn stand for the (m , n )th matrix element of image processed by NLM (see Fig. 3(c)), α represents the strength of combination between images and is set to α ¼0.25 and LCLHEmn stands for the (m,n)th matrix element of the image output from LCLHE (Fig. 3(f)).

4. Results and discussion

Fig. 4. Image Intensity profiles of images from a prostate treatment. (a) Window and level adjusted version of the original portal image. (b) Profile along line in image (a). (c) Output image from ASHS. (d) Profile along line in image (c). (e) Output image from NLMþ LCLHE. (f) Profile along line in image (e). (g) Digital Reconstructed Radiotherapy. (h) Profile along line in image (g).

Table 4 Contrast comparison between different portal images of a prostate treatment. Image

Original ASHS NLM þ LCLHE DRR

Intensity (ROI 1)

(ROI 2)

39 41 36 102

46 54 188 200

In order to evaluate the contrast enhancement achieved by the ASHS and NLMþ LCLHE algorithms, two circular regions of interest (ROIs) with diameters of 15-pixels were taken to measure the contrast between soft tissue and bone, as depicted in Fig. 4. These enhancements are compared with the contrast in a window and level adjusted portal image (Fig. 4(a)) and the one obtained from the Digital Reconstructed Radiography (Fig. 4(g)). The intensity profiles in each case are also illustrated in Fig. 4(b), (d), (f) and (h). The contrasts then computed in images, Fig. 4(a), (c), (e) and (g), are summarized in Table 4. It is remarkable that the contrast enhancement achieved, specially, by the NLM þLCHE algorithm which is 2.6 times greater in relation to the ASHS algorithm or 4.6 times greater compared to the window/level algorithm. It can be noticed from Fig. 3(e) that the noise is amplified by the LHE algorithm which is inherited by the image in Fig. 4 (e) resulting from the NLMþ LCLHE algorithm, and it is presented in the intensity profile fluctuations of Fig. 4(f). Nonetheless, the perception of the visualization has been strongly enhanced.

Contrast

5. Conclusions

0.08 0.14 0.37 0.34

We have presented two effective and efficient algorithms for portal image enhancement. With the Automatic Segmentation and Histogram Stretching (ASHS) technique two main facts are developed. Firstly, any radiation field contour can be successfully detected. Secondly, the visualization can be independently improved

Please cite this article as: Díez, S., Sánchez, S., Algorithms for contrast enhancement of electronic portal images. Radiat. Phys. Chem. (2015), http://dx.doi.org/10.1016/j.radphyschem.2015.05.034i

S. Díez, S. Sánchez / Radiation Physics and Chemistry ∎ (∎∎∎∎) ∎∎∎–∎∎∎

by regions, inside and outside the contour. On the other hand, the greatest disadvantage of this technique is that in the segmentation process, the transition between regions is abruptly changed such that the visualization is affected in the field borders. In the second image processing method, improvements in the visual perception of the anatomical and bony structures are obtained in both outside and inside the radiation field. Two novel algorithms have been developed for these purpose: a Normalization to Local Mean (NLM) and a Lineally Combined Histogram Equalization (LCLHE). Further studies of the possibilities and limitations to establish the ASHS method as tool for quality-controlling of the radiation field positioning is still to be done and is left as future work. Among the algorithms presented, the NLMþ LCHE algorithm offers a contrast enhancement 2.6 times greater than ASHS one, turning it into a more suitable tool in image visualization of portal image. Up to date we still have a problem to be solved: the lack of objective parameters to establish which of the current techniques produce the image with the best quality.

Acknowledgement

7

support from Hospital Clinico Universitario de Valencia and José Ródenas, Chairman of the Technical Program Committee of IRRMA-9.

References Antonuk, L.E., 2002. Electronic portal imaging devices: a review and historical perspective of contemporary technologies and research. Phys. Med. Biol. 47 (6), R31. Crooks, I., Fallone, B.G., 1993. Contrast enhancement of portal images by selective histogram equalization. Med. Phys. 20 (1), 199–204. Gonzalez, R.C., Woods, R.E., Ercan, G., Whyte, P., 2008. Digital Image Processing, 3rd edn. Prentice Hall, Upper Saddle River, NJ. Herman, M.G.G., Kruse, J.J.J., Hagness, C.R.R., 2000. Guide to clinical use of electronic portal imaging. J. Appl. Clin. Med. 1 (2), 38–57. Herman, M.G., Balter, J.M., Jaffray, D.A., McGee, K.P., Munro, P., Shalev, S., Van Herk, M., Wong, J.W., 2001. Clinical use of electronic portal imaging: report of AAPM Radiation Therapy Committee Task Group 58. Med. Phys. 28 (5), 712–737, ISSN 0094-2405. Kirby, M.C., Glendinning, A.G., 2006. Developments in electronic portal imaging systems. Br. J. Radiol. 79 (Spec No) (2006) S50–65. Langmack, K.A., 2001. Portal imaging. Br. J. Radiol. 74 (885), 789–804. Morphological operations on binary images – MATLAB bwmorph – MathWorks Espanã . URL 〈http://www.mathworks.es/es/help/images/ref/bwmorph.html〉. Pratt, W.W.K., 2007. Digital Image Processing: PIKS Scientific Inside, 4th edn. WileyInterscience, New York, USA.

This research paper is made possible through the help and

Please cite this article as: Díez, S., Sánchez, S., Algorithms for contrast enhancement of electronic portal images. Radiat. Phys. Chem. (2015), http://dx.doi.org/10.1016/j.radphyschem.2015.05.034i