Interactive visualization of multidimensional coincidence spectra

The paper presents direct visualization techniques of multidimensional nuclear spectra as well as visualization techniques based on projections of embedded subspaces. While the first group of graphical models is limited to four dimensions, the second one can be theoretically extended to any dimension. The presented algorithms of visualization have been implemented in nuclear data acquisition, processing and visualization system developed at the Institute of Physics, Slovak Academy of Sciences. The paper focuses on presentation of nuclear spectra. However the majority of algorithms can be successfully applied for visualization of scalar arrays of other data types


Introduction
The power of computers to collect, store and manipulate experimental data has increased dramatically. In today's nuclear physics experiments the number of detectors being included in the measurements is going up to one hundred or more. The results of such measurements, however, generate such large data sets as to be nearly incomprehensible. Scanning these large sets of numbers to determine trends and relationships is a tedious and ineffective process. To address this problem the physicists have turned to visualization of experimental data. If the data are converted to a visual form, the trends are often immediately apparent. Without visualization much of the increased power of computers would be wasted because experiments are poor at gaining insight from data presented in numerical form.
The goal of visualization of experimental data is an improved understanding of the result of the information gathered during experiment. It is one of the most powerful and direct ways how the huge amount of information can be conveyed in a form comprehensible to a human eye. As a result, development of visualization algorithms takes on great significance, offering a promising technology for transforming an indigestible mass of numbers into a medium, which experimenters can understand, interpret and explore.
The visualization techniques presented in this work make it possible to display either raw experimental spectra, processed data or to make slices of the same or lower dimensionality in an interactive way. They allow obtaining an imagination about event distribution and correlations in coincidence spectra up to five-dimensional space.
The objective of the paper is to present visualization techniques and graphical models to display multidimensional nuclear spectra (histograms), which were implemented in the nuclear data acquisition, processing and visualization system [1,2]. Though the software package is designed mainly for use with nuclear data, any kind of data can be processed as well. Other systems for nuclear spectra graphical representation were presented in [3,4].

Direct visualization techniques of scalar fields
A scalar variable is a single quantity, in the case of nuclear spectra -counts, which can be represented as a function of independent variables -particle energies. Most scalar visualization techniques use a consistent approach across one-, two-, or three-dimensional fields. More recent techniques, e.g. of the visualization of three-dimensional fields, attempt to show the full threedimensional variations of a scalar variable within a volume field. These techniques include isosurfaces, particle clouds, volume slicing and sampling planes [5][6][7].
The sophisticated visualization algorithms are presented in [8]. The paper presents conventional as well as newly developed visualization techniques and graphical models. The structure and complexity of the algorithms lend themselves for implementation in on-line live mode during the data acquisition or processing. The pictures can be simultaneously updated.
One can select various attributes of the display, e.g. color of the spectrum, the limits of the displayed part of the spectrum, window, marker, type of scale, and various display modes, slices, to rotate two-, or more-dimensional data. In the above-mentioned paper, we have developed the direct visualization algorithms up to four-dimensional data.

