14
1 Cambridge University Engineering Department Technical Report CUED/C-MICROMECH/TR.100 August 18th, 2015 1 University of Cambridge, Department of Engineering, Trumpington St, Cambridge, CB2 1PZ 2 University of Cambridge, Department of Physics, Cavendish Laboratory, J J Thomson Avenue, Cambridge, CB3 0HE 3 Cambridge University Hospitals NHS Foundation Trust, Department of Oncology, Addenbrooke’s Hospital, Cambridge, CB2 0QQ 4 NHS Foundation Trust, Department of Medical Physics and Clinical Engineering, Addenbrooke’s Hospital, Cambridge, CB2 0QQ Summary This report describes details of an auto-contouring algorithm developed as part of the VoxTox programme [1]. The aim is to contour the rectum automatically, so as to understand toxicity to the rectum associated with radiotherapy treatment of prostate cancer. The basis of the contouring is the Chan-Vese algorithm [2], which is implemented in 2D within the Matlab coding environment [3]. Details are given of the start contour, image windowing, and identification of poor contours. The method has been developed on a training set of data, and evaluated on a test set. Results show promise. Further quantification of the accuracy of the method has been undertaken within the VoxTox program, and will be reported separately. Auto-contouring of the rectum on megavoltage computed tomography images Michael PF Sutcliffe 1* , Karl Harrison 2 , Jessica E Scaife 3 , M Andrew Parker 2 , Marina Romanchikova 4

Cambridge University Engineering Department …mpfs/papers/SHSPR2015Autocontouring.pdf1 Cambridge University Engineering Department Technical Report CUED/C-MICROMECH/TR.100 August

  • Upload
    others

  • View
    11

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Cambridge University Engineering Department …mpfs/papers/SHSPR2015Autocontouring.pdf1 Cambridge University Engineering Department Technical Report CUED/C-MICROMECH/TR.100 August

1

Cambridge University Engineering Department Technical Report

CUED/C-MICROMECH/TR.100

August 18th, 2015

1 University of Cambridge, Department of Engineering, Trumpington St, Cambridge, CB2 1PZ

2 University of Cambridge, Department of Physics, Cavendish Laboratory, J J Thomson Avenue, Cambridge, CB3 0HE

3 Cambridge University Hospitals NHS Foundation Trust, Department of Oncology, Addenbrooke’s Hospital, Cambridge, CB2 0QQ

4 NHS Foundation Trust, Department of Medical Physics and Clinical Engineering, Addenbrooke’s Hospital, Cambridge, CB2 0QQ

Summary This report describes details of an auto-contouring algorithm developed as part of the VoxTox programme [1]. The aim is to contour the rectum automatically, so as to understand toxicity to the rectum associated with radiotherapy treatment of prostate cancer. The basis of the contouring is the Chan-Vese algorithm [2], which is implemented in 2D within the Matlab coding environment [3]. Details are given of the start contour, image windowing, and identification of poor contours. The method has been developed on a training set of data, and evaluated on a test set. Results show promise. Further quantification of the accuracy of the method has been undertaken within the VoxTox program, and will be reported separately.

Auto-contouring of the rectum on megavoltage computed tomography images

Michael PF Sutcliffe1*, Karl Harrison2, Jessica E Scaife3, M Andrew Parker2,

Marina Romanchikova4

Page 2: Cambridge University Engineering Department …mpfs/papers/SHSPR2015Autocontouring.pdf1 Cambridge University Engineering Department Technical Report CUED/C-MICROMECH/TR.100 August

2

1. Introduction This report describes an auto-contouring algorithm for identifying rectum contours on computed tomography (CT) slices obtained with megavoltage (MV) X-rays over a course of radiotherapy treatment. The data are managed using data-processing algorithms developed as part of the VoxTox project [1]. The sets of MV image slices, obtained for each of the fractions of treatment are complemented by a planning scan taken at the start of treatment, obtained using kilovoltage (kV) X-rays. The rectum has been outlined on each planning scan by a clinician. Images from MV and kV scans are placed in the same coordinate system, using couch shifts associated with centring the target to perform a rigid registration. The essential part of the contouring algorithm is two dimensional (2D), with data from each slice treated in isolation. However post-processing is used to assess the smoothness across slices of the resulting contours, and outlier contours are replaced by a smoothed estimate. Manually outlined contours (outlined by a clinical oncologist, JES) are used as a reference to provide a measure of accuracy. The algorithm has been developed on a training set of scans, then evaluated independently on a test set. 2. Pre-processing images 2.1 Rescaling Hounsfield Units To provide better contrast and to improve issues with air and bone, values in Hounsfield Units (HU) are re-scaled, as illustrated in Fig. 1. The rescaling parameters are chosen based on the parameters found clinically to give good contrast. In the critical range of the rectal material, pixels between -10 HU and 100 HU are rescaled to a grey scale between 0 and 1. Values between 30 HU and 60 HU are assigned a value of 1, with linear ramps up to these values as shown in Fig. 1. Pixels with a reading below -130 HU are identified as air. Further details of how air is identified are described in the next section.

