# Python Examples

Please see this page to learn how to setup your environment to use VTK in Python.

It would be appreciated if there are any Python VTK experts who could convert any of the c++ examples to Python!

Info

This table shows the VTK classes covered by the examples.

Info

This table shows VTK classes that do not have an example. Please add examples in your area of expertise!

## Hello World

Example Name | Classes Demonstrated | Description | Image
--- | --- | --- | ---
CylinderExample | vtkPolyDataMapper vtkActor vtkRenderer vtkRenderWindow vtkRenderWindowInteractor | Cylinder example from the VTK Textbook and source code. A hello world example |

## Simple Operations

Example Name | Classes Demonstrated | Description | Image
--- | --- | --- | ---
DistanceBetweenPoints(cxx) | vtkMath::Distance2BetweenPoints |  |

## Input and Output

### Graph Formats

### 3D File Formats

#### Standard Formats

##### Input

Example Name | Classes Demonstrated | Description | Image
--- | --- | --- | ---
STLReader | vtkSTLReader |  |
UnstructuredGridReader | vtkUnstructuredGridReader | Using vtkUnstructuredGridReader to read a (legacy) *.vtk file |
VTPReader | vtkXMLPolyDataReader | Needs fixing. |

###### Importers

Example Name | Classes Demonstrated | Description | Image
--- | --- | --- | ---
3DSImporter(cxx) | vtk3DSImporter | Import a 3D Studio scene that includes multiple actors. |

##### Output

Example Name | Classes Demonstrated | Description | Image
--- | --- | --- | ---
PLYWriter | vtkPLYWriter |  |
STLWriter | vtkSTLWriter |  |

#### VTK Formats

##### Input

##### Output

#### Legacy VTK Formats

Example Name | Classes Demonstrated | Description | Image
--- | --- | --- | ---
ReadLegacyUnstructuredGrid(cxx) | vtkUnstructuredGridReader | Read an unstructured grid that contains 11 linear cells. |
WriteLegacyLinearCells(cxx) | vtkUnstructuredGridWriter | Write each linear cell into a legacy UnstructuredGrid file. |
WriteXMLLinearCells(cxx) | vtkXMLDataSetWriter | Write each linear cell into an XML UnstructuredGrid file (.vtu). |

### Image Format

#### Input

#### Output

Example Name | Classes Demonstrated | Description | Image
--- | --- | --- | ---
ImageWriter(cxx) | vtkBMPWriter vtkJPEGWriter vtkPNMWriter vtkPostScriptWriter vtkTIFFWriter vtkPNGWriter vtkWindowToImageFilter | Write an imagefile based on the file extension. |

## Geometric Objects

Example Name | Classes Demonstrated | Description | Image
--- | --- | --- | ---
Axes(cxx) | vtkAxesActor |  |
ColoredLines(cxx) | vtkCellData vtkLine |  |
Dodecahedron(cxx) | vtkPolyhedron | Create a dodecahedron using vtkPolyhedron. |
EllipticalCylinder(cxx) | vtkLinearExtrusionFilter | Create an elliptical cylinder using extrusion. |
EllipticalCylinderDemo(cxx) | vtkLinearExtrusionFilter | Show the base and extrusion vector. |
GeometricObjectsDemo(cxx) |  |  |
Planes(cxx) | vtkPlanes vtkHull | We create a convex hull of the planes for display purposes. |
PlanesIntersection(cxx) | vtkPlanesIntersection |  |
PolygonIntersection(cxx) | vtkPolygon | IntersectWithLine() |
SourceObjectsDemo(cxx) | vtkSphereSource vtkConeSource vtkCylinderSource vtkCubeSource vtkPlaneSource vtkTextSource vtkPointSource vtkDiskSource vtkLineSource | Examples of source objects that procedurally generate polygonal models. These nine images represent just some of the capability of VTK. From upper left in reading order: sphere, cone, cylinder, cube, plane, text, random point cloud, disk (with or without hole), and line source. Other polygonal source objects are available; check subclasses of vtkPolyDataAlgorithm. |

### Cells

Example Name | Classes Demonstrated | Description | Image
--- | --- | --- | ---
Cell3DDemonstration(cxx) | vtkHexagonalPrism vtkHexahedron vtkPentagonalPrism vtkPolyhedron vtkPyramid vtkTetra vtkVoxel vtkWedge vtkUnstructuredGrid | Sample objects are generated from the classes derived from vtkCell3D and displayed. |
Hexahedron(cxx) | vtkHexahedron |  |
LinearCellDemo(cxx) | vtkCell vtkCell3D | Linear cell types in VTK. |
LongLine(cxx) | vtkLine | Manually create a polyline. |
Point(cxx) | vtkPoints |  |
Polygon(cxx) | vtkPolygon |  |
Pyramid(cxx) | vtkPyramid |  |
Quad(cxx) | vtkQuad |  |
Tetrahedron(cxx) | vtkTetra |  |
Triangle(cxx) | vtkTriangle |  |
Vertex(cxx) | vtkVertex |  |

### Sources

