Introduction
Nowadays, many techniques in computer graphics are used in Visualization of scientific Computing. There are two factors that stimulate the fast-growing researches of this application area in computer graphics. First, the size of data, usually multivariate, produced by scientific computing models tends to be so large that conventional visualization methods are no longer adequate. The second factor is the existence of workstations with high-resolution color, which enables subtle changes in complex data sets to be visualized; the ability to render three-dimensional objects and data sets; and the ability to represent four-dimensional data, by using color in three-space or by animating three-space.
Volume visualization is one of the most interesting and fast-growing fields in scientific visualization. It is a process of projecting multi-dimensional data set onto a two-dimensional image plane to serve the purpose of gaining an understanding of the internal structure and topology contained within the volumetric data. One major application area in this field is medical imaging, where volume data is available from Computer Tomography (CT) scanners, and Magnetic Resonance (MR) scanner.
The fundamental volume visualization algorithms fall into one of the following categories, interactive methods, direct volume rendering (DVR) methods, and surface-fitting (SF) methods. Interactive methods include wireframe contours [2], multi-planar reprojection ("slicing") [2], sweeping plane [2], additive reprojection [2], and maximum voxel [2].
DVR algorithms include approaches such as ray-casting [6, 7, 8, 14, 15], splatting [17], and V-buffer rendering [15]. DVR methods are characterized by mapping elements directly into screen aspect without using geometric primitives as an intermediate representation. It is especially appropriate for creating images from data sets containing amorphous features like clouds, fluids and gases. The disadvantage of using DVR methods is that the entire data set must be traversed each time an image is rendered.
SF methods includes contour-connecting [5], opaque cube[4], marching cubes[1, 10], marching tetrahedra [11] , dividing cubes[1], and others. SF algorithms (sometimes called iso-surfacing) fit surface primitives (usually planar), such as polygons or patches to constant-value contour surfaces in volumetric data sets. SF methods are typically faster than DVR methods since SR methods only traverse the volume once to extract surfaces. After extracting the surfaces, rendering hardware and rendering methods can be used to render the surface primitives quickly each time the use changes a viewing or lighting parameter. But, changing the SF threshold value is very time consuming because it required that all of the cells be revisited to extract the a new set of surfaces. There are problems in SF methods such as occasional false positive and negative surface pieces, and incorrect handling of small features and branches in the data. These artifacts could be incorrectly viewed by scientists as features in the data.
This project includes two parts: the first part of the project is to write a program, called data viewer, to view a three-dimensional spatial data file, find out the frequency of data in the data set, and display a rough image of data. The second part of the project is to implement dividing cubes algorithm. In dividing cubes algorithm, and other surface-fitting methods, a threshold value is needed to extract the iso-surfaces from the volume data. The data viewer can provide the information of the data ranges and frequencies in the volume data and graphically display the volume histogram and rough images for selecting the appropriate iso-values.
Data Viewer
To implement data viewer, first, the input data are read in and normalized. Then, the normalized data are viewed to find the distribution over the range of 0.0 and 1.0 with an increment of 0.1. A histogram will be drawn on the main window after screening. The user can select a specific range of data of interest, and a new histogram will be shown on the main window. One can also select Draw to plot the whole data set or selected data at any time to show the current data in histogram. Selecting Reset will clear the window, and reshow the current active data file, or choosing Close to close the active data file. To quit the program at any time by pressing the Exit button. The user interface part and the drawing of the two-histogram on the main window are done using Motif, and the rendering of the actual image is done using OpenGL. More detail about this application will be described later in this report.
Dividing Cubes Algorithm
Computed Tomography (CT) and magnetic resonance imaging (MR) scanner can be used to create a volume by imaging a series of cross sections. These techniques have found extensive use in medical studies. Unfortunately, it is difficult to see the three-dimensional structure of the interior of volumes by viewing interior slices. To effective visualize volumes, it is important to be able to image them from different viewpoint, and to shade then in a manner which brings out surfaces and subtle variations in density and opacity. There are many different methods have been developed to achieve this goal, dividing cube algorithm is one of them.
Dividing cubes algorithm [1, 9] is a volume rendering technique used in studying medical images. It is a variation of marching cubes algorithm, Cline, Lorensen and Ludke developed both in 1988[1, 9, 10]. It was developed to eliminate the scan conversion step of the polygonal display method, marching cube algorithm. And, It approximates the polygons with points.
Marching cube algorithm [1, 9, 10] is a table-based surface-fitting algorithm for rendering iso-surfaces in volumetric data. The basic idea is that we, first, define a cube by the eight data values from two consecutive slices. Second, we classify each vertex of the cube as to whether it lies inside or outside the surface. Outside, if the vertex value is less than the surface value that user specified; otherwise, inside. Third, from the result of classification, we build an index between 0 and 255 from the binary labeling of each vertex. For a given index, we access a table of cubes edges that contain a triangle vertex. We interpolate the triangle vertices, then calculate and interpolate normals. Finally, the triangles generated are passed to a rendering program that maps them into image space.
Marching cubes algorithms was originally developed to produce surfaces for rendering. But it sometimes connects the wrong sets of three points while generating triangles, this occurs on any cube face has adjacent vertices with different states, but diagonal vertices in same state. There are six ambiguous cases, which can result in holes. Also, Lorensen and Cline soon realized that the size of the generated triangles, when rendered and projected, is often smaller than the size of a pixel. Dividing cubes, then, was developed to take advantage of this observation and at the same time, it solves the ambiguity created by Marching cubes algorithm.
Motif
Data viewer is designed to run under Motif graphical user interface (GUI). Motif GUI was developed by the Open Software Foundation (OSF), a non-profit organization of companies such as Hewlett-Packard, Digital, IBM, and dozens of other companies. It is a proposed standard for graphical user interface, and may be implemented on a wide range of computer platforms, from large IBM mainframes to the PC that used at home. Motif is a set of guidelines that specifies how a user interface for graphical computers should look and feel. The user can interacts with the application by typing at the keyboard and by clicking, selecting, and dragging various graphic elements of the application with the mouse. The window can be made larger or smaller by pressing a mouse button on any of the resize corners and dragging [3,18]. The use of Motif GUI in the application makes data viewer user-friendly.
OpenGL
The actual rendering of the images in both parts of the project is done using OpenGL. The OpenGL graphics system is a software interface to graphics hardware. The GL stands for Graphics Library. It allows user to create interactive programs that produce color images of moving three-dimensional objects, although the moving part is not applied in my project. OpenGL is designed as a hardware-independent interface to be implemented on many different hardware platforms. It doesnt include commands for performing windowing tasks or obtaining user input; instead, one must work through whatever windowing system controls the particular hardware one is using, that is the reason why Motif GUI is used here. Also, OpenGL doesnt provide high-level commands for describing models of three-dimensional objects, such as cars and airplanes. It only provides a small set of geometric primitives, such as points, lines, and polygons; one must use these geometric primitives to build up ones desired model [16].