Fig. 1. Rescaling from Hounsfield Units (HU) to scaled intensity. Pixels reading less than -130 HU are identified as air, and are rescaled to a value of 0.8 to mark them as being rectal material. HU values between -10 and 100 are in the critical rectum intensity region, and are rescaled between 0 and 1.

Page 3: Cambridge University Engineering Department …mpfs/papers/SHSPR2015Autocontouring.pdf1 Cambridge University Engineering Department Technical Report CUED/C-MICROMECH/TR.100 August

3

2.2 Search region A search region, based on anatomical features, limits the area considered in the autocontouring algorithm. For each image slice, the Otsu threshold [4] relative to all pixel intensities is calculated, the largest region of contiguous pixels with above-threshold intensities is identified, and the centre of the box bounding this region is taken as a reference point. An initial search region is defined from the rectum's estimated maximum displacements, relative to the reference point. These estimated maximum displacements have been obtained from a consideration of rectum outlines drawn manually by a clinician, for all slices of 37 scans per patient, for 10 patients (370 scans total). A more constrained search region is defined by analysing pixel intensities inside the initial search region. This analysis excludes the posterior area containing the high-intensity pixels corresponding to the spine, and places left and right bounds that contain the higher-intensity pixels characteristic of rectal material. In practice it was found that this sometimes missed the required contour. Hence only the posterior boundary from this box is used, corresponding to the spine, but with a slight enlargement. The other search boundaries are taken by expanding out from the kV contour. The actual region used in the contouring expands slightly from this search region (by values of 20 pixels in the left and right directions, by 20 pixels in the posterior, and by 10 pixels in the anterior direction), while the region of the original scan outside the search region was assigned a grey scale value of 0, corresponding to dark pixels.

Fig. 2. Definition of search boxes for auto-contouring. The outermost box (yellow) bounds the patient, and the cross-wires (red) indicate its centre. The middle box (magenta) defines the limits on rectum

position, as found from consideration of all slices in 370 scans. The inner box (cyan) is obtained from an intensity analysis. The rectum outline as drawn manually by a clinician is also shown (green). The

pixel size is 0.7647 mm × 0.7647 mm, and intensity values are in Hounsfield Units (HU).

Page 4: Cambridge University Engineering Department …mpfs/papers/SHSPR2015Autocontouring.pdf1 Cambridge University Engineering Department Technical Report CUED/C-MICROMECH/TR.100 August

4

2.3. Dealing with air Air in the scan provides a useful marker of the rectum, but also a potential source of confusion to an automated algorithm. Various ideas have been tried to deal with this. Air was identified for all pixels below -150 HU, or pixels below -130 HU after applying a median filter to eliminate the odd dark pixel. The largest region of connected air pixels was identified. If this contained at least 100 pixels, the scan was deemed to have an air pocket. Finally, both the largest air pocket and other pixels of air were assigned an intensity level of 0.8. The process is illustrated in Fig. 3.

Fig. 3. Identification of air. The original scan is shown in (a). Low intensity pixels are identified in (b). In (c) smaller spots have been eliminated, the large air region has had holes filled and the intensity is rescaled to an intensity of 0.8. The final auto-contour is in magenta (bias parameter = -1.0). The clinician-derived MV contour (blue) and kV contour (green) are also shown in blue and green. 3. Contouring algorithm 3.1 Identification of contour starting point A key requirement of the auto-contouring algorithm is identification of a good starting contour. In a first approach the starting point for the rectum contour was identified by scanning for appropriate features, using no a priori knowledge, but this was found unreliable. A more reliable approach used the kV contour as the starting point. It was found that shrinking the kV contour slightly, and using an auto-contouring algorithm with a bias to expand was helpful. An improved starting position was found by using a correlation algorithm to search for bright spots of the same shape as the kV contour and within 20 pixels of the starting contour. The effectiveness of this approach is illustrated in Fig. 4.