Example Name | Classes Demonstrated | Description | Image
--- | --- | --- | ---
Arrow(cxx) | vtkArrowSource |  |
Cone(cxx) | vtkConeSource |  |
ConeA | vtkConeSource |  |
Cube(cxx) | vtkCubeSource |  |
Cube1 | vtkCubeSource |  |
Cylinder(cxx) | vtkCylinderSource |  |
DataSetSurface | vtkDataSetSurfaceFilter |  |
Disk(cxx) | vtkDiskSource | A circle with a hole in it. |
Frustum(cxx) | vtkFrustumSource |  |
LineSource | vtkLineSource |  |
OrientedArrow(cxx) | vtkArrowSource |  |
Plane(cxx) | vtkPlaneSource |  |
PlatonicSolids(cxx) | vtkPlatonicSolidSource | All five platonic solids are displayed. |
Polyline(cxx) | vtkPolyLine | This example demonstrates how to create a polygon through several ordered points. |
RegularPolygonSource(cxx) | vtkRegularPolygonSource |  |
Sphere(cxx) | vtkSphereSource |  |
TessellatedBoxSource(cxx) | vtkTessellatedBoxSource | Generate a box with tessellated sides. |
TextActor | vtkTextActor | 2D "HUD-type" text |
TriangleStrip(cxx) | vtkTriangleStrip |  |

### Non Linear

Example Name | Classes Demonstrated | Description | Image
--- | --- | --- | ---
IsoparametricCellsDemo(cxx) | vtkNonLinearCell | Nonlinear isoparametric cell types in VTK. |

### Parametric Objects

Example Name | Classes Demonstrated | Description | Image
--- | --- | --- | ---
ParametricObjects(cxx) |  | Uncomment the object that you wish to be displayed. |
ParametricObjectsDemo(cxx) | vtkParametricBoy vtkParametricConicSpiral vtkParametricCrossCap vtkParametricDini vtkParametricEllipsoid vtkParametricEnneper vtkParametricFigure8Klein vtkParametricKlein vtkParametricMobius vtkParametricRandomHills vtkParametricRoman vtkParametricSpline vtkParametricSuperEllipsoid vtkParametricSuperToroid vtkParametricTorus | Demonstration of of the vtkParametric classes added by Andrew Maclean. All the objects are displayed in a 4X4 array. |
ParametricObjectsDemo2(cxx) | vtkParametricBohemianDome vtkParametricBour vtkParametricCatalanMinimal vtkParametricHenneberg vtkParametricKuen vtkParametricPluckerConoid vtkParametricPseudosphere | Demonstration of additional vtkParametric* classes added by Tim Meehan. All the objects are displayed in a 4X2 array. |

## Implicit Functions and Iso-surfaces

Example Name | Classes Demonstrated | Description | Image
--- | --- | --- | ---
Boolean | vtkImplicitBoolean | Demonstrate booleans of two different implicit functions |
CutWithScalars(cxx) | vtkContourFilter | Cut a surface with scalars. |
ExtractData(cxx) | vtkSampleFunction | Implicit functions used to select data: Two ellipsoids are combined using the union operation used to select voxels from a volume. Voxels are shrunk 50 percent. |
Hello(cxx) | vtkImplicitModeller | Implicit modelling used to thicken a stroked font. |
IceCream(cxx) | vtkImplicitBoolean vtkSampleFunction | How to use boolean combinations of implicit functions to create a model of an ice cream cone. |
ImplicitDataSet(cxx) | vtkImplicitDataSet | A cube is used to define an implicit function (through vtkImplicitDataSet) which is then used to clip a sphere. |
ImplicitSphere(cxx) | vtkSphere | An implicit representation of a sphere. |
Lorenz(cxx) | vtkContourFilter | Visualizing a Lorenz strange attractor by integrating the Lorenz equations in a volume. |
MarchingCases(cxx) | vtkMarchingCubes | Explore the Marching Cubes cases. |
MarchingCasesA(cxx) | vtkMarchingCubes | The 256 possible cases have been reduced to 14 cases using symmetry. |
MarchingCasesB(cxx) | vtkMarchingCubes | Marching cubes complementary cases. |
Quadric | vtkQuadric | Create an ellipsoid using an implicit quadric |
Sphere | vtkSphere | Demonstrate sampling of a sphere implicit function |

## Working with 3D Data

