CSharp

I just started to maintain this page. So stay tuned. In the near future you will find useful examples here from time to time.
A tutorial on how to setup a Windows Forms Application utilizing ActiViz.NET can be found here: [http://www.vtk.org/Wiki/VTK/CSharp/ActiViz.NET Setup a Windows Forms Application to use ActiViz.NET]

Simple Operations

Example Name Classes Demonstrated Description
DistancePointToLine {{DoxygenURL vtkLine}}
DistanceBetweenPoints [http://www.vtk.org/doc/nightly/html/classvtkMath.html#a11944eda4bd17e4e57bcd1e49c2f9446 vtkMath::Distance2BetweenPoints]
UniformRandomNumber {{DoxygenURL vtkMath}}
GaussianRandomNumber {{DoxygenURL vtkMath}}
RandomSequence {{DoxygenURL vtkMinimalStandardRandomSequence}}
ProjectPointPlane {{DoxygenURL vtkPlane}}
PerspectiveTransform {{VTKDoxygenURL vtkPerspectiveTransform}}

Input and Output

Graph Formats

3D File Formats

Example Name Classes Demonstrated Description
ConvertFile Convert a file from one type to another
XGMLReader {{VTKDoxygenURL vtkXGMLReader}}

Standard Formats

Input
Example Name Classes Demonstrated Description

| SimplePointsReader | {{VTKDoxygenURL|vtkSimplePointsReader}} | Read a simple "xyz" file of points | ParticleReader|{{VTKDoxygenURL|vtkParticleReader}} || This example reads ascii files where each line consists of points with its position (x,y,z) and (optionally) one scalar or binary files in RAW 3d file forma Read an "xyza" file

| ReadPlainText | {{VTKDoxygenURL|vtkPolyData}} || Manually read a file using a streamreade Read a plain text file into a polydata | ReadOBJ | {{VTKDoxygenURL|vtkOBJReader}} | Read an OBJ (.obj) File | ReadDICOMSeries | {{VTKDoxygenURL|vtkDICOMImageReader}} || This example demonstates how to read a series of DICOM images and scroll through slice Convert a series of DICOM files into a VTI File | VRML|{{VTKDoxygenURL|vtkVRMLImporter}} | Read a VRML (WRL) file | DumpXMLFile|{{VTKDoxygenURL|vtkDataSetReader}} | Report the contents of a VTK XML or legacy file | DEMReader | {{VTKDoxygenURL|vtkDEMReader}} || Read DEM (elevation map) files | ReadSTL | {{VTKDoxygenURL|vtkSTLReader}} | Read stereo lithography STL (.stl) files | ReadPLY | {{VTKDoxygenURL|vtkPLYReader}} | Read PLY (.ply) files | ReadPLOT3D | {{VTKDoxygenURL|vtkPLOT3DReader}} || Read CFD (computational fluid dynamics) data produced by PLOT3D Read PLOT3D (.bin) files | ReadPDB | {{VTKDoxygenURL|vtkPDBReader}} || Read Protein Data Bank Files Read Protein Data Bank files (.pdb) files

Output
Example Name Classes Demonstrated Description

| SimplePointsWriter | {{VTKDoxygenURL|vtkSimplePointsWriter}} | Write a simple ".xyz" file | WriteSTL | {{VTKDoxygenURL|vtkSTLWriter}} | Write stereo lithography STL (.stl) files | WritePLY | {{VTKDoxygenURL|vtkPLYWriter}} | Write PLY (.ply) files | DelimitedTextWriter | {{VTKDoxygenURL|vtkDelimitedTextWriter}} | Write data to a delimited file

VTK Formats

Input
Example Name Classes Demonstrated Description
ReadUnstructuredGrid {{VTKDoxygenURL vtkXMLUnstructuredGridReader}}
ReadPolyData {{VTKDoxygenURL vtkXMLPolyDataReader}}
ReadImageData {{VTKDoxygenURL vtkXMLImageDataReader}}
ReadStructuredGrid {{VTKDoxygenURL vtkXMLStructuredGridReader}}
ReadRectilinearGrid {{VTKDoxygenURL vtkXMLRectilinearGridReader}}
ReadUnknownTypeXMLFile {{VTKDoxygenURL vtkXMLGenericDataObjectReader}}
Output
Example Name Classes Demonstrated Description
WriteVTU {{VTKDoxygenURL vtkXMLUnstructuredGridWriter}}
WriteVTP {{VTKDoxygenURL vtkXMLPolyDataWriter}}
WriteVTI {{VTKDoxygenURL vtkXMLImageDataWriter}}
XMLStructuredGridWriter {{VTKDoxygenURL vtkXMLStructuredGridWriter}}

Image Formats

Input

Example Name Classes Demonstrated Description
ReadBMP {{VTKDoxygenURL vtkBMPReader}}
JPEGReader {{VTKDoxygenURL vtkJPEGReader}}
PNGReader {{VTKDoxygenURL vtkPNGReader}}
ReadPNM {{VTKDoxygenURL vtkPNMReader}}
ReadTIFF {{VTKDoxygenURL vtkTIFFReader}}
MetaImageReader {{VTKDoxygenURL vtkMetaImageReader}}
ImageReader2Factory {{VTKDoxygenURL vtkImageReader2Factory}}

Output

Example Name Classes Demonstrated Description
WriteBMP {{VTKDoxygenURL vtkBMPWriter}}
JPEGWriter {{VTKDoxygenURL vtkJPEGWriter}}
WritePNG {{VTKDoxygenURL vtkPNGWriter}}
WritePNM {{VTKDoxygenURL vtkPNMWriter}}
WriteTIFF {{VTKDoxygenURL vtkTIFFWriter}}
MetaImageWriter {{VTKDoxygenURL vtkMetaImageWriter}}

Geometric Objects

Example Name Classes Demonstrated Description
PolygonIntersection {{VTKDoxygenURL vtkPolygon}}
GeometricObjectsDemo A demonstration of all geometric objects that work the same way
Arrow {{VTKDoxygenURL vtkArrowSource}}
Axes {{VTKDoxygenURL vtkAxesActor}}
ColoredLines {{VTKDoxygenURL vtkCellData}} {{VTKDoxygenURL
Cone {{VTKDoxygenURL vtkConeSource}}
Cube {{VTKDoxygenURL vtkCubeSource}}
Cylinder {{VTKDoxygenURL vtkCylinderSource}}
Disk {{VTKDoxygenURL vtkDiskSource}}
Frustum {{VTKDoxygenURL vtkFrustumSource}}
Line {{VTKDoxygenURL vtkLineSource}}
LongLine {{VTKDoxygenURL vtkLine}}
Hexahedron {VTKDoxygenURL vtkHexahedron}}
OrientedArrow {{VTKDoxygenURL vtkArrowSource}}
Plane {VTKDoxygenURL vtkPlaneSource}}
Planes {VTKDoxygenURL vtkPlanes}}
PlanesIntersection {VTKDoxygenURL vtkPlanesIntersection}}
PlatonicSolid {{VTKDoxygenURL vtkPlatonicSolidSource}}
Point {{VTKDoxygenURL vtkPoints}}
Polygon {{VTKDoxygenURL vtkPolygon}}
Pyramid {{VTKDoxygenURL vtkPyramid}}
PolyLine {{VTKDoxygenURL vtkPolyLine}}
Quad {{VTKDoxygenURL vtkQuad}}
RegularPolygonSource {{VTKDoxygenURL vtkRegularPolygonSource}}
Sphere {{VTKDoxygenURL vtkSphereSource}}
Triangle {{VTKDoxygenURL vtkTriangle}}
TriangleStrip {{VTKDoxygenURL vtkTriangleStrip}}
Tetrahedron {{VTKDoxygenURL vtkTetra}}
Vertex {{VTKDoxygenURL vtkVertex}}