(b) (a) (c)

Page 5: Cambridge University Engineering Department …mpfs/papers/SHSPR2015Autocontouring.pdf1 Cambridge University Engineering Department Technical Report CUED/C-MICROMECH/TR.100 August

5

Fig 4. Illustration of identification of the starting contour showing: kV contour (blue), manually drawn MV contour (green), initial guess (cyan) and final auto-contour (magenta). Note the offset between the kV contour and initial guess (bias parameter = -1.0). 3.2 Auto-contouring algorithm A 2D Chan-Vese algorithm [2] is implemented within the standard Matlab suite of functions [3]. This function was modified to allow passing of a greater range of parameters, four of which were investigated: - the smoothing parameter is critical to give a sensible contour, but its optimum value also seems to depend on other parameters. In the final iteration this is fixed at 6. – two parameters to weight foreground and background variations in intensity have been adjusted. A slight change from the default value was found appropriate; a value of 1.1 has been used for the foreground weight, compared with the default of 1, and the default value of 1 has been used for the background weight. - the contraction bias is a key parameter which expresses the weighting assigned to the area of the contour. Changes in this parameter encourage or discourage expansion of the fitted contour. The best parameter value to fit the data has been investigated systematically. The final value chosen was -0.9. 3.3 Post-processing 3.3.1 Implausibly large contours and finding the muscle-affected region Figure 5 shows the relationship between the conformity index CI, comparing auto and manual contouring, and the area of the auto-contoured region, after subtracting off the area in the contour identified as air. For each pair of contours the conformity index is defined as the area of intersection divided by the area of union. Many of the large contours correspond to the lower part of the rectum. Here, for the auto-contouring parameters chosen, the contour is systematically over-estimated, so that CI is low. This auto-contouring error is illustrated for selected slices in Fig. 6.

Page 6: Cambridge University Engineering Department …mpfs/papers/SHSPR2015Autocontouring.pdf1 Cambridge University Engineering Department Technical Report CUED/C-MICROMECH/TR.100 August

6

Figure 5. Implausibly large areas are identified as those where the CI comparing auto-contouring and manual contouring is low. Most are in the region of muscle in the lower part of the rectum, where the algorithm systematically over-estimates the contour. The horizontal line shows the cut-off chosen for implausibly large contour areas (after subtracting off the area identified as air). This cut-off is 2500 pixels (bias parameter = -1.0).

Figure 6. Example auto-contouring results (magenta) in lower rectum. From left to right the sequence moves up the rectum. Large auto-contour regions correspond to slices where the rectum is poorly defined. Muscle is identified in (a), (b) and (c) (bias parameter = -1.0).

The observation that large errors systematically occur in the muscle region is used to identify the end of the muscle region. This is chosen as the most superior slice with an over-large contour area, but not beyond the 6th slice from the bottom of the scan. In the event of no such slice being found, a default of the second-most inferior slice is chosen as the end of the muscle region. In the example given in Fig. 6, only slice (d) is unaffected by muscle. In some cases, slices inferior to this critical slice do not have an over-large contour, but are nevertheless identified as being in the muscle-affected zone.

(b) (a) (c) (d)

Page 7: Cambridge University Engineering Department …mpfs/papers/SHSPR2015Autocontouring.pdf1 Cambridge University Engineering Department Technical Report CUED/C-MICROMECH/TR.100 August

7

Con

form

ity in

dex

CI

or A

rea

/(10,

000

pixe

ls)

area

Figure 7 shows the variation of CI with position for the example scan of Fig. 6. Improvement in CI for the automated contour is seen superior to the muscle-affected region, and correlates with the fall in contoured area, The contoured area, which is also plotted in Fig .7, has had the area of any air present subtracted. The upper limit of area of 2500 pixels to identify poor contours is chosen with reference to Fig. 5. Areas larger than this correspond to contours with poor CI, associated with either the muscle region or some other auto-contouring problem.

Figure 7. Variation of contour area and conformity index with slice location, for the scan of Fig. 6. The most superior slice affected by muscle is at location 5 (bias parameter = -1.0).