Example Name | Classes Demonstrated | Description | Image
--- | --- | --- | ---
BooleanOperationPolyDataFilter(cxx) | vtkBooleanOperationPolyDataFilter | This example performs a boolean operation (Intersection, Union, Difference) of two PolyData |
Bottle(cxx) | vtkRotationalExtrusionFilter | Rotationally symmetric objects. |
ColoredTriangle | vtkTriangle | Creates a file TriangleColored.vtp. |
CombinePolyData(cxx) | vtkAppendPolyData | This example combines Polydata objects, and displays the result to the screen. |
Cube | vtkPolyData |  |
CurvaturesDemo | vtkCurvatures vtkColorTransferFunction | Demonstrates how to get the Gaussian and Mean curvatures of a surface. |
ExtractSelection(cxx) | vtkExtractSelection |  |
ExtractSelectionCells(cxx) | vtkExtractSelection | Extract cell, select cell. |
FilledPolygon | vtkCutter |  |
Finance(cxx) | vtkGaussianSplatter | Visualization of multidimensional financial data. The gray/wireframe surface represents the total data population. The red surface represents data points delinquent on loan payment. |
FinanceFieldData(cxx) | vtkGaussianSplatter | Visualization of multidimensional financial data. The yellow surface represents the total data population. The red surface represents data points delinquent on loan payment. |
ImplicitPolyDataDistance(cxx) | vtkImplicitPolyDataDistance |  |
IterativeClosestPoints | vtkIterativeClosestPointTransform |  |
LineOnMesh | vtkCellLocator vtkParametricSpline |  |
MeshLabelImageColor | vtkDiscreteMarchingCubes |  |
Outline(cxx) | vtkOutlineFilter |  |
PolyDataContourToImageData(cxx) | vtkLinearExtrusionFilter vtkPolyDataToImageStencil |  |
PolyDataToImageDataStencil | vtkPolyDataToImageStencil |  |
RotationAroundLine(cxx) | vtkTransformPolyDataFilter |  |
RuledSurfaceFilter(cxx) | vtkRuledSurfaceFilter |  |
SmoothMeshGrid | vtkLoopSubdivisionFilter vtkButterflySubdivisionFilter |  |
SolidColoredTriangle | vtkTriangle | Writes out a file TriangleSolidColor.vtp. |
Spring(cxx) | vtkRotationalExtrusionFilter | Rotation in combination with linear displacement and radius variation. |
TriangleColoredPoints(cxx) | vtkUnsignedCharArray |  |
TriangleCornerVertices | vtkCellArray |  |
TriangleCorners | vtkXMLPolyDataWriter |  |
WarpVector(cxx) | vtkLine vtkDoubleArray vtkPolyData vtkWarpVector | This example warps/deflects a line. |
WriteTriangleToFile | vtkTriangle |  |

### Data Types

### Data Type Conversions

### Point Cloud Operations

Example Name | Classes Demonstrated | Description | Image
--- | --- | --- | ---
PointSource | vtkPointSource |  |

### Working with Meshes

This section includes examples of manipulating meshes.

Example Name | Classes Demonstrated | Description | Image
--- | --- | --- | ---
ClipDataSetWithPolydata(cxx) | vtkClipDataSet vtkImplicitPolyDataDistance vtkRectilinearGrid | clip a vtkRectilinearGrid with arbitrary polydata. In this example, use a vtkConeSource to generate polydata to slice the grid, resulting in an unstructured grid. |
DelaunayMesh(cxx) | vtkDelaunay2D vtkMinimalStandardRandomSequence vtkExtractEdges vtkGlyph3D vtkTubeFilter | Two-dimensional Delaunay triangulation of a random set of points. Points and edges are shown highlighted with sphere glyphs and tubes. |

#### Clipping

### Working with Structured 3D Data

This section includes vtkImageData vtkStructuredGrid and vtkRectilinearGrid.

"ImageData" is not the traditional "flat, 2D image" you are used to. It is a special VTK data structure in the collection of 3D data structures provided by VTK.

#### vtkImageData

Example Name | Classes Demonstrated | Description | Image
--- | --- | --- | ---
ImageWeightedSum(cxx) | vtkImageWeightedSum | Add two or more images. |

#### Conversions

#### vtkStructuredGrid

Example Name | Classes Demonstrated | Description | Image
--- | --- | --- | ---
SGrid(cxx) | vtkStructuredGrid | Creating a structured grid dataset of a semi-cylinder. Vectors are created whose magnitude is proportional to radius and oriented in tangential direction. |

#### vtkStructuredPoints

Example Name | Classes Demonstrated | Description | Image
--- | --- | --- | ---
Vol(cxx) | vtkStructuredPoints vtkContourFilter | Creating a image data dataset. Scalar data is generated from the equation for a sphere. Volume dimensions are 26 x 26 x 26. |

#### vtkRectilinearGrid

Example Name | Classes Demonstrated | Description | Image
--- | --- | --- | ---
RGrid(cxx) | vtkRectilinearGrid | Creating a rectilinear grid dataset. The coordinates along each axis are defined using an instance of vtkDataArray. |
RectilinearGrid(cxx) | vtkRectilinearGrid | create a rectilinear grid |

### Working with Unstructured 3D Data

This section includes vtkUnstructuredGrid.

#### vtkUnstructuredGrid

Example Name | Classes Demonstrated | Description | Image
--- | --- | --- | ---
UGrid(cxx) | vtkUnstructuredGrid | Creation of an unstructured grid. |

### Registration

### Medical

Example Name | Classes Demonstrated | Description | Image
--- | --- | --- | ---
MedicalDemo1(cxx) | vtkMarchingCubes | Create a skin surface from volume data |
MedicalDemo2(cxx) | vtkMarchingCubes | Create a skin and bone surface from volume data |
MedicalDemo3(cxx) | vtkMarchingCubes | Create skin, bone and slices from volume data |
MedicalDemo4(cxx) | vtkFixedPointVolumeRayCastMapper | Create a volume rendering |