Two-dimensional spectra
Two-parameter coincidence nuclear spectrum (histogram) is represented by a matrix of data with two independent variables (parameters) and one dependent variable, (counts), i.e., c = f(x, y). To project the three-dimensional scene onto a two-dimensional screen the axonometric transformation is employed. To display three-dimensional data on screen we have employed the following model (page number not for citation purposes) where t xx , t xy , t yx , t yy , t yz , v x , v y are transform coefficients reflecting translation in both original twodimensional scalar field (in x, y dimensions as well as in counts) and in the position on screen, scaling, rotation around z-axis and elevation of the view. The position of a point on the screen is x', y' and x = x min + k x ·i; y = y min + k y ·j; i ∈ < 0, n x >; j ∈ < 0, n y > n x , n y are numbers of nodes of a regular grid. The model proposed in such a way allows: • to choose and display any part of the spectrum by setting x min , x max , y min , y max to appropriate values • to set any range of displayed counts -c min , c max • to place the display of spectrum anywhere on the screen • to rotate and elevate the view of the spectrum • to change the density of display nodes. This is important when displaying accumulated spectra in on-line mode, i.e., during the acquisition of spectra.
To illustrate the capabilities of the proposed visualization algorithms we introduce several examples. In Fig. 1 we present two-dimensional spectrum shown in contours display mode. The same spectrum shown in triangle display mode in log scale can be seen in Fig. 2. To identify interesting locations in spectra together with displayed spectrum one can display one-dimensional slices and to move with them in both directions (see Fig. 3).
Sophisticated surface display mode with shading according to heights of peaks is shown in Fig. 4. Shading according to the position of fictive light source is shown in Fig. 5. One can change the position of the light source thus giving the possibility to achieve special effects.
Furthermore, there exists possibility to combine both shading methods. In Fig. 6 we present the display mode with mixed surface shading (according to height and light position) with ratio 50:50. One can include also the display of shadows according to the light source (Fig. 7).
Two-dimensional spectrum shown in contours display mode Figure 1 Two-dimensional spectrum shown in contours display mode.
Two-dimensional spectrum shown in triangle display mode (logscale) Figure 2 Two-dimensional spectrum shown in triangle display mode (logscale).
Two-dimensional spectrum shown in points display mode with raster and slices Figure 3 Two-dimensional spectrum shown in points display mode with raster and slices.
An example of surface display mode with shading according to heights Figure 4 An example of surface display mode with shading according to heights.
An example of surface display mode with shading according to fictive light source Figure 5 An example of surface display mode with shading according to fictive light source.
An example of surface display mode with combined shading algorithms (given in Fig. 4 and Fig. 5) Figure 6 An example of surface display mode with combined shading algorithms (given in Fig. 4 and Fig. 5).
All display parameters can be changed according to the needs of the experimenters. Informative way of the display is rectangular view with contour shading (positron annihilation spectrum) shown in Fig. 8. One can define Regions Of Interests (ROIs) in the spectrum. Every ROI has its own display parameters independent of the main spectrum and other ROIs. In Fig. 9, one can see two ROIs in the two-dimensional -ray spectrum displayed in different display modes and color shadings. Similarly, one can display also the peaks in the spectrum found in the process of peak identification (Fig. 10). There are many other display combinations possible. Their presentation however, goes beyond the scope of this work.

Three-dimensional spectra
Analogously to the previous section three-parameter γ-ray coincidence nuclear spectrum is threedimensional scalar field with three independent parameters x, y, z (particle energies) and one dependent variable -counts c = f(x, y, z). As with two-parameter scalar fields one can idealize the display of three-parameter scalar field using discrete symbols at specific locations in space, or use techniques that show the variations in the three-parameter space. Hence each channel is defined by three parameters -coordinates x, y, z in original space, which determine the position of a channel. First let us consider a model where the channel is shown as a sphere (other marks as square, triangle, star etc. also can be used) with the size proportional to the event counts it contains. Then the position of the channel x, y, z on the screen is Two-dimensional γ-X-ray spectrum with two ROIs