3.3.2 Best choice of contour The best estimate of the rectal contour is taken from either the auto-contouring result or the kV scan. For slices in the muscle region, or where the area exceeded the threshold value of 2500 pixels the kV scan contour is used. All other slices used the auto-contour results. It is important to note that this identification of the best choice is intrinsic to the algorithm, and does not require manual intervention. 3.3.3 Smoothing Having identified the best contours on each slice of a scan from either auto-contouring or kV data, the three dimensional (3D) set can be used to assess whether contouring errors have occurred. This assessment involves examining the overall shape of the supposed rectum and applying a smoothing algorithm. The idea of the smoothing interpolation scheme is to use adjacent slices to identify, and improve on, rogue slices. Starting from either the kV data, in the muscle-affected region, or the auto-contour data in superior slices, a smoothed 3D representation of the rectum is

Page 8: Cambridge University Engineering Department …mpfs/papers/SHSPR2015Autocontouring.pdf1 Cambridge University Engineering Department Technical Report CUED/C-MICROMECH/TR.100 August

8

calculated. Slices already identified as having an implausibly large contour area are omitted when calculating this smoothed shape. Contours for each slice are represented in an r-θ format for the analysis, interpolating onto 100 values of θ, evenly spaced around the circumference. Hence the whole scan can be represented in a r-θ-z format with the radius r expressed as a function of regularly gridded values of θ and z, facilitating further analysis. A smooth function is fitted to the radius profile (r) in both the circumferential (θ) and axial (z) directions to obtain a new set of values of r corresponding to a smoothed shape. A robust-fit algorithm is used to minimise the influence of the outliers (i.e. the poor slices which we are trying to identify). Rogue slices are identified when the difference between the radius of the auto-contoured slice and the smoothed slice is greater than a given tolerance (10 pixels) for more than half of the contour. These contours are replaced by the smoothed contour. Contours at the top of the slice are replaced by the kV contour, rather than using extrapolation. Illustrative results Figure 8 show the geometry for two typical cases where the interpolation scheme was needed. The interpolated green contours replace the poor-quality red contours to give a more reasonable overall profile. Figure 9 shows the corrected slices for the left-hand case in Fig. 8.

Figure 8. Interpolated contours (green), replace the poor-quality auto-contour curves (red). Other superior contours (blue) are acceptable auto-contours, and inferior contours (magenta) are kV contours used in the muscle-affected part of the rectum.

Page 9: Cambridge University Engineering Department …mpfs/papers/SHSPR2015Autocontouring.pdf1 Cambridge University Engineering Department Technical Report CUED/C-MICROMECH/TR.100 August

9

Fig. 9. Interpolated contours (yellow) replace the poor-quality auto-contour curves (magenta). The green and blue contours are the manually-drawn and kV contours, respectively. Data are taken from the two slices with interpolation in the left-hand side of Fig. 8. 4. Auto-contouring results 4.1 Training data 4.1.1. Without smoothing A set of 27 scans from 8 patients was used to develop the algorithm as described above and to identify the best choice of parameters. The initial part of the development did not use the smoothing scheme described in section 3.3.3. Summary results for the auto-contouring algorithm, not including smoothing, are given in Fig. 10. This plots the mean CI from the 27 scans as a function of slice location, relative to the identified position of the end of the muscle-affected region. The kV contours act as a baseline. Above the muscle-affected region, the auto-contouring algorithm significantly improves the estimate of the rectal position. Within the muscle region the auto-contour is poor. The ‘best estimate’, using the kV or auto-contours as appropriate, gives a reasonable identification of the rectal position across the range. The improvement of the best estimate relative to the auto-contoured results above the muscle affected region reflects substitution of poor contours, with large areas, by the corresponding kV contours. The slight difference between best results for all slices, and best results excluding those slices with air, suggests that treatment of air is adequate. The effect of the contour bias parameter is shown in Fig. 10. Based on this graph, the best choice for this parameter is around -0.9, although values of -0.8 or -1.0 have a similar accuracy.

Page 10: Cambridge University Engineering Department …mpfs/papers/SHSPR2015Autocontouring.pdf1 Cambridge University Engineering Department Technical Report CUED/C-MICROMECH/TR.100 August

10

Fig. 10. Mean conformity index from comparing auto-contouring and manual contouring for 27 scans of training set. Results are shown as a function of the slice position, relative to the location identified as the end of the muscle-affected region. Smoothing is not included in this set of results. ‘Best estimates’ switch from auto-contouring to kV data for relative slice locations ≤ 0, and exclude excessively large auto-contours. The best ‘air’ and ‘no-air’ results include and exclude those slices with significant air pockets, respectively (bias parameter = -0.9).

Figure 11. Effect of contraction bias parameter on mean conformity index for auto-contouring results without smoothing.