### Surface reconstruction

## Utilities

Example Name | Classes Demonstrated | Description | Image
--- | --- | --- | ---
Delaunay2D(cxx) | vtkDelaunay2D |  |
LUTUtilities(cxx) | vtkLookupTable vtkColorSeries | A utility class for vtkLookupTable allowing you to output the table contents or to compare tables. |
MultipleViewports(cxx) | vtkRenderer::SetViewport |  |
Screenshot(cxx) | vtkWindowToImageFilter |  |
VTKVersion | vtkVersion |  |
VTKWithNumpy | vtkImageImport |  |
Variant(cxx) | vtkVariant |  |

### Arrays

Example Name | Classes Demonstrated | Description | Image
--- | --- | --- | ---
GetValues | GetTuple3 |  |
RenameArray | SetName |  |

### Events

## Math Operations

## Graphs

### Graph Conversions

## Data Structures

### Timing Demonstrations

### KD-Tree

### Oriented Bounding Box (OBB) Tree

### Octree

### Modified BSP Tree

### HyperTreeGrid

## VTK Concepts

## Rendering

Example Name | Classes Demonstrated | Description | Image
--- | --- | --- | ---
CameraBlur(cxx) |  | Example of a scene rendered with focal depth. |
ColoredSphere(cxx) | vtkSphereSource vtkElevationFilter | A simple sphere. |
Cone3(cxx) | vtkRenderWindow | Four frames of output, based on the VTK example Cone3.py. |
Cone4(cxx) | vtkRenderWindow | Modifying properties and transformation matrix based on the VTK example Cone4.py. |
DottedLine |  | This needs a re-work, see StippledLine.cxx |
FlatVersusGouraud(cxx) | vtkProperty::SetInterpolationToFlat vtkProperty::SetInterpolationToGouraud | Flat and Gouraud shading. Different shading methods can dramatically improve the look of an object represented with polygons. On the top, flat shading uses a constant surface normal across each polygon. On the bottom, Gouraud shading interpolates normals from polygon vertices to give a smoother look. |
Mace(cxx) |  | An example of multiple inputs and outputs. |
Model(cxx) | vtkRenderer vtkRenderWindow vtkRenderWindowInteractor | Illustrative diagram of graphics objects. |
MotionBlur(cxx) | vtkRenderStepsPass vtkSimpleMotionBlurPass | Example of motion blur. |
Rainbow(cxx) | vtkLookupTable | Use and manipulation of vtkLookupTables. |
Rotations(cxx) | vtkActor::RotateX,Y,Z vtkRenderer::EraseOff | Rotations of a cow about her axes. |
SpecularSpheres(cxx) | vtkProperty | Demonstrates the effect of specular lighting on spheres. |
StripFran(cxx) | vtkDecimatePro vtkStripper | Triangle strip examples. (a) Structured triangle mesh consisting of 134 strips each of 390 triangles. (b) Unstructured triangle mesh consisting of 2227 strips of average length 3.94, longest strip 101 triangles. Images are generated by displaying every other triangle strip. |
TransformSphere(cxx) | vtkSphereSource vtkElevationFilter vtkTransform vkTransformFilter | The addition of a transform filter to ColoredSphere. |
WalkCow(cxx) | vtkBYUReader vtkRenderWindow::EraseOff() vtkActor | This generates Figs. 3-32, 3-33 found in VTKTextbook.pdf. |
WalkCowA(cxx) | vtkBYUReader vtkRenderWindow::EraseOff() vtkActor | This generates Fig. 3-33a found in VTKTextbook.pdf. |
WalkCowB(cxx) | vtkBYUReader vtkRenderWindow::EraseOff() vtkActor | This generates Fig. 3-33b found in VTKTextbook.pdf. |

## Lighting

## Texture Mapping

Example Name | Classes Demonstrated | Description | Image
--- | --- | --- | ---
AnimateVectors(cxx) | vtkTexture vtkGlyph3D | One frame from a vector field animation using texture maps. |
TextureCutQuadric(cxx) | vtkBooleanTexture vtkImplicitTextureCoords | Cut a quadric with boolean textures. |
TextureCutSphere(cxx) | vtkImplicitTextureCoords | Examples of texture thresholding. (b) Boolean combination of two planes to cut nested spheres. |
TexturePlane(cxx) | vtkTexture | Example of texture mapping. |
TextureThreshold(cxx) | vtkTexture vtkThresholdTextureCoords vtkStructuredGridGeometryFilter | Demonstrate the use of scalar thresholds to show values of flow density on three planes. |

## Visualization

See this tutorial for a brief explanation of the VTK terminology of mappers, actors, etc.

