Difference between revisions of "User:Tohline/vtk/XYPlotTutorial"

From VistrailsWiki
Jump to navigation Jump to search
(Begin developing XYPlot tutorial)
 
Line 6: Line 6:
1. Inside VisTrails, open, then execute "xyPlot.vt" without making any changes to the default pipeline or to any module parameters:   
1. Inside VisTrails, open, then execute "xyPlot.vt" without making any changes to the default pipeline or to any module parameters:   
* Follow this directory path:  VisTrails/examples/vtk_examples/Annotation/xyPlot.vt
* Follow this directory path:  VisTrails/examples/vtk_examples/Annotation/xyPlot.vt
* Upon execution, the image that pops up in the VisTrails spreadsheet window will be totally orange (actually, the color is "tomato") and will not look like a cylinder.  This is because the default position of the camera places you inside the tomato-colored cylinder.
* The default workflow pipeline is shown in the top panel of the following figure.  Upon execution, the default composite image that pops up in the VisTrails spreadsheet window is shown in the bottom panel.
<table align="center">
<table align="center" border="1">
<tr>
<tr>
   <td align="center">
   <td align="center">
[[File:DefaultWorkflow.png|300px|Default Workflow]]
[[File:DefaultWorkflow.png|350px|Default Workflow]]
   </td>
   </td>
</tr>
<tr>
   <td align="center">
   <td align="center">
[[File:DefaultFigure.png|350px|Default Spreadsheet Figure]]
[[File:DefaultFigure.png|350px|Default Spreadsheet Figure]]
Line 17: Line 19:
</tr>
</tr>
</table>
</table>
* You can view the cylinder by placing your mouse cursor inside the relevant spreadsheet window and using the appropriate mouse control to "zoom out".  Then other mouse actions will let you spin the cylinder and/or move it side to side.
* The default image (left) and line-plots (right) displayed here in the bottom figure panel illustrate how the VTK library &#8212; and VisTrails, in particular &#8212; can be used to probe the properties of a three-dimensional scalar datasetAs can be deduced by alternately clicking on one, then the other, of the workflow's "unzip" methods, the ''particular'' datasets being analyzed are combq (containing the scalar data) and combxyz (containing grid information)This pair of ''binary'' datasets has been provided in a very strick format that is understood by the "PLOT3DReader"; they are used throughout the VTK textbook to illustrate a wide range of capabilities of the VTK library.  For example, [[User:Tohline/vtk/ColorLookupTablea#Generating_a_Broad_Range_of_Color_Table|as we have illustrated in a separate tutorial chapter]], they have been used to illustrate color mapping techniques.
 
* Notice that, inside the spreadsheet window, the segment of the displayed image that has a light blue background is "live;" that is, one can fly around or zoom into/out of the configuration with the appropriate mouse clicks and/or key strokes. In contrast to this, the set of three 2D line plots is stagnant.
[[Image:TomatoCylinder.jpg|right|thumb|100px|Cylinder01]]2Modify the initial camera position:
* Click on the "vtkCamera" module of the Cylinder.vt Pipeline; the "Methods" segment of the VisTrails Builder Window will list all of the methods that can be activated within the vtkCamera module.   
* Note that, in the bottom half of this "Methods" window segment, the "Zoom" method has already been activated with a value of 1.5.
* Scroll through the list of methods to find the "SetPosition" method; highlight that method and drag it into the bottom half (Set Methods) segment of the Methods window; three empty "Float" text windows will appear, allowing you to enter floating-point numbers to specify, respectively, the <math>x</math>, <math>y</math>, and <math>z</math> coordinates of the desired camera position.
* Type 5.0, 5.0, and 5.0 into the three "Float" text windows, then execute the Cylinder.vt Pipeline again; this should produce the tipped, 8-sided, tomato-colored cylinder (on a dark blue background) shown here as Fig. Cylinder01.
 


2.  Modify background colors:
* Looking near the bottom of the default workflow pipeline, we see that the spreadsheet window (generated by VTKCell) has been constructed by piecing together two separate ''renderings'':  the "vtkRenderer" on the left generates the left half of the composite image &#8212; that is, the ''live,'' 3D rendering on the light blue background &#8212; while the "vtkRenderer" on the right generates the three line plots on a white background.
* The default background colors that have been specified for these two separate renderings is revealed by clicking on either one of the two "vtkRender" modules:  The SetBackground method for the module on the left contains the RGB values (0.6784, 0.8471, 0.902) &#8212; which generates light blue &#8212; while the SetBackground method for the module on the right contains the RGB values (1,1,1) &#8212; which generates white.
* In order to play with background colors, change either &#8212; or both &#8212; background color specifications, then re-execute the workflow.


=Related Discussions=
=Related Discussions=
* [[User:Tohline/vtk/Understanding#Understanding_vtk_Tools_Inside_VisTrails|Understanding vtk Tools Inside VisTrails]]
* [[User:Tohline/vtk/Understanding#Understanding_vtk_Tools_Inside_VisTrails|Understanding vtk Tools Inside VisTrails]]

Revision as of 17:13, 10 September 2015

XY Plots Tutorial

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

Getting Started

Here we delve into §4.12 (p. 62) of the VTK User's Guide, authored and published by Kitware, Inc., in an effort to learn how to draw normal two-dimensional (XY) line plots.

1. Inside VisTrails, open, then execute "xyPlot.vt" without making any changes to the default pipeline or to any module parameters:

  • Follow this directory path: VisTrails/examples/vtk_examples/Annotation/xyPlot.vt
  • The default workflow pipeline is shown in the top panel of the following figure. Upon execution, the default composite image that pops up in the VisTrails spreadsheet window is shown in the bottom panel.

Default Workflow

Default Spreadsheet Figure

  • The default image (left) and line-plots (right) displayed here in the bottom figure panel illustrate how the VTK library — and VisTrails, in particular — can be used to probe the properties of a three-dimensional scalar dataset. As can be deduced by alternately clicking on one, then the other, of the workflow's "unzip" methods, the particular datasets being analyzed are combq (containing the scalar data) and combxyz (containing grid information). This pair of binary datasets has been provided in a very strick format that is understood by the "PLOT3DReader"; they are used throughout the VTK textbook to illustrate a wide range of capabilities of the VTK library. For example, as we have illustrated in a separate tutorial chapter, they have been used to illustrate color mapping techniques.
  • Notice that, inside the spreadsheet window, the segment of the displayed image that has a light blue background is "live;" that is, one can fly around or zoom into/out of the configuration with the appropriate mouse clicks and/or key strokes. In contrast to this, the set of three 2D line plots is stagnant.

2. Modify background colors:

  • Looking near the bottom of the default workflow pipeline, we see that the spreadsheet window (generated by VTKCell) has been constructed by piecing together two separate renderings: the "vtkRenderer" on the left generates the left half of the composite image — that is, the live, 3D rendering on the light blue background — while the "vtkRenderer" on the right generates the three line plots on a white background.
  • The default background colors that have been specified for these two separate renderings is revealed by clicking on either one of the two "vtkRender" modules: The SetBackground method for the module on the left contains the RGB values (0.6784, 0.8471, 0.902) — which generates light blue — while the SetBackground method for the module on the right contains the RGB values (1,1,1) — which generates white.
  • In order to play with background colors, change either — or both — background color specifications, then re-execute the workflow.

Related Discussions