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

From VistrailsWiki
Jump to navigation Jump to search
(Added Mexican Hat example)
(→‎XML (RectilinearGrid) Mexican Hat Example: Add note stating that input file was generated by Fortran90 code)
Line 85: Line 85:
[http://www.phys.lsu.edu/~tohline/vistrails/datafiles/mexicanHat.vtr http://www.phys.lsu.edu/~tohline/vistrails/datafiles/mexicanHat.vtr]
[http://www.phys.lsu.edu/~tohline/vistrails/datafiles/mexicanHat.vtr http://www.phys.lsu.edu/~tohline/vistrails/datafiles/mexicanHat.vtr]
</div>
</div>
Note that this "mexicanHat.vtr" ascii file was generated via a sequence of "write" statements inside a Fortran90 code.  This was done to demonstrate that even Fortran programmers can generate data files that are properly formatted for input into VisTrails.
   </td>
   </td>
</tr>
</tr>
Line 97: Line 98:
</table>
</table>
</div>
</div>
=Related Discussions=
=Related Discussions=
* [[User:Tohline/vtk/SimpleCubeTutorial#Other_Example_Input_Files_and_VisTrails_Pipelines|Other examples]] of properly formatted input data files
* [[User:Tohline/vtk/SimpleCubeTutorial#Other_Example_Input_Files_and_VisTrails_Pipelines|Other examples]] of properly formatted input data files

Revision as of 21:41, 19 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 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:

Note that this "mexicanHat.vtr" ascii file was generated via a sequence of "write" statements inside a Fortran90 code. This was done to demonstrate that even Fortran programmers can generate data files that are properly formatted for input into VisTrails.

VisTrails Pipeline
Mexican Hat Image

Related Discussions