Page 11: Cambridge University Engineering Department …mpfs/papers/SHSPR2015Autocontouring.pdf1 Cambridge University Engineering Department Technical Report CUED/C-MICROMECH/TR.100 August

11

4.1.2 Including smoothing Figure 12 shows, for the training data, the effect of smoothing. Results are compared for the CI before and after contour interpolation. For most points, the auto-contours are reasonable and no interpolation is needed. These points correspond to the diagonal lines in the figure. Where a rogue contour is identified, for points off the diagonal, the CI is improved in two-thirds of cases with the points moving above the line. Although a relatively small proportion of contours are modified by this interpolation, this nevertheless corresponds to a significant proportion of the scans. Given the potential for a few contours to affect the results, this interpolation algorithm is worth applying.

Fig. 12. Comparison of CI before and after applying the interpolation algorithm for the training scans. Averaged values of the CI for the training data set, with smoothing included, are given in Fig. 13. Results are encouraging, although the average values are not much changed from the results without smoothing (Fig. 11) because the number of outliers is relatively low. The number of poor-quality results affected by air (which is where problems tend to arise) is reduced.

Fig. 13. Mean CI as a function of site location, with smoothing included.

Page 12: Cambridge University Engineering Department …mpfs/papers/SHSPR2015Autocontouring.pdf1 Cambridge University Engineering Department Technical Report CUED/C-MICROMECH/TR.100 August

12

4.2 Test data The auto-contouring parameters identified as best for the training data have been used without modification on test data, using 3 scans from each of 10 patients. Results are given in Fig. 14. Results are encouraging, and comparable with the training data, though marginally worse at more superior slices. The larger difference between the best estimates with and without air indicate that air is having a greater impact on these scans. The treatment of air has been optimised using a relatively small number of cases in the test set. Apparently the ‘outlier’ nature of these cases means that the same approach is not so effective with the different cases presented in the test data. The effect of applying the interpolation scheme to the test data is given in Fig. 15. As with the training set, the smoothing algorithm improves outlier performance significantly.

Figure 14. Mean conformity index as a function of slice location for test data.

Page 13: Cambridge University Engineering Department …mpfs/papers/SHSPR2015Autocontouring.pdf1 Cambridge University Engineering Department Technical Report CUED/C-MICROMECH/TR.100 August

13

Fig. 15. Comparison of CI before and after applying the interpolation algorithm on the test data set. Concluding remarks An auto-contouring algorithm has been developed to identify rectal contours in CT images recorded with MV X-rays. The method, which uses a 2D Chan-Vese algorithm, gives reasonable results across the whole range of the rectum. The region affected by muscle is detected automatically and in this region the kV contour is used as the best estimate. Other erroneous contours are detected as being implausibly large, and again the kV contour is used as the default. The implementation of an algorithm to identify rogue contours and replace them by sensible interpolated contours is useful. Although the mean CI is not much changed, outliers are replaced by something more sensible, which will be more accurate and also less error-prone for subsequent analysis such as dose prediction or mechanical deformation. In general, the algorithm has been carefully tuned to the particular circumstances of the slices, using a set of 27 slices from 8 patients. Specific details such as the scaling of the Hounsfield units, identification of air, and tweaking of the image analysis have been chosen by trial and error, based on observations, so may not represent a ‘global minimum’. The contouring is beset by a wide variety of different special cases. The set of tweaks and parameters chosen is reasonably effective at dealing with these challenges. But this is a compromise, with improvements to some cases likely to lead to degradation in others. Significant improvement in the lower third of the rectum could be made by registration and accounting for air. Treatment of air in the superior regions of the rectum could also probably be improved. Use of a fully 3D algorithm would also be likely to improve the accuracy of the contouring.

Page 14: Cambridge University Engineering Department …mpfs/papers/SHSPR2015Autocontouring.pdf1 Cambridge University Engineering Department Technical Report CUED/C-MICROMECH/TR.100 August

14

References 1. VoxTox project, http://www.comprt.org/research/voxtox (2015) 2. T. F. Chan, L. A. Vese, Active contours without edges. IEEE Transactions on Image Processing, Volume 10, Issue 2, pp. 266-277 (2001) 3. Matlab, R2014b, The Mathworks Inc, Natick, MA, USA (2014) 4. N. Otsu, A Threshold Selection Method from Gray-Level Histograms. IEEE Transactions on Systems, Man and Cybernetics, Volume 9, Issue 1, pp.62-66 (1979).