Figure 9
Two-dimensional γ-X-ray spectrum with two ROIs.
where t xx , t xy , t xz , t yx , t yy , t yz , v x , v y , v z , are display transform coefficients reflecting translations in both original three-dimensional scalar field (in x, y, z dimensions as well as in counts) and in the position on screen, scaling, rotation around axes x, y, z and where n x , n y , n z are numbers of nodes of regular grid. The model proposed in such a way allows: • to choose and display any part of three-dimensional array -x min , x max , y min , y max , z min , z max • to choose any range of displayed counts -c min , c max Two-dimensional γ-γ-coincidence spectrum with displayed peaks
• to place the picture anywhere on the screen • to rotate the spectrum around the axes x, y, z • to change the density of display nodes.
The particle gradient display modes where the channels are shown as spheres with either diameter or color proportional to their contents are shown in Fig. 11 and Fig. 12, respectively. From the figures, one can localize interesting parts (peaks) in the spectrum. Sometimes however, to identify these parts, it is preferable to display only a slice in the spectrum, to move with it and interactively find appropriate channels. One-and two-dimensional slice in three-dimensional spectrum is shown in Fig. 13 and 14, respectively.
One can use even more sophisticated surface display mode. The defined surface separates the events with higher counts (statistics) from those with lower counts. Moreover, to achieve smooth surface one can interpolate the three-dimensional space using B-spline technique. In Fig. 15 and Fig. 16, we see the three-dimensional γ-γ-γ -ray coincidence spectrum and positron annihilation spectrum, respectively.
Three-dimensional γ-γ-γ-ray coincidence spectrum with channels shown as spheres with diameters proportional to counts Figure 11 Three-dimensional γ-γ-γ-ray coincidence spectrum with channels shown as spheres with diameters proportional to counts.
One-dimensional slice in three-dimensional spectrum Figure 13 One-dimensional slice in three-dimensional spectrum.
Three-dimensional γ-γ-γ-ray coincidence spectrum with channels shown as spheres with colors proportional to counts Figure 12 Three-dimensional γ-γ-γ-ray coincidence spectrum with channels shown as spheres with colors proportional to counts.
Two-dimensional slice in three-dimensional spectrum Figure 14 Two-dimensional slice in three-dimensional spectrum.
Finally, there exists a possibility to display three-dimensional spectrum in volume rendering mode. From the color contours on the sides of cube, one can get an imagination about positions of interesting peaks in three-dimensional space. An example of such a display mode is given in Fig. 17. Again, one can employ interpolation of the three-dimensional space using B-splines of various degrees.

Four-dimensional spectra
Now the counts is a function of four parameters (particle energies), i.e., c = f(x, y, z, v). Let us imagine that instead of one channel belonging to one point of 3-D space in three-parameter nuclear spectrum visualization now this point represents a slice in the fourth parameter, i.e., We depict each slice as a closed polygon with the center positioned in analogy with threedimensional data at the location For the positions of vertices of the polygon i, j, k on screen we have Three-dimensional positron annihilation spectrum shown in smoothed surface display mode Figure 16 Three-dimensional positron annihilation spectrum shown in smoothed surface display mode.
where the fourth parameter v ∈ <v min , v max >, r max (constant value) is maximum distance of a polygon vertex from its center, φ 0 is starting angle of the display of the first vertex of the polygon and c min , c max determine the range of displayed counts. The principle of 4D display is illustrated in Fig.   18.
In Fig. 19 we show four-dimensional display of the synthetic Gaussian with the center at x = y = z = v = 8. Three parameters determine the position of the center of the slice. The channels of the slice are shown as bars (drawn in red color) starting in the center of the slice with lengths proportional to their contents. The channels are displayed starting from 9 o'clock position in clockwise direction. The example of a chunk (16 × 16 × 16 × 16 channels) of smoothed experimental γ-γ-γ-γ-ray spectrum through the use of this display algorithm is shown in Fig. 20.
Analogously to 2 and 3D data to find interesting parts of the spectra one can display slices of various dimensionality. In Fig. 21 we present 3D slices with fixed y and z variables, respectively. Changing the values of y and z one can move with the slices. Subsequently in Fig. 22 we give an example of three two-dimensional slices in four-dimensional spectrum with fixed xy, xz and yz Three-dimensional γ-γ-γ-ray coincidence spectrum shown in volume rendering mode
variables. In Fig. 23 we illustrate similar situation when we fix the forth variable. We show the two-dimensional slice with fixed zv variables. Finally in Fig. 24 we introduce the display of three one-dimensional slices with fixed xyv, xzv and yzv variables, respectively.
To illustrate the display of ridges in four-dimensional space we show the examples of synthetic spectrum before and after background elimination in Fig. 25 and Fig. 26, respectively.
Display of four-dimensional synthetic Gaussian Figure 19 Display of four-dimensional synthetic Gaussian.
Principle of 4D display Figure 18 Principle of 4D display.
Smoothed experimental four-parameter spectrum Figure 20 Smoothed experimental four-parameter spectrum.
Two three-dimensional slices in four-dimensional spectrum Figure 21 Two three-dimensional slices in four-dimensional spectrum.
Three two-dimensional slices in four-dimensional spectrum with fixed xy, xz, yz variables Figure 22 Three two-dimensional slices in four-dimensional spectrum with fixed xy, xz, yz variables.
Two-dimensional slice in four-dimensional spectrum with fixed zv variables Figure 23 Two-dimensional slice in four-dimensional spectrum with fixed zv variables.
Three one-dimensional slices in four-dimensional spectrum with fixed xyv, xzv, yzv variables Figure 24 Three one-dimensional slices in four-dimensional spectrum with fixed xyv, xzv, yzv variables.
Synthetic four-dimensional spectrum before background elimination Figure 25 Synthetic four-dimensional spectrum before background elimination.
In Fig. 27, we present four-fold coincidence positron annihilation spectrum with interpolated channels.
In pies display mode one can change the color (level of shading) while keeping the radius of circle constant. According to the resolution in the fourth independent variable the circle is divided to channels (pies) with colors proportional to the contents of channels. The size of the circle is proportional to the sum of counts in the fourth dimension An example of synthetic 4D spectrum in pies display mode is shown in Fig. 28. Fig. 29 we present four-dimensional spectrum in isosurface mode. Analogously to three-dimensional data, the surface separates the channels with higher counts from those with lower counts. In this case, however, the color of the surface is defined by the position of the first occurrence of the channel with the same or higher value than the defined boundary value.

