0% found this document useful (0 votes)
71 views

Visualizing With VTK: A Tutorial: IEEE Computer Graphics and Applications September 2000

Uploaded by

Ernest Bakouta
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
71 views

Visualizing With VTK: A Tutorial: IEEE Computer Graphics and Applications September 2000

Uploaded by

Ernest Bakouta
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/220518491

Visualizing with VTK: A tutorial

Article  in  IEEE Computer Graphics and Applications · September 2000


DOI: 10.1109/38.865875 · Source: DBLP

CITATIONS READS

156 2,307

3 authors, including:

William J. Schroeder Lisa Avila


Kitware, Inc. Kitware, Inc.
69 PUBLICATIONS   6,865 CITATIONS    35 PUBLICATIONS   1,073 CITATIONS   

SEE PROFILE SEE PROFILE

Some of the authors of this publication are also working on these related projects:

Visualization Toolkit VTK View project

Insight Toolkit (ITK) View project

All content following this page was uploaded by Lisa Avila on 03 July 2014.

The user has requested enhancement of the downloaded file.


Tutorial

Open Source Breakout


A model of software development called open source is gaining
acceptance in the software world. Although the exact definition of
open source remains debatable, the basic premise is that the
source code is freely available to anyone who wants it. This differs
greatly from commercial software, freeware, and shareware, all of
which are normally distributed in a binary format only. The
availability of source code to a wide audience creates many

Visualizing with 1 VTK can be used in diverse areas including medical


visualization (left) and industrial inspection applica-
tions (right).
opportunities and advantages in the software development
process. Recently, several high-profile projects have brought this
model to the attention of the media and general public. Those
William J. Schroeder, Lisa S. Avila, projects include the Linux operating system, the Apache Web

VTK: A Tutorial and William Hoffman


Kitware Interpreted layer
While the compiled core provides speed and efficien-
server (running 50 percent of the World Wide Web), and sendmail
(the backbone for much of the e-mail sent today). Although people
have shared source code since the beginning of computers, new
cy, the interpreted layer offers flexibility and extensi- business models, software development tools, and the Internet
bility. For example, using GUI prototyping tools such as have allowed the practice to expand greatly in the past five years.

I n this tutorial we introduce basic concepts