Example Name | Classes Demonstrated | Description | Image
--- | --- | --- | ---
AlphaFrequency(cxx) | vtkLinearExtrusionFilter vtkVectorText | Linearly extrude fonts to show letter frequencies in text. |
AnatomicalOrientation(cxx) | vtkAnnotatedCubeActor vtkAxesActor vtkOrientationMarkerWidget vtkTransform | Show a labelled set of anatomical planes transecting a human figure. |
AssignCellColorsFromLUT(cxx) | vtkNamedColors vtkPlaneSource vtkLookupTable vtkColorTransferFunction | Demonstrates how to assign colors to cells in a vtkPolyData structure using lookup tables. |
BlobbyLogo(cxx) | vtkImplicitModeller | A logo created with vtkImplicitModeller. |
Blow(cxx) | vtkUnstructuredGridReader vtkWarpVector vtkConnectivityFilter | Ten frames from a blow molding finite element analysis. |
BluntStreamlines(cxx) | vtkStructuredGridGeometryFilter vtkStreamTracer | Demonstrates airflow around a blunt fin using streamlines. |
Camera(cxx) | vtkCamera | Positioning and aiming the camera. |
CameraModel1(cxx) | vtkCameraActor | Illustrate camera movement. |
CameraModel2(cxx) | vtkCameraActor | Illustrate camera movement. |
CarotidFlow(cxx) | vtkStreamTracer vtkThresholdPoints | Visualizing blood flow in the human carotid arteries. Streamtubes of flow velocity are generated. |
CarotidFlowGlyphs(cxx) | vtkGlyph3D vtkThresholdPoints | Visualizing blood flow in human carotid arteries. Cone glyphs indicate flow direction and magnitude. |
ClampGlyphSizes | vtkGlyph3D | Use vtkGlyph3D with ClampingOn to limit glyph sizes |
ClipSphereCylinder(cxx) | vtkImplicitBoolean vtkClipPolyData | A plane clipped with a sphere and an ellipse. The two transforms place each implicit function into the appropriate position. Two outputs are generated by the clipper. |
ColorActor | vtkActor::GetProperty()::SetColor | Colour the actor. |
CombustorIsosurface(cxx) | vtkContourFilter | Marching cubes surface of flow density. |
ComplexV(cxx) | vtkHedgeHog | ComplexV from the VTK Textbook. |
ContourQuadric(cxx) | vtkQuadric vtkSampleFunction vtkContourFilter | Contouring a quadric function. |
CreateBFont(cxx) | vtkClipPolyData vtkImageDataGeometryFilter | A scanned image clipped with a scalar value of 1/2 its maximum intensity produces a mixture of quadrilaterals and triangles. |
CubeAxesActor(cxx) | vtkCubeAxesActor |  |
CurvatureBandsWithGlyphs(cxx) | vtkCurvatures vtkBandedPolyDataContourFilter vtkLookupTable vtkColorSeries vtkGlyph3D | Demonstrates the coloring of a surface by partitioning the gaussian curvature of a surface into bands and using arrows to display the normals on the surface. |
CutStructuredGrid(cxx) | vtkCutter | Cut through structured grid with plane. The cut plane is shown solid shaded. A computational plane of constant k value is shown in wireframe for comparison. The colors correspond to flow density. Cutting surfaces are not necessarily planes: implicit functions such as spheres, cylinders, and quadrics can also be used. |
Cutter(cxx) | vtkCutter |  |
DecimateFran(cxx) | vtkDecimatePro | Examples of decimation algorithm. (a) Decimation of laser digitizer data. |
DecimateHawaii(cxx) | vtkDecimatePro | Examples of decimation algorithm. (b) Decimation of terrain data. |
DisplacementPlot(cxx) | vtkColorTransferFunction vtkWarpVector vtkVectorDot | Show modal lines for a vibrating beam. |
DisplayCoordinateAxes(cxx) | vtkOrientationMarkerWidget | Display coordinate axes. |
ElevationBandsWithGlyphs(cxx) | vtkBandedPolyDataContourFilter vtkLookupTable vtkColorSeries vtkGlyph3D | Demonstrates the coloring of a surface by partitioning the elevation into bands and using arrows to display the normals on the surface. |
ExponentialCosine(cxx) | vtkWarpScalar | Carpet plots. Visualization of an exponential cosine function. Function values are indicated by surface displacement. Colors indicate derivative values. |
FrogSlice(cxx) | vtkMetaImageReader | Photographic slice of frog (upper left), segmented frog (upper right) and composite of photo and segmentation (bottom). The purple color represents the stomach and the kidneys are yellow. |
GlyphTable | vtkGlyph3D | Vary the shapes of glyphed points using a glyph table |
Hanoi(cxx) |  | Towers of Hanoi. |
HanoiInitial(cxx) |  | Towers of Hanoi - Initial configuration. |
HanoiIntermediate(cxx) |  | Towers of Hanoi - Intermediate configuration. |
HardwareSelector | vtkHardwareSelector |  |
Hawaii(cxx) | vtkElevationFilter vtkColorSeries vtkLookupTable | Visualize elevations by coloring the scalar values with a lookup table. |
HeadBone(cxx) | vtkMarchingCubes | Marching cubes surface of human bone. |
HeadSlice(cxx) | vtkContourFilter | Marching squares used to generate contour lines. |
HyperStreamline(cxx) | vtkHyperStreamline | Example of hyperstreamlines, the four hyperstreamlines shown are integrated along the minor principle stress axis. A plane (colored with a different lookup table) is also shown. |
InteractorStyleTrackballActor | vtkInteractorStyleTrackBallActor |  |
InteractorStyleTrackballCamera | vtkInteractorStyleTrackBallCamera |  |
IronIsoSurface(cxx) | vtkContourFilter | Marching cubes surface of iron-protein. |
Kitchen(cxx) | vtkStreamTracer vtkStructuredGrid | Demonstrates stream tracing in a kitchen. |
KochSnowflake(cxx) | vtkPolyData vtkCellArray vtkPoints vtkPolyLine | This example draws a Koch snowflake fractal using recursive functions and some of the convenient tools in the toolkit. |
LOx(cxx) | vtkStreamTracer vtkTubeFilter | Streamtubes created by using the computational grid just in front of the post as a source for seeds. |
LOxGrid(cxx) | vtkStreamTracer vtkTubeFilter | Portion of computational grid for the LOx post. |
LOxSeeds(cxx) | vtkStreamTracer vtkTubeFilter | Streamlines seeded with spherical cloud of points. Four separate cloud positions are shown. |
LoopShrink(cxx) |  | A network with a loop. VTK 5.0 does not allow you to execute a looping visualization network; this was possible in previous versions of VTK. |
Motor(cxx) | vtkBYUReader vtkStructuredPointsReader vtkTexture vtkImplicitTextureCoords | Texture cut used to reveal internal structure of a motor. Two cut planes are used in combination with transparent texture. |
NamedColorPatches(cxx) | vtkNamedColors | Creates a HTML file called VTKNamedColorPatches |
NamedColors(cxx) | vtkNamedColors | Demonstrates how to use the vtkNamedColors class. |
NormalsDemo(cxx) | vtkPolyDataNormals | Demo different options to generate normals. |
Office(cxx) | vtkPointSource vtkStreamTracer | Using random point seeds to create streamlines. |
OfficeA(cxx) | vtkPointSource vtkStreamTracer | Corresponds to Fig 9-47(a) in the VTK textbook. |
OfficeTube(cxx) | vtkStreamTracer vtkTubeFilter | The stream polygon. Sweeping a polygon to form a tube. |
OrientedGlyphs(cxx) | vtkGlyph3D | Create oriented glyphs from vector data. |
PineRootConnectivity(cxx) | vtkMCubesReader vtkPolyDataConnectivityFilter | Applying the connectivity filter to remove noisy isosurfaces. |
PineRootConnectivityA(cxx) | vtkMCubesReader vtkPolyDataConnectivityFilter | The isosurface, with no connectivity filter applied. |
PineRootDecimation(cxx) | vtkMCubesReader vtkDecimatePro vtkConnectivityFilter | Applying the decimation and connectivity filters to remove noisy isosurfaces and reduce data size. |
PlateVibration(cxx) | vtkWarpVector vtkVectorDot | Demonstrates the motion of a vibrating beam. |
PointDataSubdivision(cxx) | vtkLinearSubdivisionFilter | Vary the shapes of glyphed points using a programmable glyph filter |
PointSize(cxx) | vtkActor |  |
ProbeCombustor(cxx) | vtkProbeFilter | Probing data in a combustor. Probes are regular arrays of 50 by 50 points that are then passed through a contouring filter. |
ProgrammableGlyphs | vtkProgrammableGlyphFilter | Generate programmable glyphs. |
PseudoVolumeRendering(cxx) | vtkCutter vtkContourFilter | 100 cut planes with opacity of 0.05. Rendered back-to-front to simulate volume rendering. |
QuadraticSurface(cxx) | vtkQuadric |  |
QuadricVisualization(cxx) | vtkQuadric vtkSampleFunction vtkContourFilter | Visualizing a quadric function. |
SingleSplat(cxx) | vtkGaussianSplatter | Elliptical splatting. (a) Single elliptical splat with eccentricity E=10. Cone shows orientation of vector. |
SphereTexture | vtkTextureMapToSphere | Apply an ImageData texture to an sphere |
SpikeFran(cxx) | vtkGlyph3D | Glyphs indicate surface normals on model of human face. Glyph positions are randomly selected. |
SplatFace(cxx) | vtkGaussianSplatter | Elliptical splatting. (b) Surface reconstructed using elliptical splats into 100^3 volume followed by isosurface extraction. Points regularly subsampled and overlaid on original mesh. |
Stocks(cxx) | vtkRibbonFilter vtkLinearExtrusionFilter | Two views from the stock visualization script. The top shows closing price over time; the bottom shows volume over time. |
Streamlines(cxx) | vtkStreamLine | Seed streamlines with vectors from a structured grid |
StreamlinesWithLineWidget(cxx) | vtkCallbackCommand vtkLineWidget | Using the vtkLineWidget to produce streamlines in the combustor dataset. The StartInteractionEvent turns the visibility of the streamlines on; the InteractionEvent causes the streamlines to regenerate themselves. |
TensorAxes(cxx) | vtkPointLoad vtkTensorGlyph | Display the scaled and oriented principal axes of the stress tensor. |
TensorEllipsoids(cxx) | vtkPointLoad vtkTensorGlyph | Display the scaled and oriented principal axes as tensor ellipsoids representing the stress tensor. |
TextSource(cxx) | vtkTextSource |  |
UnstructuredTransientVolumeRendering | vtkUnstructuredGridVolumeRayCastMapper |  |
VectorText(cxx) | vtkVectorText | Display high resolution text. |
VelocityProfile(cxx) | vtkMultiBlockPLOT3DReader vtkStructuredGridGeometryFilter vtkAppendPolyData vtkWarpVector | Warping the geometry of three planes to show flow momentum. |
ViewFrog(cxx) | vtkMetaImageReader vtkMarchingCubes vtkImageGaussianSmooth vtkWindowedSincPolyDataFilter | The complete frog without skin. |
ViewFrogA(cxx) | vtkMetaImageReader vtkMarchingCubes vtkImageGaussianSmooth vtkWindowedSincPolyDataFilter | The complete frog without skin or skeleton. |
ViewFrogBoth(cxx) | vtkMetaImageReader vtkMarchingCubes vtkImageGaussianSmooth vtkImageGaussianSmooth | The frog’s brain. Model extracted without smoothing (left) and with smoothing (right). |
ViewFrogSkinAndTissue(cxx) | vtkMetaImageReader vtkMarchingCubes vtkWindowedSincPolyDataFilter vtkImageGaussianSmooth | All frog parts and translucent skin. |
WarpCombustor(cxx) | vtkWarpScalar vtkMultiBlockPLOT3DReader | Carpet plots. Carpet plot of combustor flow energy in a structured grid. Colors and plane displacement represent energy values. |
WindowTitle(cxx) | vtkRenderWindow::SetWindowName |  |

