2.1 Introduction

Public databases of X-ray images can be found for medical imaging,Footnote 1 however, to the best knowledge of the author, up until now there have not been any public databases of digital X-ray images for X-ray testing for general purposes.Footnote 2      

Fig. 2.1
figure 1

Random X-ray images of \(\mathbb {GDX}\)ray+database

As a service to the X-ray testing community, we collected more than 23,100 X-ray images for the development, testing, and evaluation of image analysis and computer vision algorithms. The images are organized in a public database called \(\mathbb {GDX}\)ray+.Footnote 3 In order to illustrate our database, a random selection of 120 X-ray images is shown in Fig. 2.1. The database includes five groups of X-ray images: castings, welds, baggage, natural objects, and settings. Each group has several series, and each series several X-ray images. Most  of the series are annotated or labeled. In those cases, the coordinates of the bounding boxes of the objects of interest or the labels of the images are available. In Table 2.1, we can see some statistics. The size of \(\mathbb {GDX}\)ray+is 4.54 GB, and it can be downloaded from our website (see Fig. 2.2).

In this chapter, we will view the structure of \(\mathbb {GDX}\)ray+database, a description for each group (with some series examples), some examples of applications that have been published using images of \(\mathbb {GDX}\)ray+  and some examples in Python that can be used to manipulate the database. More details about \(\mathbb {GDX}\)ray+are given in Appendix A

2.2 Structure of the Database

\(\mathbb {GDX}\)ray+is available in a public repository. The repository contains 5 group folders one for each group: Castings, Welds, Baggage, Nature, and Settings. For each group, we define an initial: C, W, B, N, and S, respectively. As shown in Table 2.1, each group has several series. Each series is stored in an individual sub-folder of the corresponding group folder. The sub-folder name is Xssss, where X is the initial of the group and ssss is the number of the series. For example, the third series of group Castings is stored in sub-folder C0003 of folder Castings. The X-ray images of a series are stored in file Xssss_nnnn.png. Again Xssss is the name of the series. The number nnnn corresponds to the number of the X-ray image of this series. For example, the fifth X-ray image of series C0003 is C0003_0005.png and is stored in folder Castings/C0003. The whole structure is summarized in Table 2.2. All X-ray images of \(\mathbb {GDX}\)ray+are stored in ‘png’ (Portable  Network Graphics)Footnote 4 format.

Table 2.1 Statistics of \(\mathbb {GDX}\)ray+database
Fig. 2.2
figure 2

Screenshot of \(\mathbb {GDX}\)ray+website. The figure shows X-ray image of a backpack using pseudo coloring (‘hot’ colormap): B0083_0031.png

Table 2.2 Structure of \(\mathbb {GDX}\)ray+
Fig. 2.3
figure 3

Some X-ray images of an aluminum wheel (group Castings series C0001)

Fig. 2.4
figure 4

Some X-ray images of a knuckle (group Castings series C0059)

Table 2.3 Applications of series Castings

2.3 Castings

The group Castings contains 3,768 X-ray images arranged in 68 series. The X-ray images were taken mainly from automotive parts (aluminum wheels and knuckles). Some examples are illustrated in Figs. 2.3, 2.4 and 2.5. The details of each series are given in Table A.2. Experiments on these data can be found in several publications as shown in Table 2.3. It is interesting to highlight that series C0001 (see Fig. 2.3) contains not only a sequence of 72 X-ray images taken from an aluminum wheel by rotating its central axis in 5\(^0\), but also annotations of bounding boxes of the ground truth of 226 small defects and the calibration matrix of each image that relates the 3D coordinates of the aluminum wheel with 2D coordinates  of the X-ray image.

Fig. 2.5
figure 5

Some annotated images showing bounding boxes of casting defects

Fig. 2.6
figure 6

Some X-ray images of group Welds series W0003. This series corresponds to the BAM database

2.4 Welds

