User:Tohline/vtk/Examples/XMLRectilinearGrid

From VistrailsWiki
< User:Tohline
Revision as of 21:33, 19 April 2014 by Tohline (talk | contribs) (Added Mexican Hat example)
Jump to navigation Jump to search

Example Input Files & VisTrails Pipelines

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

This is an example of an input data file that we have successfully used to generate a useful interactive rendering within VisTrails. The file illustrates the (structured) RectilinearGrid file type within the context of VTK's XML File Format. To aid in implementation, we present the full ascii dataset, two resulting rendered images, and a screen shot of the VisTrails pipeline that was used to generate the image. Note that the image captioned "Point Data" was generated, by default, while the image captioned "Cell Data" was generated after activating the SetScalarModeToUseCellData method within the vtkDataSetMapper module. Note, further, that the vertical "warping" of the configuration can be excluded — with the result being the rendering of a flat plane — by either:

  • Removing the vtkWarpScalar module from the VisTrails pipeline and connecting the vtkXMLRectilinearGridReader module directly to the vtkDataSetMapper module; or
  • Changing the floating-point value associated with the SetScaleFactor method inside the vtkWarpScalar method from 2.0 to 0.0.

A list of other example input data files is provided near the end of the same tutorial.

Important Note: By trial and error, I have discovered that the numerical values specified for "WholeExtent" and "Extent" inside the RectilinearGrid and Piece XML tags, respectively, must be provided in integer format!

XML (RectilinearGrid) Warped Quilt Example

<?xml version="1.0"?>
<VTKFile type="RectilinearGrid" version="0.1" byte_order="LittleEndian">
  <RectilinearGrid WholeExtent="0 5 0 5 0 0">
    <Piece Extent="0 5 0 5 0 0">
      <CellData Scalars="cell_scalars">
        <DataArray type="Float32" Name="cell_scalars" format="ascii">
          0.2 0.2 0.2 0.2 0.2
          0.2 0.4 0.6 0.4 0.2
          0.2 0.6 0.8 0.6 0.2
          0.2 0.4 0.6 0.4 0.2
          0.2 0.2 0.2 0.2 0.2
        </DataArray>
      </CellData>
      <PointData Scalars="colorful">
        <DataArray type="Float32" Name="colorful" format="ascii">
          0.2 0.2 0.2 0.2 0.2 0.2
          0.2 0.4 0.6 0.6 0.4 0.2
          0.2 0.6 0.8 0.8 0.6 0.2
          0.2 0.6 0.8 0.8 0.6 0.2
          0.2 0.4 0.6 0.6 0.4 0.2
          0.2 0.2 0.2 0.2 0.2 0.2
        </DataArray>
      </PointData>
      <Coordinates>
        <DataArray type="Float32" format="ascii" RangeMin="0" RangeMax="5">
          0.0 1.0 2.0 3.0 4.0 5.0
        </DataArray>
        <DataArray type="Float32" format="ascii" RangeMin="0" RangeMax="5">
          0.0 1.0 2.0 3.0 4.0 5.0
        </DataArray>
        <DataArray type="Float32" format="ascii">
          0.0
        </DataArray>
      </Coordinates>
    </Piece>
  </RectilinearGrid>
</VTKFile>


VisTrails Pipeline
Warp (Point Data) Image
Warp (Cell Data) Image


XML (RectilinearGrid) Mexican Hat Example

The relevant XML-formatted "Mexican Hat" input data file can be accessed at the following URL:

VisTrails Pipeline
Mexican Hat Image

Related Discussions