## Working with vtkImageData

Example Name | Classes Demonstrated | Description | Image
--- | --- | --- | ---
SumVTKImages | vtkImageWeightedSum | A function to simplify the summing of images, where you can pass a list of images and |
WriteReadVtkImageData | vtkImageData vtkXMLImageDataReader vtkXMLImageDataWriter |  |

## Working with ExodusII Data

Example Name | Classes Demonstrated | Description | Image
--- | --- | --- | ---
ReadExodusData | vtkExodusIIReader | A simple script for reading and viewing ExodusII data interactively. |

## Graphs

Example Name | Classes Demonstrated | Description | Image
--- | --- | --- | ---
EdgeWeights(cxx) | vtkMutableDirectedGraph vtkGraphLayoutView |  |
NOVCAGraph(cxx) | vtkUnstructuredGrid vtkXMLUnstructuredGridWriter |  |
SelectedVerticesAndEdges(cxx) | vtkAnnotationLink vtkGraphLayoutView |  |
VisualizeGraph(cxx) | vtkMutableDirectedGraph vtkGraphLayoutView |  |

## Volume Rendering

Example Name | Classes Demonstrated | Description | Image
--- | --- | --- | ---
SimpleRayCast(cxx) | vtkFixedPointVolumeRayCastMapper | Volume rendering of a high potential iron protein. |