Technique of successive projections of embedded subspaces
The dimensionality of above-presented visualization techniques is limited to four. However, with increasing dimensionality of nuclear spectra the requirements in developing of multidimensional scalar visualization techniques becomes striking. In principle, the above-mentioned algorithms can be used even for higher dimensions by employing a new technique of embedded Four-dimensional synthetic spectrum displayed in pies display mode Figure 28 Four-dimensional synthetic spectrum displayed in pies display mode.
subspaces. Using this technique we divide the multidimensional space into outer subspace and one or more successive inner (embedded) subspaces, all of dimensionalities more convenient to human imagination.
The goal is to propose a technique that allows one to localize and scan interesting parts (peaks) in multidimensional spectra. Moreover it should permit to find correlations in the data, mainly among neighboring points, and thus to discover prevailing trends around multidimensional peaks.
The proposed technique makes benefit of specific character and features of nuclear spectra. It utilizes the fact that the interesting objects (peaks) have shape of quasi Gaussians. Further, in enormous multidimensional space the events are distributed very sparsely, which allows to preserve main features of data even after reducing the dimensionality by employing projection functional. Successive decreasing the dimensionality makes it possible to determine the positions of appropriate multidimensional peaks.
Without loss of generality, we shall assume the reduction of the space up to two-dimensional one. Other alternatives are also possible, but the display of two-dimensional array using perpendicular view allows utilizing screen area the most efficiently. Let us start with three-dimensional spectrum f(x, y, z). Let us apply a projection functional reducing dimensionality by one to twodimensional array, e.g.
Four-dimensional spectrum shown in isosurface display mode Figure 29 Four-dimensional spectrum shown in isosurface display mode.
(page number not for citation purposes) In place of the functional one can use, e.g. sum of channels contents in a slice or maximum in a slice where z ∈ <z min , z max > or any other suitable operation. Let us display each channel i, j in the form of a mark with size proportional to f (1) (i, j). Again, because of the most efficient way of utilizing the screen, in place of the mark we choose a rectangle. The rectangle represents a "window" into the subspace. Inside of the rectangle, we can display the slice f(i, j, z), z ∈ <z min , z max >. From the distribution of rectangles, one can find out the positions of interesting peaks, then focus the view to an appropriate region or to zoom a slice to full screen size, respectively.
Let us proceed to four-dimensional data f(x 1 , x 2 , x 3 , x 4 ). In place of the functional, we shall use the sums of channels in appropriate two-dimensional regions Then inside of each rectangle belonging to the channel i 1 , i 2 we display two-dimensional slice f(i 1 , i 2 , x 3 , x 4 ), using any of the two-dimensional above presented graphical models.
In the case of five-dimensional spectrum, we can apply one-, or two-step reduction of dimensionality, i.e., either  emphasize that the given algorithm of embedded subspaces presents one of the possible approaches to cope with the problem of visualization of multidimensional nuclear spectra. In principle one can change dimensionality of subspaces at every level of merging, rotate subspaces, define other projection functional etc.

