Difference between revisions of "User:Tohline/vtk/Examples/LegacyCubeG"

From VistrailsWiki
Jump to navigation Jump to search
(Legacy Format Cube, Example G)
 
(Delete extraneous set of "Related Discussions" links)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
=Example Input Files & VisTrails Pipelines=
=Example Input Files & VisTrails Pipelines=
{{LSU_HBook_header}}
{{LSU_HBook_header}}
This is one example of an input data file that we have successfully used to generate a useful interactive rendering within VisTrails.  The file illustrates VTK's ''Simple Legacy Format'' and the POLYDATA dataset format.  To aid in implementation, we present the full ascii dataset, the resulting rendered image, and a screen shot of the VisTrails pipeline that was used to generate the image.  This example (G) is very similar to the "Cube example" that is provided in §15.3 of the [http://www.kitware.com/products/books/vtkguide.html ''VTK User's Guide,'' authored and published by Kitware, Inc.] (see especially pp. 331-332) and is one of many "simple cube" examples that have been discussed in detail in our [[User:Tohline/vtk/SimpleCubeTutorial#Simple_Cube_Tutorial|accompanying ''Simple Cube Tutorial'']].  A list of other example input data files [[User:Tohline/vtk/SimpleCubeTutorial#Other_Example_Input_Files_and_VisTrails_Pipelines|is provided near the end]] of the tutorial.
==Legacy Cube Example G==
==Legacy Cube Example G==


<div align="left">
<div align="left">
<pre>
<pre>
<?xml version="1.0"?>
# vtk DataFile Version 2.0
<VTKFile type="PolyData" version="0.1" byte_order="LittleEndian">
Cube example
  <PolyData>
ASCII
    <Piece NumberOfPoints="36" NumberOfPolys="25">
DATASET POLYDATA
      <CellData Scalars="cell_scalars" Normals="cell_normals">
POINTS 8 float
        <DataArray type="Float32" Name="cell_scalars" format="ascii">
0.0 0.0 0.0
          0.2 0.2 0.2 0.2 0.2
1.0 0.0 0.0
          0.2 0.4 0.6 0.4 0.2
1.0 1.0 0.0
          0.2 0.6 0.8 0.6 0.2
0.0 1.0 0.0
          0.2 0.4 0.6 0.4 0.2
0.0 0.0 1.0
          0.2 0.2 0.2 0.2 0.2
1.0 0.0 1.0
        </DataArray>
1.0 1.0 1.0
        <DataArray type="Float32" Name="cell_normals" NumberOfComponents="3" format="ascii">
0.0 1.0 1.0
          0 0 1   0 0 1  0 0 1   0 0 1  0 0 1
POLYGONS 6 30
          0 0 1   0 0 1   0 0 1   0 0 1  0 0 1
4 0 1 2 3
          0 0 1   0 0 1   0 0 1  0 0 1  0 0 1
4 4 5 6 7
          0 0 1  0 0 1  0 0 1  0 0 1  0 0 1
4 0 1 5 4
          0 0 1  0 0 1  0 0 1  0 0 1  0 0 1
4 2 3 7 6
        </DataArray>
4 0 4 7 3
      </CellData>
4 1 2 6 5
      <PointData Scalars="colorful" Normals="magnify">
 
        <DataArray type="Float32" Name="colorful" format="ascii">
CELL_DATA 6
          0.2 0.2 0.2 0.2 0.2 0.2
SCALARS cell_scalars float 1
          0.2 0.4 0.6 0.6 0.4 0.2
LOOKUP_TABLE my_table
          0.2 0.6 0.8 0.8 0.6 0.2
0.14286
          0.2 0.6 0.8 0.8 0.6 0.2
0.28571
          0.2 0.4 0.6 0.6 0.4 0.2
0.42857
          0.2 0.2 0.2 0.2 0.2 0.2
0.57143
        </DataArray>
0.71429
        <DataArray type="Float32" Name="magnify" NumberOfComponents="3" format="ascii">
0.85714
          0 0 1   0 0 1   0 0 1   0 0 1 0 0 1 0 0 1
NORMALS cell_normals float
          0 0 1   0 0 0 0 0 0 0 0 1 0 0 1
0 0 1
          0 0 1   0 0 0 0 1  0 0 1 0 0 1  0 0 1
0 0 1
          0 0 1   0 0 1  0 0 1   0 0 1  0 0 1  0 0 1
0 -1 0
          0 0 1   0 0 1   0 0 1  0 0 1 0 0 1  0 0 1
0 1 0
          0 0 0 0 1   0 0 1   0 0 1 0 0 1  0 0 1
-1 0 0
        </DataArray>
1 0 0
      </PointData>
LOOKUP_TABLE my_table 8
      <Points>
0.0 0.0 0.0 1.0
        <DataArray type="Float32" NumberOfComponents="3" format="ascii">
1.0 0.0 0.0 1.0
        0 0 0 1 0 0 2 0 0 3 0 0 4 0 0 5 0 0
0.0 1.0 0.0 1.0
        0 1 0 1 1 0 2 1 0 3 1 0 4 1 0 5 1 0
1.0 1.0 0.0 1.0
        0 2 0 1 2 0 2 2 0 3 2 0 4 2 0 5 2 0
0.0 0.0 1.0 1.0
        0 3 0 1 3 0 2 3 0 3 3 0 4 3 0 5 3 0
1.0 0.0 1.0 1.0
        0 4 0 1 4 0 2 4 0 3 4 0 4 4 0 5 4 0
0.0 1.0 1.0 1.0
        0 5 0 1 5 0 2 5 0 3 5 0 4 5 0 5 5 0
1.0 1.0 1.0 1.0
        </DataArray>
      </Points>
      <Polys>
        <DataArray type="Int32" Name="connectivity" format="ascii">
          0 1  7  6  1  2  8  7  2  3  9  8  3  4 10  9  4  5 11 10
          6  7 13 12  7  8 14 13  8  9 15 14  9 10 16 15  10 11 17 16
          12 13 19 18  13 14 20 19  14 15 21 20  15 16 22 21  16 17 23 22
          18 19 25 24  19 20 26 25  20 21 27 26  21 22 28 27  22 23 29 28
          24 25 31 30  25 26 32 31  26 27 33 32  27 28 34 33  28 29 35 34
        </DataArray>
        <DataArray type="Int32" Name="offsets" format="ascii">
          4  8 12 16 20 24 28 32 36 40
        44 48 52 56 60 64 68 72 76 80
        84 88 92 96 100
        </DataArray>
      </Polys>
    </Piece>
  </PolyData>
</VTKFile>
</pre>
</pre>
</div>
</div>
Line 76: Line 60:
<table border="2" align="center">
<table border="2" align="center">
<tr>
<tr>
   <td align="center" rowspan="2">
   <td align="center" rowspan="1">
[[Image:WarpScalarPipeline.png|right|thumb|500px|Pipeline03]]
[[Image:LegacyExampleG_pipeline.png|right|thumb|400px|Simple Cube Example G]]
   </td>
   </td>
   <td align="center">
   <td align="center">
[[Image:WarpScalarImage.png|right|thumb|200px|Warp (Point Data) Image]]
[[Image:Screenshot08.png|right|thumb|200px|Simple Cube (Ex. G)]]
  </td>
</tr>
<tr>
  <td align="center">
[[Image:WarpScalarCellDataImage.png|right|thumb|200px|Warp (Cell Data) Image]]
   </td>
   </td>
</tr>
</tr>
</table>
</table>
</div>
</div>


=Related Discussions=
=Related Discussions=
* [[User:Tohline/vtk/Understanding#Understanding_vtk_Tools_Inside_VisTrails|Understanding vtk Tools Inside VisTrails]]
* [[User:Tohline/vtk/SimpleCubeTutorial#Other_Example_Input_Files_and_VisTrails_Pipelines|Other examples]] of properly formatted input data files
* [[User:Tohline/vtk/SimpleCubeTutorial/CubeDetails#Cube_Definition_Details|Cube Definition Details]]
* [[User:Tohline/vtk/SimpleCubeTutorial#Simple_Cube_Tutorial|Simple Cube Tutorial]]
* [[User:Tohline/vtk/ColorLookupTablea#Color_Lookup_Tables|Color Lookup Tables]]
** [[User:Tohline/vtk/SimpleCubeTutorial/CubeDetails#Cube_Definition_Details|Specifying Points (Vertices) and Polygons]] of a cube
* [http://www.bu.edu/tech/files/2010/10/VTK-Fall-2010.ppt Robert Putnam's (Boston University) powerpoint tutorial] -- includes a ''Structured_Points'' example, written in Simple Legacy Format
** [[User:Tohline/vtk/ColorLookupTablea#Color_Lookup_Tables|Defining Color Lookup Tables]]

Latest revision as of 18:40, 18 April 2014

Example Input Files & VisTrails Pipelines

Whitworth's (1981) Isothermal Free-Energy Surface
|   Tiled Menu   |   Tables of Content   |  Banner Video   |  Tohline Home Page   |

This is one example of an input data file that we have successfully used to generate a useful interactive rendering within VisTrails. The file illustrates VTK's Simple Legacy Format and the POLYDATA dataset format. To aid in implementation, we present the full ascii dataset, the resulting rendered image, and a screen shot of the VisTrails pipeline that was used to generate the image. This example (G) is very similar to the "Cube example" that is provided in §15.3 of the VTK User's Guide, authored and published by Kitware, Inc. (see especially pp. 331-332) and is one of many "simple cube" examples that have been discussed in detail in our accompanying Simple Cube Tutorial. A list of other example input data files is provided near the end of the tutorial.

Legacy Cube Example G

# vtk DataFile Version 2.0
Cube example
ASCII
DATASET POLYDATA
POINTS 8 float
0.0 0.0 0.0
1.0 0.0 0.0
1.0 1.0 0.0
0.0 1.0 0.0
0.0 0.0 1.0
1.0 0.0 1.0
1.0 1.0 1.0
0.0 1.0 1.0
POLYGONS 6 30
4 0 1 2 3
4 4 5 6 7
4 0 1 5 4
4 2 3 7 6
4 0 4 7 3
4 1 2 6 5

CELL_DATA 6
SCALARS cell_scalars float 1
LOOKUP_TABLE my_table
0.14286
0.28571
0.42857
0.57143
0.71429
0.85714
NORMALS cell_normals float
0 0 1
0 0 1
0 -1 0
0 1 0
-1 0 0
1 0 0
LOOKUP_TABLE my_table 8
0.0 0.0 0.0 1.0
1.0 0.0 0.0 1.0
0.0 1.0 0.0 1.0
1.0 1.0 0.0 1.0
0.0 0.0 1.0 1.0
1.0 0.0 1.0 1.0
0.0 1.0 1.0 1.0
1.0 1.0 1.0 1.0
Simple Cube Example G
Simple Cube (Ex. G)

Related Discussions