## User Interaction

Example Name | Classes Demonstrated | Description | Image
--- | --- | --- | ---
CallBack(cxx) | vtkCallbackCommand vtkOrientationMarkerWidget | Setting up a callback with client data. Two different methods are demonstrated. |
HighlightPickedActor | vtkPropPicker vtkInteractorStyleTrackballCamera | Pick and highlight an actor based on mouse clicks. |
MouseEvents(cxx) | vtkInteractorStyleTrackballCamera | Subclass the interactor style. |
MouseEventsObserver(cxx) | vtkCallbackCommand | Use an observer. |

## Working with Images

Example Name | Classes Demonstrated | Description | Image
--- | --- | --- | ---
BackgroundImage(cxx) | vtkJPEGReader vtkImageCanvasSource2D vtkImageActor vtkSuperquadricSource | Display an image as the "background" of a scene, and render a superquadric in front of it. |

## Image Processing

Example Name | Classes Demonstrated | Description | Image
--- | --- | --- | ---
Attenuation(cxx) | vtkImageGaussianSmooth vtkImageMathematics vtkImageShiftScale | This MRI image illustrates attenuation that can occur due to sensor position. The artifact is removed by dividing by the attenuation profile determined manually. |
EnhanceEdges(cxx) | vtkImageLaplacian vtkImageMathematics | High-pass filters can extract and enhance edges in an image. Subtraction of the Laplacian (middle) from the original image (left) results in edge enhancement or a sharpening operation (right). |
GaussianSmooth(cxx) | vtkImageGaussianSmooth | Low-pass filters can be implemented as convolution with a Gaussian kernel. |
HybridMedianComparison(cxx) | vtkImageHybridMedian2D vtkImageMedian3D | Comparison of median and hybrid-median filters. The hybrid filter preserves corners and thin lines, better than the median filter. |
IdealHighPass(cxx) | vtkImageFFT vtkImageRFFT vtkImageIdealHighPass vtkImageButterworthHighPass | This figure shows two high-pass filters in the frequency domain. The Butterworth high-pass filter has a gradual attenuation that avoids ringing produced by the ideal high-pass filter with an abrupt transition. |
ImageGradient(cxx) | vtkImageMagnify vtkImageGaussianSmooth vtkImageGradient vtkImageEuclideanToPolar vtkImageExtractComponents vtkImageHSVToRGB | Create an imaging pipeline to visualize gradient information. |
ImageWarp(cxx) | vtkBMPReader vtkImageLuminance vtkWarpScalar vtkMergeFilter | Combine the imaging and visualization pipelines to deform an image in the z-direction. The vtkMergeFilter is used to combine the warped surface with the original color data. |
IsoSubsample(cxx) | vtkImageMarchingCubes vtkImageShrink3D vtkImageGaussianSmooth | This figure demonstrates aliasing that occurs when a high-frequency signal is subsampled. High frequencies appear as low frequency artifacts. The left image is an isosurface of a skull after subsampling. The right image used a low-pass filter before subsampling to reduce aliasing. |
MedianComparison(cxx) | vtkImageGaussianSmooth vtkImageMedian3D vtkImageNoiseSource | Comparison of Gaussian and Median smoothing for reducing low-probability high-amplitude noise. |
MorphologyComparison(cxx) | vtkImageDilateErode3D vtkImageSeedConnectivity | This figure demonstrates various binary filters that can alter the shape of segmented regions. |
Pad(cxx) | vtkImageConstantPad vtkImageMirrorPad | Convolution in frequency space treats the image as a periodic function. A large kernel can pick up features from both sides of the image. The lower-left image has been padded with zeros to eliminate wraparound during convolution. On the right, mirror padding has been used to remove artificial edges introduced by borders. |
VTKSpectrum(cxx) | vtkImageFFT vtkImageFourierCenter vtkImageLogarithmicScale vtkImageMagnitude | The discrete Fourier transform changes an image from the spatial domain into the frequency domain, where each pixel represents a sinusoidal function. This figure shows an image and its power spectrum displayed using a logarithmic transfer function. |