Parametric Objects

These examples demonstrate how to create an display one of the many vtkParametric* objects. All of the classes listed can be used in an identical fashion.

Example Name Classes Demonstrated Description

| ParametricObjects | {{VTKDoxygenURL|vtkParametricBoy}}, {{VTKDoxygenURL|vtkParametricConicSpiral}}, {{VTKDoxygenURL|vtkParametricCrossCap}}, {{VTKDoxygenURL|vtkParametricDini}}, {{VTKDoxygenURL|vtkParametricEllipsoid}}, {{VTKDoxygenURL|vtkParametricEnneper}}, {{VTKDoxygenURL|vtkParametricFigure8Klein}}, {{VTKDoxygenURL|vtkParametricKlein}}, {{VTKDoxygenURL|vtkParametricMobius}}, {{VTKDoxygenURL|vtkParametricRandomHills}}, {{VTKDoxygenURL|vtkParametricRoman}}, {{VTKDoxygenURL|vtkParametricSpline}}, {{VTKDoxygenURL|vtkParametricSuperEllipsoid}}, {{VTKDoxygenURL|vtkParametricSuperToroid}}, {{VTKDoxygenURL|vtkParametricTorus}} | Create and display a parametric object | ParametricObjectsDemo | | Demonstration of all of the vtkParametric* classes

Implicit Functions and Iso-surfaces

Example Name Classes Demonstrated Description
IsoContours {{VTKDoxygenURL vtkContourFunction}}
SampleFunction {{VTKDoxygenURL vtkSampleFunction}}
ExtractLargestIsosurface {{VTKDoxygenURL vtkPolyDataConnectivityFilter}}
BandedPolyDataContourFilter {{VTKDoxygenURL vtkBandedPolyDataContourFilter}}
FilledContours {{VTKDoxygenURL vtkContourFilter}}
ImplicitSphere {{VTKDoxygenURL vtkSphere}}
MarchingCubes {{VTKDoxygenURL vtkMarchingCubes}}
MarchingSquares {{VTKDoxygenURL vtkMarchingSquares}}