The group Welds contains 98 images arranged in 4 series. The X-ray images were taken by the Federal Institute for Materials Research and Testing, Berlin (BAM).Footnote 5 Some examples are illustrated in Fig. 2.6. The details of each series are given in Table A.4. Experiments on these data can be found in several publications as shown in Table 2.4. It is interesting to highlight that series W0001 and W0002 (see Fig. 2.7) contains not only 10 X-ray images selected from the whole BAM database (series W0003), but also annotations of bounding boxes and the binary images  of the ground truth of 641 defects.

Table 2.4 Applications of series Welds
Fig. 2.7
figure 7

Some images of group Welds series W0001 (X-ray images) and W0002 (ground truth)

2.5 Baggage

The group Baggage contains 10,863 X-ray images arranged in 86 series. The X-ray images were taken from different containers such as backpacks, pen cases, and wallets, etc. Some examples are illustrated in Figs. 2.8, 2.9, 2.10, 2.11, and 2.12. The details of each series are given in Table A.23. Experiments on these data can be found in several publications as shown in Table 2.5. It is interesting to highlight that series B0046, B0047, and B0048 (see, for example, Fig. 2.8) contains 600 X-ray images that can be used for automated detection of handguns, shuriken, and razor blades (bounding boxes for these objects of interest are available as well). In this case, the training can be performed using series B0049, B0050, and B0051 that includes X-ray images of individual handguns, shuriken, and razor blades, respectively, taken  from different points of view as shown in Fig. 2.9.

Fig. 2.8
figure 8

Some X-ray images of a bag containing handguns, shuriken, and razor blades (group Baggage series B0048)

Fig. 2.9
figure 9

Some X-ray images of handguns (series B0049), shuriken (series B0050), and razor baldes (series B0051) of group Baggage

Table 2.5 Applications of series Baggage
Fig. 2.10
figure 10

A knife was rotated in 1\(^0\) and by each position, an X-ray image was captured. In this figure, X-ray images at \(0^0, 10^0, 20^0, \dots 350^0\) are illustrated (see series B00008 of group Baggage)

Fig. 2.11
figure 11

Backpacks with no threat objects. They can be used to superimpose the isolated threat objects of Fig. 2.9 (see series B00083 of group Baggage). [\(\rightarrow \) Example 2.1 ]

Fig. 2.12
figure 12

X-ray images of a pen case from 90 different points of view. They are obtained by rotating \(\alpha \) and \(\beta \) as shown in the left model (see series B00045 of group Baggage)

2.6 Natural Objects

The group Nature contains 8,290 X-ray images arranged in 13 series. The X-ray images were taken from different natural objects such as salmon filets, fruit, and wood pieces. Some examples are illustrated in Figs. 2.13, 2.14, and 2.15. The details of each series are given in Table A.1. Experiments on these data can be found in several publications as shown in Table 2.6. It is interesting to highlight that series N0012 and N0013 (see Fig. 2.16) contains not only 6 X-ray images of salmon filets, but also annotations of bounding boxes and the binary images of the ground truth of 73 fish bones. For training proposes, there  are more than 7,500 labeled small crops (10 \(\times \) 10 pixels), of regions of X-ray of salmon filets with and without fish bones in series N0003.

Fig. 2.13
figure 13

Some X-ray images of salmon filets (group Nature series N0011)

Fig. 2.14
figure 14

Some X-ray images of cherries (group Nature series N0006)

Fig. 2.15
figure 15

Some X-ray images of wood (group Nature series N0010)

2.7 Settings

The group Settings contains 170 X-ray images arranged in 8 series. The X-ray images were taken from different calibration objects such checkerboards and 3D objects with regular patterns. Some examples are illustrated in Figs. 2.17 and 2.18. The details of each series are given in Table A.5. Experiments on these data can be found in several publications as shown in Table 2.7. It is interesting to highlight that series S0008 (see Fig. 2.17) contains not only 18 X-ray images of a copper checkerboard, but also the calibration matrix of each view. In addition, series S0007 can be used for modeling the distortion of an image intensifier. The coordinates of each hole of the calibration pattern in each view are available, and  the coordinates of the 3D model are given as well.

Table 2.6 Applications of series Nature
Fig. 2.16
figure 16

Some images of group Nature series S0012 (X-ray images of salmon filets) and S0013 (ground truth for fish bones)

Fig. 2.17
figure 17