Three-dimensional spectra
Using the technique of embedded subspaces we can divide three-dimensional space to outer twodimensional subspace and inner one-dimensional subspaces (slices in the third variable). An example of the projection of synthetic three-dimensional Gaussian and two ridges to two-dimensional outer subspace is given in Fig. 30.
The sizes of small rectangles are proportional to the contents inside of the slice in the appropriate channel of outer space. The display inside of rectangles is pointless because of poor resolution. Let us imagine that we are interested in the peak region denoted in Fig. 30 as "Region of interest". Let us focus the display to the ROI and enable the display inside rectangles (Fig. 31).
One can see simultaneously the distribution of the two-dimensional projection (yellow squares) together with one-dimensional slices. One can observe correlations among neighboring points inside of rectangles as well as correlation of corresponding points in the rectangles in both x and y directions.
Projection of three-dimensional synthetic spectrum to two-dimensional outer subspace Figure 30 Projection of three-dimensional synthetic spectrum to two-dimensional outer subspace. Let us illustrate an example of experimental three-dimensional spectrum. Again, outer subspace and zoomed ROI are given in Fig. 32 and Fig. 33, respectively.
If the experimenter is not interested in the distribution in outer subspace and wishes to see details in the rectangles the size can be set equal (Fig. 34). Then one can observe better the correlations among corresponding channels.
Analogously with the direct visualization technique now we can also display one and-twodimensional slices and thus to determine correlations among neighboring channels in different directions. In Fig. 35 we present spectrum in point display mode with equal sizes of rectangles together with one-dimensional slices for fixed xy (blue bars), xz (green bars) and yz (red bars) variables, respectively. In Fig. 36 we present two dimensional slices for fixed x (blue bars), y (green bars) and z (red bars) variables, respectively.

Four-dimensional spectra
Now the dimensionality of both outer and inner subspaces will be two. An example of a view focused on four-dimensional synthetic Gaussian is illustrated in Fig. 37. One can watch correlations in four dimensions, i.e., in two-dimensional subspace in each rectangle and among corresponding points in neighboring rectangles in both directions in outer subspace.  One-dimensional slices for fixed xy (blue bars), xz (green bars)and yz (red bars) variables Figure 35 One-dimensional slices for fixed xy (blue bars), xz (green bars)and yz (red bars) variables.

Figure 36
Two-dimensional slices for fixed x (blue bars), y (green bars) and z (red bars) variables.
Four-dimensional synthetic Gaussian (shown both, outer and inner subspaces) Figure 37 Four-dimensional synthetic Gaussian (shown both, outer and inner subspaces).
Let us proceed to experimental four-dimensional spectrum. In Fig. 38, one can see a projection of the four-dimensional rather noisy spectrum to outer subspace and in Fig. 39 zoomed ROI of it. From this view, one can observe basic tendencies in the spectrum. If desired, to see better the details, one can expand rectangles to equal size (Fig. 40).
Also for four-dimensional spectra displayed using the technique of embedded subspaces one can show one-, two-and three-dimensional slices. In Fig. 41 one can see four-dimensional spectrum shown in points display mode with equal sizes of rectangles together with four one-dimensional slices for fixed xyz, xyv, xzv and yzv variables, respectively. One can observe the correlations among neighboring channels in four directions.

Five-dimensional spectra
Five-dimensional space can be divided in two ways, i.e., either two-, plus three-dimensional subspaces or two-, plus two-, plus one-dimensional subspaces. Let us start with the first case. In Fig.   42 one can see outer subspace of five-fold γ-ray spectrum. One can observe high level of background due to relatively low statistics in the spectrum. Let us assume we are interested in the outlined ROI. Zoomed ROI with enabled display of inner three-dimensional subspaces is illustrated in Fig. 43. From the presented chunk of the five-dimensional space, mainly from the shown inner three-dimensional subspaces it is difficult to discover tendencies in the spectrum. It can be Projection (outer subspace) of four-dimensional experimental γ-γ-γ-ray coincidence spectrum