behind the Visualization Toolkit (VTK). An
overview of the system, plus some detailed examples,
selaer Polytechnic Institute, State University of New York
at Stony Brook, the Ohio State University, Stanford, and
Brigham and Women’s Hospital use VTK to teach cours-
Tcl/Tk, Python/Tk, or Java AWT permits building pro-
fessional applications rapidly. These popular program-
ming languages come with other packages such as
Open-source software has many benefits. Eric Raymond in The
Cathedral and the Bazaar: Musings on Linux and Open Source by an
Accidental Revolutionary (O’Reilly Publishers) argues that open-
will assist you in learning this system. The tutorial tar- es and as a research tool. National labs such as Los Alam- Python’s numerical library NumPy. source software development (the bazaar model) is inherently
gets researchers of any discipline who have 2D or 3D os are adapting VTK to large-scale parallel processing. We used Tcl in the examples in this article. You can type more scalable than closed-team development (the cathedral
data and want more control over the visualization Commercial firms are building proprietary applications in the example code included here and immediately see model). With more eyes looking at source code, bugs can be
process than a turn-key system can provide. It also on top of the open-source foundation, including med- the results. Follow the instructions found at http://www. discovered and fixed faster. In addition, new developers join the
assists developers who would like to incorporate VTK ical visualization, volume visualization, oil exploration, visualizationtoolkit.org/CGA/Instructions.htm to install development team at no extra cost. This has created more reliable
into an application as a visualization or data process- acoustics, fluid mechanics, finite element analysis, and VTK and start a Tcl shell with VTK support. and portable software with faster development cycles than many
ing engine. Although this tutorial can only provide an surface reconstruction from laser-digitized, unorga- closed commercial offerings. With many developers in diverse
introduction to this extensive toolkit, we’ve provided nized point-clouds. The graphics model geographical areas, testing becomes even more important.
references to additional material. VTK began in December 1993 as companion software VTK has two major subsystems—the graphics model In the past 10 years business models have emerged to support
to the text The Visualization Toolkit: An Object-Oriented and visualization pipeline. The graphics model forms an open-source development. It may seem impossible for a company
What is VTK? Approach to 3D Graphics by Will Schroeder, Ken Martin, abstract layer above the graphics language (for example, to survive by giving away software. However, companies can thrive
VTK1 is an open-source (see the sidebar “Open and Bill Lorensen (Prentice Hall). In 1998 the second OpenGL) to insure cross-platform portability. When the around an open-source project. Some common ways of generating
Source Breakout”), portable (WinTel/Unix), object-ori- edition of the text appeared, with additional authors development of VTK began in 1993, each computer plat- revenue include consulting, training, adding features, selling
ented software system for 3D computer graphics, visu- Lisa Avila, Rick Avila, and Charles Law. Since that time form had its own graphics language—XGL for Sun, Star- technical support, building proprietary end-user applications on
alization, and image processing. Implemented in C++, a sizable community has grown up around the software, base for Hewlett-Packard, and gl for Silicon Graphics. top of open-source libraries, and selling development tools.
VTK also supports Tcl, Python, and Java language bind- including dozens of others as developers, often submit- Abstracting graphics concepts into a platform and device-
ings, permitting complex applications, rapid applica- ting bug fixes or full-blown class implementations. independent layer created the graphics model. Since that
tion prototyping, and simple scripts. Although VTK These community efforts have helped the software time the industry has standardized on OpenGL. Although tiates to create a scene. You’ll find that the model used
doesn’t provide any user interface components, it can be evolve. For example, David Gobbi in the Imaging this is now the only low-level graphics language sup- for 3D polygonal rendering (lights, cameras, actors) is
integrated with existing widget sets such as Tk or Research Laboratories at the John P. Robarts Research ported in VTK, the abstract layer has not been abandoned. analogous to the model used for volume and other types
X/Motif. Institute, University of Western Ontario, has reworked In the future, new graphics languages are likely to become of rendering (lights, cameras, volumes). In the follow-
VTK provides a variety of data representations includ- VTK’s transformation classes and is now an active popular and even replace OpenGL as a standard. Keep- ing sections we’ll walk through a simple example
ing unorganized point sets, polygonal data, images, vol- developer. ing this abstract layer lets us update VTK with new tech- demonstrating these classes for surface polygonal and
umes, and structured, rectilinear, and unstructured nology without affecting backwards compatibility. volume rendering. You may wish to type these com-
grids. VTK comes with readers/importers and writ- Architecture We adapted the names of the classes in the graphics mands into a properly installed Tcl interpreter as
ers/exporters to exchange data with other applications. VTK consists of two major pieces: a compiled core model from the movie-making industry. Lights, cam- described in the previous section. Figure 2 shows the
Hundreds of data processing filters are available to oper- (implemented in C++) and an automatically generated eras, actors, and props are classes that the user instan- resulting image from this example.
ate on these data, ranging from image convolution to interpreted layer. The interpreted layer currently sup-
Delaunay triangulation. VTK’s rendering model sup- ports Tcl, Java, and Python.
ports 2D, polygonal, volumetric, and texture-based
approaches that can be used in any combination. C++ core
VTK is one of several visualization systems available Data structures, algorithms, and time-critical system 2 Two renderers in a rendering window combine
today. AVS2 was one of the first commercial systems functions are implemented in the C++ core. Common surface, volume, and 2D rendering. The left renderer
available. IBM’s Data Explorer (DX),3 originally a com- design patterns such as object factories and virtual func- contains a simple cube; the right renderer contains a
mercial product, is now open source and known as tions insure portability and extensibility. Since VTK is polygonal isosurface and volume rendering of electron
OpenDX. NAG Explorer4 and Template Graphics Amira independent of any graphical user interface (GUI), it potential. The scalar bar indicates data range and its
(see http://www.tgs.com/Amira/index.html) are other doesn’t depend on the windowing system. Hooks into relationship to color.
well-known commercial systems. the window ID and event loop let developers plug VTK
VTK is a general-purpose system used in a variety of into their own applications. An abstract graphics model
applications, as seen in Figure 1. Because VTK is open (described in the next section) achieves graphics
source, faculty at many universities—including Rens- portability.

20 September/October 2000 0272-1716/00/$10.00 © 2000 IEEE IEEE Computer Graphics and Applications 21
Tutorial

Render window and renderers be used. Otherwise, vtkDataSetMapper must be used. vtkSLCReader negReader ren2 AddProp posActor
To visualize your data, you first need to open a win- The following fragment of Tcl code can be used to cre- negReader SetFileName “neghip.slc” renWin Render
dow on the computer screen. vtkRenderWindow is an ate a polygonal cube and place it in the scene. In this
abstract superclass representing the object into which code segment and others following, note that lines of vtkVolumeTextureMapper2D negMapper The combined VTK rendering process has a few lim-
one or more renderers draw. Like most graphics objects, code ending with a backslash (\) indicate a carryover negMapper SetInput \ itations. VTK doesn’t support translucency of geomet-
it automatically instantiates the correct device-depen- of code that didn’t fit onto one line. The indented line [negReader GetOutput] ric data because the primitives aren’t sorted into a
dent subclass for your platform. The vtkRenderWindow following belongs with the preceding line. Simply delete back-to-front ordering before rendering. Multiple vol-
is a container class for vtkRenderer objects, and multi- the \ and type in a single line of code. The hardest step in volume visualization is often umes can be rendered in the same scene only if the
ple renderers can be tiled within a single render win- defining the transfer functions that map the scalar data bounds of the volumes don’t overlap. Opaque geometry
dow to create complex visualizations. In this example vtkCubeSource cubeData values into color and opacity. In this example we’ll use can overlap volumes using the ray casting and texture
we’ll place two renderers with different background col- a simple ramp from 0.0 to 0.2 for opacity, with the color mapping approaches, but not if a vtkVolumeProMapper
ors side by side within the render window. The place- vtkPolyDataMapper cubeMapper function ranging through red, blue, and green. is used because of limitations with this hardware.
ment location is specified using normalized (0, 1) cubeMapper SetInput \
viewport coordinates in the render window: [cubeData GetOutput] vtkPiecewiseFunction negOpacity Rendering 2D data
negOpacity AddPoint 0 0.0 In addition to 3D geometric and volumetric data, VTK
vtkRenderWindow renWin vtkActor cubeActor negOpacity AddPoint 255 0.2 visualizes 2D data such as geometry, images, and text.
renWin SetSize 600 300 cubeActor SetMapper cubeMapper In the examples given here we’ll render 2D data into a
vtkColorTransferFunction negColor 3D renderer to intermix 2D and 3D data. Alternatively,
vtkRenderer ren1 ren1 AddProp cubeActor negColor AddRGBPoint 64 1.0 0.0 0.0 if we only have 2D data, we can use an image viewer for
ren1 SetViewport 0.0 0.0 0.5 1.0 ren1 ResetCamera negColor AddRGBPoint 128 0.0 0.0 1.0 visualization.
ren1 SetBackground 0.8 0.4 0.2 renWin Render negColor AddRGBPoint 196 0.0 1.0 0.0 The concept of actors, mappers, and properties
renWin AddRenderer ren1 applies to both 2D and 3D data, although some of the
Since the output of the vtkCubeSource object is polyg- The first value defined when adding a point into a specific parameters change. In the code fragment below,
vtkRenderer ren2 onal data, an instance of vtkPolyDataMapper renders transfer function is always the scalar value, with one we add annotation to the renderer that displays the
ren2 SetViewport 0.5 0.0 1.0 1.0 the data. The ResetCamera() method centers the cam- value following it for a vtkPiecewiseFunction or an RGB cube. A vtkActor2D represents the title in the scene, a
ren2 SetBackground 0.1 0.2 0.4 era on the data. triple following it for a vtkColorTransferFunction. Since vtkTextMapper holds and renders the data (which in
renWin AddRenderer ren2 The following fragment of Tcl code rotates the cube we’re visualizing 8-bit data, the scalar values in this this case is a string), and the vtkActor2D automatically
and changes the color to pink: example range from 0 to 255. creates a vtkProperty2D. Note, here and in code seg-
renWin Render Now that we’ve defined the two required transfer ments following, some long individual code words
cubeActor RotateX 30.0 functions, we can create the volume property and the include hyphens because they didn’t fit onto one line. A
The vtkRenderWindow object manages the render cubeActor RotateY 20.0 volume. hyphen, like a \, also indicates a carryover, but of a sin-
process, so a single Render() call will cause the window [cubeActor GetProperty] \ gle word. When typing in the code, delete the hyphens
to map onto the screen and the renderers to update their SetColor 1.0 0.7 0.7 vtkVolumeProperty negProperty to recreate a single word.
display. At this point in the example only solid back- negProperty SetColor negColor
ground color will appear because we haven’t defined renWin Render negProperty SetScalarOpacity \ vtkTextMapper titleMapper
any props. negOpacity titleMapper SetInput \
Use the GetProperty() method of the actor to access “This is a Pink Cube”
Props, mappers, and properties the automatically created property object. vtkVolume negVolume titleMapper \
Props are the objects added to the renderer to create negVolume SetMapper negMapper SetJustificationToCentered
a scene. The class vtkProp is an abstract superclass for all Rendering 3D volumetric data negVolume SetProperty negProperty
2D and 3D props and contains information about visi- The vtkImageData object can be used to represent vtkActor2D titleActor
bility, orientation, size, and position. Props associate one-, two-, and three-dimensional image data. As a sub- ren2 AddProp negVolume titleActor SetMapper titleMapper
with a mapper and a property object. The mapper refers class of vtkDataSet, vtkImageData can be represented ren2 ResetCamera [titleActor GetProperty] \
to an input data object (described in the section on the by a vtkActor and rendered with a vtkDataSetMapper. In renWin Render SetColor 1 1 0
visualization pipeline), and it knows how to render the 3D this data can be considered a volume. Alternatively, set pc [titleActor \
data object. The property object contains rendering it can be represented by a vtkVolume and rendered with Intermixing geometry and volumes GetPositionCoordinate]
parameters such as color and material properties. In the a subclass of vtkVolumeMapper. Since some subclasses The VTK rendering process can combine multiple $pc SetCoordinateSystemToNormalized-
next three sections we’ll cover some concrete subclass- of vtkVolumeMapper use geometric techniques to ren- actors and volumes in the same scene. In the following Viewport
es for props, mappers, and properties that can be used der the volume data, the distinction between volumes example, a polygonal surface is displayed intermixed $pc SetValue 0.5 0.92
for rendering 3D surface geometric data, 3D volumet- and actors mostly arises from the different terminology with the volume.
ric data, and 2D geometry, text, and images. and parameters used in volumetric rendering as ren1 AddProp titleActor
opposed to the underlying rendering method. vtkPolyDataReader posReader renWin Render
Rendering 3D geometric data VTK currently supports three types of volume ren- posReader SetFileName \
One specific subclass of vtkProp that can be used to dering—ray tracing, 2D texture mapping, and a method “poshipsurface.vtk” The code required to change the color of the text
represent 3D geometric data in a scene is vtkActor. The that uses the VolumePro graphics board.5 Although the resembles the code used to change the cube’s color.
actor object will automatically create a default vtkProp- example in this section uses the 2D texture mapping vtkPolyDataMapper posMapper However, 3D actors are positioned using world coordi-
erty object, but requires the user to specify a subclass of approach, you could change it to use an alternative posMapper SetInput \ nates, whereas we chose to position this 2D actor in a
vtkMapper. Depending on the nature of the geometry method with only minor modifications. [posReader GetOutput] normalized viewport coordinate system.
referred to by the mapper, either the subclasses vtk- To begin our volume-rendering example, we’ll load a Since 2D data is often used for annotation, VTK offers
DataSetMapper or vtkPolyDataMapper must be used. If 3D structured data set of unsigned char values and use vtkActor posActor several objects that combine multiple 2D actors and
the data contains points, lines, and polygons represent- this as input for the volume mapper vtkVolumeTex- posActor SetMapper posMapper mappers into one 2D actor. For example, the vtkScalar-
ed using a vtkPolyData, then a vtkPolyDataMapper can tureMapper2D. BarActor object combines text and 2D polygons to

22 September/October 2000 IEEE Computer Graphics and Applications 23


Tutorial

access to data, and process objects (or filters) operate


vtkLight light on data objects. These networks can be elaborate and
light SetFocalPoint 0.0 0.0 0.0 may include branches and loops. In implementation, 4 Some of
light SetPosition 1.0 0.0 0.0 the connections are made by using the SetInput()/ VTK’s data
light SetColor 0.0 1.0 0.0 GetOutput() methods (as follows in Tcl): objects:
light SetIntensity 0.5 Images/volume Linear primitives images/volume
aFilter SetInput [bFilter \ (vtkStructuredPoints) (vtkPolyData) (top left), linear
ren2 AddLight light GetOutput] primitives (top
renWin Render right), struc-
Note that data objects are typically not explicitly cre- tured data
3 A VTK visualization network. Process objects (filters) appear as red Clearly, we’d prefer to use mouse events to control the ated. Filters instantiate an internal data object consis- (lower left), and
spheres, data objects as blue cubes. The other objects represent props, camera’s position and orientation, and the props in the tent with their output requirements and return it in unstructured
properties, the renderer, and the rendering window. scene. The vtkRenderWindowInteractor object provides response to the GetOutput() method. Connections may data (lower
this functionality and can be attached to a render win- only be made when the input/output types match. In right).
dow as shown below. the example above, bFilter returns a type that’s the same Structured data
(vtkRectilinearGrid, Unstructured data
as, or a subclass of, what aFilter’s SetInput() method vtkStructuredGrid) (vtkUnstructuredGrid)
display a representation of a color lookup table. vtkRenderWindowInteractor iren accepts. Depending on which language you use to build
iren SetRenderWindow renWin a VTK application, type checking may be enforced at
vtkScalarBarActor scalarBar iren Initialize compile time (for example, building with C++) or at run-
scalarBar SetLookupTable negColor time (for example, building with Tcl).
scalarBar SetTitle “Density” The interactor can be placed into joystick or trackball Once constructed, the visualization pipeline’s execu- gories: sources, filters, and mappers. Sources have no
set sPC \ mode using the “j” or “t” keys. Left mouse operations tion must be carefully controlled. Filters should only re- VTK data inputs, but produce one or more outputs—for
[scalarBar GetPositionCoordinate] control rotation, the middle mouse button controls pan- execute when their internal state changes or when the example, readers or procedural source objects. Filters
$sPC SetCoordinateSystemTo- ning (translation within the focal plane), and right input to the filter changes. VTK employs a distributed, accept one or more inputs and produce one or more out-
NormalizedViewport mouse operations control zooming (translation towards implicit update process. Each object in VTK maintains puts. Mappers terminate the visualization pipeline,
$sPC SetValue 0.8 0.1 or away from the focal point). The “r” key can always be an internal time stamp that’s automatically updated either by coupling to the graphics subsystem (as we saw
used to reset the camera so that all the props can be seen when the object state changes (usually as a result of set- in the previous section) or writing their data to disk or
ren2 AddProp scalarBar in the image. ting an instance variable value). Process and data into a network connection.
renWin Render VTK also provides interactivity in an application objects maintain additional time stamps that are updat-
through user interface components. Below is a simple ed upon execution of the pipeline. The system compares Examples
If you’d like to write your own composite actor in C++, example of using a Tk text entry widget to change the these time stamps (each of which is a unique, monoto- We’ve already seen example pipelines in the previous
start with vtkScalarBarActor. This object creates the title annotation. nically increasing, unsigned long integer value) to deter- section. In the first example, we used a vtkCubeSource
scalar bar representation using other VTK classes and mine which objects are out of date and therefore which to procedurally generate a polygonal representation of
uses the rendering functionality of these created map- proc changeTitle {} { portion of the network must re-execute. Many visual- a cube, then connected it to a vtkPolyDataMapper. Sim-
pers to display the annotation object. titleMapper SetInput [.top.entry \ ization systems use a centralized executive to control ilarly, the next two examples in the previous section also
get] network execution, which becomes a bottleneck in large created readers, then connected them directly to a map-
Lights, cameras, and interaction renWin Render parallel applications. VTK’s distributed execution mech- per. We’ll now elaborate on this theme by creating a
Many VTK applications never explicitly create a vtk- } anism allows scalable parallel processing. more complex pipeline. This example reads a polygonal
Light or a vtkCamera, since the renderer will automat- data set generated from a Cyberware laser digitizer,
ically create them if they’re not defined at the first toplevel .top Data objects reduces the triangle count via decimation, reduces sur-
render. Once the system creates a camera, you can entry .top.entry Figure 4 illustrates the data objects that VTK supports. face noise via Laplacian smoothing, generates surface
access it from the renderer to change camera parameters .top.entry insert 0 \ Data objects represent information very generally as a normals, and glyphs the surface with cones represent-
such as position, focal point, and field of view. The cam- {This is a Pink Cube} field (an array of arrays). Data sets are a specialization ing surface normals.
era contains some convenience methods for rotation pack .top.entry of data objects with topological and geometric struc- We begin by reading the polygonal file:
about the position and the focal point such as bind .top.entry <Return> changeTitle ture. Besides their structure, data sets also have attribute
Azimuth(), Elevation(), Roll(), Pitch(), and Yaw() (the data associated with their topology and/or geometry vtkBYUReader reader
angles are measured in degrees). Now you can change the text in the entry, press the (for example, points and cells). The attribute data con- reader SetGeometryFileName “fran.g”
return key, and see the effect in the render window. sist of scalars, vectors, tensors, normals, texture coor-
set cam [ren2 GetActiveCamera] dinates, and field data. Next we create the pipeline, consisting of a decima-
$cam Azimuth 20.0 The visualization pipeline tor, smoother, and normal generator. We set the deci-
$cam Elevation 10.0 VTK’s data processing pipeline transforms data into Process objects mator with a target reduction of 90 percent, constrained
renWin Render forms that can be displayed by the graphics subsystem VTK offers several hundred process objects. Many by the requirement to preserve topology.
described previously or into other data forms that the of the filters operate on just one type of data (for
The light automatically created is a white light with pipeline can further process. For example, we may wish example, image processing filters). Some filters such vtkDecimatePro deci
the same position and focal point as the camera. If you to read a set of unorganized points, create a polygonal as vtkContourFilter accept an input of one type (vol- deci SetInput [reader GetOutput]
use an interactor (as described later in this section), this mesh via Delaunay triangulation, then display the mesh ume) and produce an output of another type (poly- deci SetTargetReduction 0.9
light will follow the camera. You can use the following using polygonal (surface) rendering. gons). The challenge of learning VTK involves deci PreserveTopologyOn
fragment of code to add a second light to the volume becoming familiar with the many possible filters and
rendered scene. This light comes from the right side and Pipeline architecture learning how to combine them to create useful and vtkSmoothPolyDataFilter smoother
is green. Since illumination is off by default in a volume The pipeline, or alternatively, visualization network, interesting visualizations. smoother SetInput [deci GetOutput]
property (ambient = 1.0, diffuse/specular = 0.0), the is constructed by connecting process objects and data Process objects are often referred to as filters. Specif-
green light doesn’t alter the volume. objects (Figure 3). Data objects represent and provide ically, VTK classifies process objects into three cate- vtkPolyDataNormals normals

24 September/October 2000 IEEE Computer Graphics and Applications 25


Tutorial

transformF SetInput [cone GetOutput] 5. H. Pfister et al., “The VolumePro Real-Time Ray-Casting
transformF SetTransform transform System,” Proc. Siggraph 99, ACM Press, New York, Aug. Additional Resources for VTK
1999, pp. 251-260. Visit http://www.visualizationtoolkit.org to access the VTK
vtkGlyph3D glyph community Web site. Here you’ll find information including
glyph SetInput [ptMask GetOutput] instructions for obtaining the software, online documentation, the
glyph SetSource [transformF \ results of the quality testing process for the nightly release, and
GetOutput] pointers to academic and commercial sites that use VTK.
5 This figure glyph SetVectorModeToUseNormal William J. Schroeder is first
shows a polygo- glyph SetScaleModeToScaleByVector author of The Visualization Toolkit Obtaining the software
nal mesh glyph SetScaleFactor 0.004 textbook and is currently president VTK is available as an official release version and as a nightly
acquired from a and co-founder of Kitware. He is also release. The source code for either of these versions, along with
laser scanner vtkPolyDataMapper spikeMapper a research faculty member at Rens- data sets and test images may be downloaded from the VTK Web
that has been spikeMapper SetInput [glyph selaer Polytechnic Institute. His site or obtained via anonymous CVS (a source code, revision
decimated, GetOutput] research interests include visualiza- control system). Precompiled binaries are available on the Web site
smoothed, and tion, computational geometry, and numerical analysis. for Windows and Linux. A CD with the latest official release may be
glyphed to vtkActor spikeActor He received a BS in mechanical engineering from the Uni- purchased from Kitware.
indicate surface spikeActor SetMapper spikeMapper versity of Maryland College Park in 1980 and a PhD in If you plan to use VTK as a tool by developing applications with it
normals. [spikeActor GetProperty] \ applied mathematics from RPI in 1991. using C++ or one of the scripting interfaces, then you’ll probably
SetColor 0 .79 .34 want to download the latest official release.
If you plan to modify and extend the VTK source code, then
We then add the two actors to the renderer and you’ll probably want to work with the nightly release. Users can
render the scene: examine the Web-based quality dashboard (http://public.kitware
Lisa Sobierajski Avila is a tech- .com/vtk/quality/MostRecentResults/) and decide whether the
vtkRenderer ren3 nical contributor and vice president system is stable enough on any given day to obtain a periodic
of Kitware, where she is involved in update. The dashboard generates every night after extensive
vtkRenderWindow renWin2 the development of volume rendering testing across a variety of platforms.
renWin2 AddRenderer ren3 software for medical and scientific
applications. Her research interests Help
normals SetInput [smoother \ vtkRenderWindowInteractor iren2 include volume visualization, haptic In addition to the testing described above, VTK is supported
GetOutput] iren2 SetRenderWindow renWin2 interaction, and level-of-detail rendering. She received her through books, training courses, and support contracts by Kitware.
normals SetFeatureAngle 60 BS, MS, and PhD in computer science from State Univer- Commercial products such as Principia, Mathematica’s graphical
ren3 AddActor fran sity of New York at Stony Brook in 1989, 1990, and 1994, pipeline editor, can aid in the development of VTK applications (see
vtkPolyDataMapper mapper ren3 AddActor spikeActor respectively. http://www.principiamathematica.com).
mapper SetInput [normals GetOutput] renWin2 Render Descriptions of the underlying work are available from two
sources. The textbook1 describes many of the algorithms and data
vtkActor fran Figure 5 shows the final image. structures in VTK. The User’s Guide (http://www.kitware.com)
fran SetMapper mapper describes how to install, use, and extend VTK.
[fran GetProperty] \ Extending VTK William A. Hoffman is currently In addition to commercial products and services, the VTK
SetColor 1 0.49 0.25 The object-oriented design of VTK lets users add their vice president and a technical lead at community provides many free resources. The vtkusers mailing list
own data objects and filters. For example, vtkDataSet is Kitware. His research interests is a resource for beginners and developers alike. Approximately 900
The next leg of the network is interesting because it an abstract class that defines an application program- include development of object-ori- subscribers answer questions, post bug fixes, and help VTK users
uses a filter that takes two inputs. The first input is a data ming interface (API) that all data sets must follow. By ented toolkits and systems for visu- get the most out of the software. Instructions for joining the list can
set containing some points; the second defines a glyph subclassing from vtkDataSet, the user can create a data alization and computer vision be found on the VTK Web site. A searchable archive lets you find
represented with polygonal data. (Here we use a cone, object that all filters accepting vtkDataSet as input can software. He holds a BS in computer and follow interesting technical threads.
rotated by a transform to face in the direction expected process (such as contouring). Such extensibility is true science from the University of Central Florida in 1990 and Members of the VTK community have developed resources that
by the vtkGlyph3D class.) We use the filter vtkMask- of almost every subsystem found in VTK, including the an MS in computer science from Rensselaer Polytechnic the general community can use. Sebastian Barre maintains an
Points to randomly select the points to glyph (to avoid graphics subsystem. For further resources, see the “Addi- Institute in 1992. extensive list of Web links at http://www.hds.utc.fr/~barre/vtk/
visual clutter): tional Resources for VTK” sidebar. ■ links.html to resources such as the source code for pipeline and
object browsers, a VTK benchmark program and results from many
vtkMaskPoints ptMask platforms, and a description of the process used by Jan Sifter and
ptMask SetInput [normals GetOutput] References Readers may contact the authors at Kitware, 469 Clifton collaborators to build online VTK documentation using doxygen
ptMask SetOnRatio 10 1. W. Schroeder, K. Martin, and W. Lorensen, The Visualiza- Corporate Parkway, Clifton Park, NY 12065, e-mail (an open-source documentation system; see http://www.stack.nl/
ptMask RandomModeOn tion Toolkit: An Object-Oriented Approach to 3D Graphics, {will.schroeder, lisa.avila, bill.hoffman}@kitware.com. ~dimitri/doxygen/index.html).
2nd ed., Prentice-Hall, Old Tappan, N.J., 1998.
vtkConeSource cone 2. C. Upson et al., “The Application Visualization System: A
cone SetResolution 6 Computational Environment for Scientific Visualization,”
IEEE Computer Graphics and Applications, Vol. 9, No. 40,
vtkTransform transform July 1989, pp. 30-42. View publication stats
transform Translate 0.5 0.0 0.0 3. Data Explorer Reference Manual, IBM, Armonk, New York,
1991.
vtkTransformPolyDataFilter \ 4. IRIS Explorer User’s Guide, Numerical Algorithms Group,
transformF Oxford, UK, 2000.

26 September/October 2000 IEEE Computer Graphics and Applications 27

You might also like