## Widgets

Example Name | Classes Demonstrated | Description | Image
--- | --- | --- | ---
BalloonWidget(cxx) | vtkBalloonWidget vtkBalloonRepresentation | Uses a vtkBalloonWidget to draw labels when the mouse stays above an actor. |
BoxWidget(cxx) | vtkBoxWidget | This 3D widget defines a region of interest that is represented by an arbitrarily oriented hexahedron with interior face angles of 90 degrees (orthogonal faces). The object creates 7 handles that can be moused on and manipulated. |
ContourWidget(cxx) | vtkContourWidget vtkOrientedGlyphContourRepresentation | Draw a contour (line) which can be deformed by the user |
OrientationMarkerWidget(cxx) | vtkAnnotatedCubeActor vtkOrientationWidget | Draws two cubes. One of them can be clicked to be rotated, and will rotate the second one. The second one has annotations on it, and can also be moved. |
ScalarBarWidget | vtkScalarBarWidget | The ScalarBarWidget displays a scalar bar that is movable and changes orientation automatically when close to the borders of the image. It needs a ScalarBarActor |
SphereWidget(cxx) | vtkSphereWidget | This 3D widget defines a sphere that can be interactively placed in a scene. |
TextWidget(cxx) | vtkTextWidget | Annotate a VTK image with movable text |

## Plotting

Example Name | Classes Demonstrated | Description | Image
--- | --- | --- | ---
ScatterPlot(cxx) | vtkChartXY |  |
SpiderPlot(cxx) | vtkSpiderPlotActor |  |

## Animation

Example Name | Classes Demonstrated | Description | Image
--- | --- | --- | ---
Animation(cxx) | vtkRenderWindowInteractor | Move a sphere across a scene. |

## Geographic Visualization (Geovis)

Example Name | Classes Demonstrated | Description | Image
--- | --- | --- | ---
CompassWidget | vtkCompassWidget vtkCompassRepresentation | Draws an interactive compass. |
GeoAssignCoordinates(cxx) | vtkGeoAssignCoordinates vtkMutableDirectedGraph vtkGraphMapper | Draws a sphere, based on longituds and latitudes. |
ParallelCoordinatesView(cxx) | vtkRTAnalyticSource vtkParallelCoordinatesView vtkParallelCoordinatesRepresentation | Plotting data attributes in a Parallel Coordinates View |

## Infovis

Example Name | Classes Demonstrated | Description | Image
--- | --- | --- | ---
ParallelCoordinatesExtraction | vtkExtractSelection vtkAnnotationLink | Extract data based on a selection in a Parallel Coordinates View |
SelectedGraphIDs | vtkAnnotationLink vtkRandomGraphSource vtkGraphLayoutView | Callback on vtkAnnotationLink in a Graph Layout View when selection is changed |

## PyQt

Example Name | Classes Demonstrated | Description | Image
--- | --- | --- | ---
EmbedInPyQt | vtkRenderWindowInteractor | Shows how to easily embed VTK in PyQt with QVTKRenderWindowInteractor, first example |
EmbedInPyQt2 | vtkRenderWindowInteractor | Shows how to embed VTK in PyQt with QVTKRenderWindowInteractor, second example |