3-D Data Visualization on Mac OS Xby Michael J. Norton
I like knowing that my little 450MHz G4-powered Internet browser is also capable of computational fluid dynamics. My grassroots are in computational physics. I learned the craft of programming for the sole purpose of designing incredulous space engines that would take mankind to the farthest reaches of the stars.
That was a great idea years ago in college, but I soon discovered my vision was not keenly embraced by real-world employers. Don't get me wrong; I never gave up on my vision--I just got older and hopefully wiser. I still wanted to investigate the possibilities of computational physics and space travel. Yet, at the same time I wanted to be lazy and script it in Tcl--and on my Mac. My searches to the ends of the Internet revealed a remarkable package called the Visualization Toolkit, or VTK, which satisfied all my criteria.
Users and developers of the VTK make a distinction between computer graphics and visualization. Visualization is the process of transforming and mapping data into graphic primitives. The computer-graphics end handles rendering and displaying. An example of visualization would be the scanning of points on a human skull and entering these data points into a computer. The visualization is shown in Figure 1.
The image in Figure 1 was in fact generated by VTK. So, what is VTK used for? There is a wide range of applications for which VTK is being implemented. Medical imaging is one place you'll find this tool being put to extensive use. Data points collected from an MRI scan can be transformed into a visual image using VTK. Weather-map visualization is another place you'll find VTK at work. Researchers are evening applying the VTK to virtual reality test beds. Engineers are using VTK to extract components from CAD drawings to produce visualizations of their products. The VTK is an extensive and continuously growing, feature-rich software tool for data visualization.
Now, I think I have your attention. The next question you may be asking is how do I get this software up and running on my Mac OS X supercomputer? Well, I thought you'd never ask.
The CMake Utility
The Visualization Toolkit has the flexibility to support cross-platform environments such as Unix and Windows. The software is open source and can operate in multiple development environments, both compiled and interpreted. Each build platform has its own dependencies and directory hierarchies. The solution to these complexities is the CMake utility. Downloading the latest CMake from CVS for Unix, you can configure CMake to run on SGI platforms, Solaris, Linux, and FreeBSD.
The Mac OS X kernel, Darwin, is a Mach kernel based on FreeBSD. CMake can be configured to install software for both Mac OS X, using Carbon-based calls or Darwin using XFree86. Under the Mac OS X umbrella, C++ (compiled), Python (interpreted), and Tcl (interpreted) are supported.
Retrieving CMake from CVS
The CMake utility is available from www.cmake.org. Download the latest src tree from CVS. You can do this from your Mac OS X terminal application. If you're a GNU Emacs for Aqua user then you should use the emacs shell (option-x shell). The emacs shell isn't a necessary step for installation but it sure makes life easier when you have to scroll back through the make logs to locate errors in the build process. I installed the CMake utility in my root directory.
From your shell, type the following to retrieve the latest source for CMake:
cvs -d :pserver:email@example.com:/cvsroot/CMake login
The password is
cmake. That will log you into the CVS. Now you'll need to check out the source tree:
cvs -d :pserver:firstname.lastname@example.org:/cvsroot/CMake co CMake
Once you've completed the CVS source tree update you're ready to install the CMake utility.
Installing the CMake Utility
There are three simple steps for installing CMake. First, from your Unix shell run the configure utility. You will need to move into the CMake directory.
cd /CMake ./configure
You'll see a lot of "checking and creating" messages scroll by as the configure utility sets up the environment and Makefiles. Once the configure utility completes, you need to run the make utility. The make utility must be run from the
After invoking the make utility, you will see messages regarding the compilation steps. Once this completes successfully you'll need to run "make install" as a privileged user. The easiest way to do this is to use the
sudo command. You will be prompted for the superuser password.
sudo make install password:
When the make install completes with no errors, the CMake utility installation will be completed. The next objective is to install the VTK software. VTK relies on CMake, which is why you had to install it first.