Working with 3D Data

Example Name Classes Demonstrated Description
CenterOfMass {{VTKDoxygenURL CenterOfMass}}
BooleanOperationPolyDataFilter {{VTKDoxygenURL BooleanOperationPolyDataFilter}}
DistancePolyDataFilter {{VTKDoxygenURL DistancePolyDataFilter}}
ImplicitPolyDataDistance {{VTKDoxygenURL ImplicitPolyDataDistance}}
IntersectionPolyDataFilter {{VTKDoxygenURL IntersectionPolyDataFilter}}
ShrinkPolyData {{VTKDoxygenURL vtkShrinkPolyData}}
VectorFieldNonZeroExtraction {{VTKDoxygenURL vtkExtractSelectedThresholds}}
MultiBlockMergeFilter {{VTKDoxygenURL vtkMultiBlockMergeFilter}}, {{VTKDoxygenURL
IterateOverLines {{VTKDoxygenURL vtkCellArray}}
AlignFrames {{VTKDoxygenURL vtkLandmarkTransform}}
WarpVector {{VTKDoxygenURL vtkWarpVector}}
FindAllArrayNames {{VTKDoxygenURL vtkPolyData}}
PolyDataGetPoint {{VTKDoxygenURL vtkPolyData}}
NullPoint {{VTKDoxygenURL vtkPointData}}
ContoursFromPolyData {{VTKDoxygenURL vtkCutter}}
ImplicitBoolean {{VTKDoxygenURL vtkImplicitBoolean}}

Working with Meshes

Example Name Classes Demonstrated Description
MatrixMathFilter {{VTKDoxygenURL vtkMatrixMathFilter}}
WeightedTransformFilter {{VTKDoxygenURL vtkWeightedTransformFilter}}
GreedyTerrainDecimation {{VTKDoxygenURL vtkGreedyTerrainDecimation}}
LargestRegion {{VTKDoxygenURL vtkPolyDataConnectivityFilter}}
SpecifiedRegion {{VTKDoxygenURL vtkPolyDataConnectivityFilter}}
ColorDisconnectedRegions {{VTKDoxygenURL vtkPolyDataConnectivityFilter}}
Curvatures {{VTKDoxygenURL vtkCurvatures}}
MeshQuality {{VTKDoxygenURL vtkMeshQuality}}
HighlightBadCells {{VTKDoxygenURL vtkMeshQuality}}
PolygonalSurfaceContourLineInterpolator {{VTKDoxygenURL vtkPolygonalSurfaceContourLineInterpolator}}
DijkstraGraphGeodesicPath {{VTKDoxygenURL vtkDijkstraGraphGeodesicPath}}
SelectPolyData {{VTKDoxygenURL vtkSelectPolyData}}
SmoothPolyDataFilter {{VTKDoxygenURL vtkSmoothPolyDataFilter}}
ClosedSurface {{VTKDoxygenURL vtkFeatureEdges}}
Decimation {{VTKDoxygenURL vtkDecimatePro}}
QuadricDecimation {{VTKDoxygenURL vtkQuadricDecimation}}
QuadricClustering {{VTKDoxygenURL vtkQuadricClustering}}
Subdivision {{VTKDoxygenURL vtkButterflySubdivisionFilter}}, {{VTKDoxygenURL
BoundaryEdges {{VTKDoxygenURL vtkFeatureEdges}}
FillHoles {{VTKDoxygenURL vtkFillHolesFilter}}
WindowedSincPolyDataFilter {{VTKDoxygenURL vtkWindowedSincPolyDataFilter}}
height {VTKDoxygenURL vtkLookupTable}}
ElevationFilter {{VTKDoxygenURL vtkElevationFilter}}
SimpleElevationFilter {{VTKDoxygenURL vtkSimpleElevationFilter}}
mesh {{VTKDoxygenURL vtkTriangleFilter}}
ExtractEdges {{VTKDoxygenURL vtkExtractEdges}}
CellEdges {{VTKDoxygenURL vtkCell}}
SolidClip {{VTKDoxygenURL vtkClipPolyData}}
CapClip {{VTKDoxygenURL vtkClipPolyData}}
OBBDicer {{VTKDoxygenURL vtkOBBDicer}}

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. Here is an overview of these data structures: [http://vtk.org/Wiki/VTK/Tutorials/3DDataTypes]. Image data can represent at typical 2D image, but also, a 3D volume.

Example Name Classes Demonstrated Description
StructuredDataTypes Demonstration of structured data types
GetLinearPointId Get the linear point id of a point in a grid