Some X-ray images of a copper checkerboard used by calibration (group Settings series S0008)

Fig. 2.18
figure 18

Some X-ray images of circular pattern in different points of view used by calibration (group Settings series S0007)

Table 2.7 Applications of series Settings

2.8 Python Commands

In order to manipulate \(\mathbb {GDX}\)ray+database easily, some helpful Python functions were developed in pyxvis Library. In this section, we present a summary of them with some examples.

Python Example 2.1: In this example, we show how simple it is to display the X-ray images of a series of \(\mathbb {GDX}\)ray+.:

figure d

The output of this code is illustrated in Fig. 2.11. \(\square \)

Some pyxvis Library functions that can be used to manipulate \(\mathbb {GDX}\)ray+are the following:

  • of : This GUI functionFootnote 6 is used to browse \(\mathbb {GDX}\)ray+database. An example is illustrated in Fig. 2.19. An additional example using pseudo coloring is shown in Fig. 2.20;, the user can select one of 10 different color maps. This function can be used to display the bounding boxes of an X-ray image. For example, in X-ray image N0012_0004.png the bounding boxes of the ground truth are displayed in Fig. 2.19. Each bounding box is stored as a row in file of folder of \(\mathbb {GDX}\)ray+. The format of this file is as follows: one bounding box per row; the first number of the row is the number of the image of the series, and the next four values are the coordinates \(x_1, x_2, y_1, y_2\) of a bounding box. Thus, the rectangle of a bounding box is defined by its opposite vertices: \((x_1,y_1)\) and \((x_2,y_2)\).

  • of : This function is used to display several images of a series in only one figure (see example in Fig. 2.10 or Example 2.1).

  • of : This function is used to ascertain the path of a series of \(\mathbb {GDX}\)ray+.

  • of : This function is used to compute some statistics of \(\mathbb {GDX}\)ray+. The output is Table 2.1.

  • of : This function is used to load an image of \(\mathbb {GDX}\)ray+. For example, N0012_0004.png can be stored in matrix img using the following commands:

    figure e
  • of : This function is used to load a file into a workspace. For instance, the ground truth data of series N0012 can be stored in matrix using the following commands:

    figure f

For annotation, there are some open- source tools that can be used to manually annotate bounding boxes of a series of \(\mathbb {GDX}\)ray+. An example isn Fig. 2.21.Footnote 7

Fig. 2.19
figure 19

Example of command that can be used to browse \(\mathbb {GDX}\)ray+. The user can click buttons [Previous] and [Next] to display the next groups, series or images. In addition, the ground truth option can be used to display manual annotations when they are available. In this example, the fish bones of a salmon filet are highlighted. For colored images, see Fig. 2.20

Fig. 2.20
figure 20

Example of command using pseudo coloring of a wood X-ray image. For another example in grayscale, see Fig. 2.19

Fig. 2.21
figure 21

Annotation: there are some tools that can be used to manually annotate the ground truth of a series. In this example, the user is annotating the razor blades of series B0065

2.9 Summary

In this chapter, we presented the details of a new public dataset called \(\mathbb {GDX}\)ray+. It consists of more than 21,100 X-ray images. The database includes five groups of X-ray images: castings, welds, baggage, natural objects, and settings. Each group has several series and X-ray images with many labels and annotations that can be used for training and testing purposes in computer vision algorithms. To the best knowledge of the author, up until now, there have not been any public databases of digital X-ray images for general purposes in X-ray testing.

In this chapter, we explained the structure of the \(\mathbb {GDX}\)ray+database, we gave a description for each group (with some series examples), we presented some examples of applications that have been published using images of \(\mathbb {GDX}\)ray+, and some examples in Python with pyxvis Library, that can be used to manipulate the database.

We believe that \(\mathbb {GDX}\)ray+represents a relevant contribution to the X-ray testing community. On the one hand, students, researchers, and engineers can use these X-ray images to develop, test, and evaluate image analysis and computer vision algorithms without purchasing expensive X-ray equipment. On the other hand, these images can be used as a benchmark in order to test and compare the performance of different approaches on the same data. Moreover, the database can be used in the training programs of human inspectors.