Figure 38
Projection (outer subspace) of four-dimensional experimental γ-γ-γ-ray coincidence spectrum.  Four-dimensional spectrum shown in points display mode together with four one-dimensional slices for fixed xyz, xyv, xzv and yzv variables Figure 41 Four-dimensional spectrum shown in points display mode together with four one-dimensional slices for fixed xyz, xyv, xzv and yzv variables.
Outer subspace of five-fold γ-ray spectrum
improved, to some extent, by smoothing the data using B-splines and employing isosurface display technique shown in Fig. 44.
The alternative way is to proceed in the projections and to divide inner three-dimensional subspaces to two-plus one-dimensional ones. In Fig. 45 we show outer and the first level inner subspaces (display of the second level inner subspaces was disabled). While yellow rectangles represent outer subspace, the light blue ones represent the first level inner subspaces. If we enable the display of the second level subspaces, we can see all three levels simultaneously (Fig. 46). One may focus attention to the channel x = 10, y = 10, where the volume of data is the biggest (yellow rectangle here is the largest, Fig. 47). Now one can see in detail the slices in the second level inner subspaces. Employing this technique one can scan multidimensional nuclear spectra. Moving from the outer subspace to inner ones and back gives possibility to discover interesting parts in such a spectrum.
Let us denote the fifth independent variable as w. Analogously to three-and four-dimensional data in Fig. 48 we show five-dimensional spectrum shown in points display mode with equal sizes of rectangles together with five one-dimensional slices for fixed xyzv, xyzw, xyvw, xzvw and yzvw variables, respectively. One can observe the correlations among neighboring channels in five directions.
Zoomed ROI of the data from Fig. 42 with displayed three-dimensional inner subspaces Figure 43 Zoomed ROI of the data from Fig. 42 with displayed three-dimensional inner subspaces.
Zoomed ROI of the data from Fig. 42 with inner subspaces displayed in isosurface display mode with B-spline smoothing Figure 44 Zoomed ROI of the data from Fig. 42 with inner subspaces displayed in isosurface display mode with B-spline smoothing.
Zoomed ROI with shown outer and the first level inner subspaces Figure 45 Zoomed ROI with shown outer and the first level inner subspaces.
Zoomed ROI with shown outer, the first level and the second level inner subspaces Figure 46 Zoomed ROI with shown outer, the first level and the second level inner subspaces.
One channel of the outer subspace zoomed Figure 47 One channel of the outer subspace zoomed.

Conclusion
In the paper we have presented conventional as well as new developed visualization algorithms of nuclear spectra. For 3D spectra we have proposed particle gradient display technique and isosurface display technique. Raw data can be interpolated using B-spline algorithms up to 4-th degree. For 4D spectra we have designed the algorithms based on slicing in fourth dimension, pies display mode as well as isovolume display mode. Furthermore, we have derived new technique of visualization of multidimensional spectra based on projections of embedded subspaces. This allows one, in interactive way, to localize interesting parts in the data of this kind, to find correlations among neighboring points and to discover trends in multidimensional data.
The visualization algorithms presented have been implemented in the data acquisition, processing and visualization system DaqProVis which is being developed at Institute of Physics, Slovak Academy of Sciences [9]. The algorithms for the display of 2D spectra have also been implemented in ROOT system in TSpectrum2Painter class (SPECTRUMPAINTER directory) [10]. In near future we plan to implement in ROOT also the visualization algorithms for 3D spectra.

Acknowledgements
The work is supported by the Grant Agency of Slovak Republic through contract GAV 2/7117/27. Five-dimensional spectrum shown in points display mode together with five one-dimensional slices for fixed xyzv, xyzw, xyvw, xzvw and yzvw variables Figure 48 Five-dimensional spectrum shown in points display mode together with five one-dimensional slices for fixed xyzv, xyzw, xyvw, xzvw and yzvw variables.