SculptDemo Source Documentation
- Vaidya Chandrasekhar, email@example.com
This demonstration code illustrates some of the coding mechanisms used for integrating the CAVELib and GHOST libraries for use on the Personal Augmented Reality Immersive System (PARIS). The application creates a ball object represented simultaneously in Open Inventor and GHOST scene graphs. Changes in one scene graph must be reflected in the other. Management of these changes is the key component of creating a believable interface within the virtual environment. A smaller ball represents the PHANToM position within the environment. The aim of this research work is to develop a method to create implants for cranial defects. Since the last report work was done in finalizing the pipeline involved in the implant generation as shown in figure 1 and integrating the two steps in implant generation process viz. 3D registration and virtual sculpting. Also a sample skull model was used to test the implant generation pipeline. A brief description of the two steps involved in implant generation is given below and the pipeline is explained below in a block diagram.
- May 2003
The skull has a defect in the right half as shown in figure 2 with a red outline, and the process of 3D registration and virtual sculpting produces and implant for that defect. The left half of the skull is registered with the right half of the skull as shown in the figure 2 using AIR (Automated Image Registration) and Analyze. In the second step the defect area is cleared, to get an implant that fills in the whole defect area. This step was done using Visualization toolkit (VTK). In the third step the volume subtraction is done so as to get the subtracted volume. This volume is then thresholded to obtain the approximate implant.
Execution view of SculptDemo
This is then converted into a binary volume and stored in a multi-resolution octree data structure, so that it can be sculpted. The next step uses the cranium editor application to generate the defect. This is done so that the defect can be embedded as a haptic cue during the virtual sculpting process. The sculpting process was done interactively in the PARIS™ using the PHANToM™ as a force feedback input device . Some of the operations that were supported were object manipulation, sculpting and addition. The output of this sculpting operation is a multi-resolution data structure consisting of cubes in open inventor format. This was then converted to the stereo lithography format (STL), for use in rapid prototyping machines, using VTK. The steps involved in the virtual sculpting process are shown in figure 3.
The configuration of the environment is handled through the use of CMake. With the ability to locate separate libraries and paths, CMake makes it very easy to move a project between different platforms. It will generate Makefiles for unix systems and Visual Studio workspaces on Windows. The use of CMake may appear as an extra step, but it provides the flexibility for easily moving between platforms.
CMake can build a project in a different directory than the source code. This capability is useful for keeping source and object files separate. I usually create a 'build' directory within the source code and set CMake to build the project there.
CMake reads the file CMakeLists.txt in the source directory, and that file is used to configure and build the project. This file contains a list of the files and libraries that CMake must find. CMake ships with several modules for finding libraries, but none of them support the libraries used in this project. For this reason, I have written several very simple modules to handle locating required libraries:
These modules will locate the include paths as well as the binary library files. If any are not found, CMake provides a GUI that may be used to manually locate or change the settings. This ability is especially useful with the Inventor module, as a system may have both TGS Inventor and Coin3D installed. The GUI may be used to locate the appropriate library to use.
Running CMakeSetup.exe (Windows) or cmake (unix) will present a GUI. The available settings are displayed, although additional options are available by toggling the Advanced checkbox. Pressing the Configure button will execute the configuration to locate all relevant settings. Once configuration is complete, press Ok to generate the Visual Studio workspace file.
The Visual Studio files (or Makefiles) will be placed in the build directory specified by the user. The .dsw file can be opened to work with the project. CMake creates a BUILD_ALL project that fill the role of the Batch Build command within Visual Studio. It's more convenient than checking multiple project check boxes. To make debugging easier, select SculptDemo and choose 'Set Active Project.'
When it comes time to add files to the project, the proper and portable approach is to create new entries in the CMakeLists.txt file and regenerate the Visual Studio project. Taking these extra steps will make certain that the build process remains portable across multiple system configurations.
The Document is available here.
The source code is available as a zipped archive. The archive contains all the files but without the CVS directories. Everything should build properly, but contact me if something goes wrong.
Generated on Wed May 18 01:24:58 2005 for SculptDemo by