https://public.kitware.com/Wiki/api.php?action=feedcontributions&user=Katie.osterdahl&feedformat=atomKitwarePublic - User contributions [en]2024-03-28T09:23:20ZUser contributionsMediaWiki 1.38.6https://public.kitware.com/Wiki/index.php?title=ParaView/Python_Scripting&diff=54169ParaView/Python Scripting2013-10-07T12:06:23Z<p>Katie.osterdahl: </p>
<hr />
<div>'''Katie O adding to ParaView Guide LaTex'''<br />
<br />
Note: This document if based on ParaView 3.6 or higher. If you are using 3.4, go to the history page and select the version from May 13, 2009.<br />
<br />
=ParaView and Python=<br />
ParaView offers rich scripting support through Python. This support is available as part of the ParaView client (paraview), an MPI-enabled batch application (pvbatch), the ParaView python client (pvpython), or any other Python-enabled application. Using Python, users and developers can gain access to the ParaView engine called Server Manager.<br />
<br />
Note: Server Manager is a library that is designed to make it easy to build distributed client-server applications.<br />
<br />
This document is a short introduction to ParaView's Python interface. You may also visit the [[Python recipes]] page for some examples.<br />
<br />
=Quick Start - a Tutorial=<br />
==Getting Started==<br />
<br />
To start interacting with the Server Manager, you have to load the "simple" module. This module can be loaded from any python interpreter as long as the necessary files are in PYTHONPATH. These files are the shared libraries located in the paraview binary directory and python modules in the paraview directory: ''paraview/simple.py'', ''paraview/vtk.py'' etc. You can also use either pvpython (for stand-alone or client/server execution), pvbatch (for non-interactive, distributed batch processing) or the python shell invoked from '''Tools'''|Python Shell using the ParaView client to execute Python scripts. You do not have to set PYTHONPATH when using these.<br />
<br />
This tutorial will be using the python integrated development environment IDLE. PYTHONPATH is set to the following: <br />
<br />
/Users/berk/work/paraview3-build/lib:/Users/berk/work/paraview3-build/lib/site-packages<br />
<br />
Note: For older versions of ParaView this was '' /Users/berk/work/paraview3-build/bin:/Users/berk/work/paraview3-build/Utilities/VTKPythonWrapping/site-packages'' --[[User:Andy.bauer|Andy.bauer]] 24 January 2013, or<br />
''/Users/berk/work/paraview3-build/bin:/Users/berk/work/paraview3-build/Utilities/VTKPythonWrapping'' --[[User:Andy.bauer|Andy.bauer]] 23 July 2010.<br />
<br />
You may also need to set your path variable for searching for shared libraries (i.e. PATH on Windows and LD_LIBRARY_PATH on Unix/Linux/Mac). The corresponding LD_LIBRARY_PATH would be:<br />
/Users/berk/work/paraview3-build/lib (/Users/berk/work/paraview3-build/bin for versions before 3.98)<br />
<br />
(Under WindowsXP for a debug build of paraview, set both PATH and PYTHONPATH environment variables to include ${BUILD}/lib/Debug and ${BUILD}/lib/site-packages to make it work.)<br />
<br />
When using a Mac to use the build tree in IDLE, start by loading the servermanager module:<br />
<br />
<source lang="python"><br />
>>> from paraview.simple import *<br />
</source><br />
<br />
Note: Importing the paraview module directly is deprecated, although still possible for backwards compatibility. This document refers to the simple module alone. <br />
<br />
In this example, we will use ParaView in the stand-alone mode. Connecting to a ParaView server running on a cluster is covered later in this document.<br />
<br />
===Tab-completion===<br />
<br />
The Python shell in the ParaView Qt client provides auto-completion. One can also use IDLE, for example to enable auto-completion. To use auto-completion in pvpython, one can use the tips provided at [http://www.razorvine.net/blog/user/irmen/article/2004-11-22/17].<br />
<br />
In summary, you need to create a variable PYTHONSTARTUP as (in bash):<br />
<br />
export PYTHONSTARTUP = /home/<username>/.pythonrc<br />
<br />
where .pythonrc is:<br />
<source lang="python"><br />
# ~/.pythonrc<br />
# enable syntax completion<br />
try:<br />
import readline<br />
except ImportError:<br />
print "Module readline not available."<br />
else:<br />
import rlcompleter<br />
readline.parse_and_bind("tab: complete")<br />
</source><br />
<br />
That is it. Tab completion works just as in any other shell.<br />
<br />
==Creating a Pipeline==<br />
<br />
The simple module contains many functions to instantiate sources, filters, and other related objects. You can get a list of objects this module can create from ParaView's online help (from help menu or here: http://paraview.org/OnlineHelpCurrent/)<br />
<br />
Start by creating a Cone object:<br />
<br />
<source lang="python"><br />
>>> cone = Cone()<br />
</source><br />
<br />
You can get some documentation about the cone object using help().<br />
<br />
<source lang="python"><br />
>>> help(cone)<br />
Help on Cone in module paraview.servermanager object:<br />
<br />
class Cone(SourceProxy)<br />
| The Cone source can be used to add a polygonal cone to the 3D scene. The output of the <br />
Cone source is polygonal data.<br />
| <br />
| Method resolution order:<br />
| Cone<br />
| SourceProxy<br />
| Proxy<br />
| __builtin__.object<br />
| <br />
| Methods defined here:<br />
| <br />
| Initialize = aInitialize(self, connection=None)<br />
| <br />
| ----------------------------------------------------------------------<br />
| Data descriptors defined here:<br />
| <br />
| Capping<br />
| If this property is set to 1, the base of the cone will be capped with a filled polygon. <br />
Otherwise, the base of the cone will be open.<br />
| <br />
| Center<br />
| This property specifies the center of the cone.<br />
| <br />
| Direction<br />
| Set the orientation vector of the cone. The vector does not have to be normalized. The cone <br />
will point in the direction specified.<br />
| <br />
| Height<br />
| This property specifies the height of the cone.<br />
| <br />
| Radius<br />
| This property specifies the radius of the base of the cone.<br />
| <br />
| Resolution<br />
| This property indicates the number of divisions around the cone. The higher this number, the <br />
closer the polygonal approximation will come to representing a cone, and the more polygons it will <br />
contain.<br />
| <br />
|... <br />
</source><br />
<br />
This gives you a full list of properties. Check what the resolution property is set to:<br />
<br />
<source lang="python"><br />
>>> cone.Resolution<br />
6<br />
</source><br />
<br />
You can increase the resolution as shown below:<br />
<br />
<source lang="python"><br />
>>> cone.Resolution = 32<br />
</source><br />
<br />
Alternatively, we could have specified a value for resolution when creating the object:<br />
<br />
<source lang="python"><br />
>>> cone = Cone(Resolution=32)<br />
</source><br />
<br />
You can assign values to any number of properties during construction using keyword arguments:<br />
You can also change the center.<br />
<br />
<source lang="python"><br />
>>> cone.Center<br />
[0.0, 0.0, 0.0]<br />
>>> cone.Center = [1, 2, 3]<br />
</source><br />
<br />
Vector properties such as this one support setting and retrieval of individual elements, as well as slices (ranges of elements):<br />
<br />
<source lang="python"><br />
>>> cone.Center[0:2] = [2, 4]<br />
>>> cone.Center<br />
[2.0, 4.0, 3.0]<br />
</source><br />
<br />
Next, apply a shrink filter to the cone:<br />
<br />
<source lang="python"><br />
>>> shrinkFilter = Shrink(cone)<br />
>>> shrinkFilter.Input<br />
<paraview.servermanager.Cone object at 0xaf701f0><br />
</source><br />
<br />
At this point, if you are interested in getting some information about the output of the shrink filter, you can force it to update (which will also cause the execution of the cone source). For details about VTK's demand-driven pipeline model used by ParaView, see one of the VTK books.<br />
<br />
<source lang="python"><br />
>>> shrinkFilter.UpdatePipeline()<br />
>>> shrinkFilter.GetDataInformation().GetNumberOfCells()<br />
33L<br />
>>> shrinkFilter.GetDataInformation().GetNumberOfPoints()<br />
128L<br />
</source><br />
<br />
We will cover the DataInformation class in more detail later.<br />
<br />
==Rendering==<br />
<br />
Now that you've created a small pipeline, render the result. You will need two objects to render the output of an algorithm in a scene: a representation and a view. A representation is responsible for taking a data object and rendering it in a view. A view is responsible for managing a render context and a collection of representations. Simple creates a view by default. The representation object is created automatically with Show().<br />
<br />
<source lang="python"><br />
>>> Show(shrinkFilter)<br />
>>> Render()<br />
</source><br />
<br />
Et voila:<br />
<br />
[[File:Servermanager_snapshot.png|thumb|center|800px|'''Figure 14.1''' Server manager snapshot]]<br />
<br />
In example Figure 14.1, the value returned by Cone() and Shrink() was assigned to Python variables and used to build the pipeline. ParaView keeps track of the last pipeline object created by the user. This allows you to accomplish everything you did above using the following code:<br />
<br />
<source lang="python"><br />
>>> from paraview.simple import *<br />
# Create a cone and assign it as the active object<br />
>>> Cone()<br />
<paraview.servermanager.Cone object at 0x2910f0><br />
# Set a property of the active object<br />
>>> SetProperties(Resolution=32)<br />
# Apply the shrink filter to the active object<br />
# Shrink is now active<br />
>>> Shrink() <br />
<paraview.servermanager.Shrink object at 0xaf64050><br />
# Show shrink<br />
>>> Show() <br />
<paraview.servermanager.UnstructuredGridRepresentation object at 0xaf57f90><br />
# Render the active view<br />
>>> Render() <br />
<paraview.servermanager.RenderView object at 0xaf57ff0><br />
</source><br />
<br />
This was a quick introduction to the paraview.simple module. In the following sections, we will discuss the Python interface in more detail and introduce more advanced concepts.<br />
<br />
=paraview.simple Module=<br />
<br />
The simple module is a ParaView component written using Python on top of the Server Manager C++ library. Its purpose is to make it easier to create ParaView data analysis and visualization pipelines using Python. The simple module can be loaded from Python interpreters running in several applications.<br />
<br />
* '''pvpython''': The pvpython application, distributed with the ParaView application suite, is a Python client to the ParaView servers. It supports interactive execution as well as batch execution.<br />
<br />
* '''pvbatch''': The pvbatch application, also distributed with the ParaView application suite, is a Python application designed to run batch scripts on distributed servers. When ParaView is compiled with MPI, pvbatch can be launched as an MPI program. In this mode, the first node will load a Python script specified as a command-line argument and execute it using a special built-in connection on all nodes. This application does not support interactive execution.<br />
<br />
* '''paraview''': Python scripts can be run from the paraview client using the Python shell that is invoked from '''Tools'''|Python Shell. The Python shell supports interactive mode as well as loading of scripts from file.<br />
<br />
* '''External Python interpreter''': Any Python-capable application can load the paraview.simple module if the right environment is configured. For this to work, you either have to install the paraview Python modules (including the right shared libraries) somewhere in sys.path or you have to set PYTHONPATH to point to the right locations. <br />
<br />
==Overview==<br />
<br />
The paraview.simple module contains several Python classes designed to be Python-friendly, as well as all classes wrapped from the C++ Server Manager library. The following sections cover the usage of this module and occasionally the paraview.servermanager module, which is lower level.<br />
<br />
==Connecting to a Server==<br />
<br />
ParaView can run in two modes: stand-alone and client/server where the server is usually a visualization cluster. In this section, we discuss how to establish a connection to a server when using ParaView in the client/server mode. If you are using the ParaView graphical interface, you should use Connect from the File menu to connect to a server. If you are using ParaView from a Python shell (not the Python console that is part of the graphical interface), you need to use ''servermanager.Connect()'' to connect a server. <em>Note: you cannot connect to the ParaView application from a stand-alone Python shell. You can only connect to a server.</em> This method takes four arguments, all of which have default values.<br />
<br />
<source lang="python"><br />
def Connect(ds_host=None, ds_port=11111, rs_host=None, rs_port=11111)<br />
</source><br />
<br />
When connecting to a server (pvserver), specify only the first two arguments. These are the server name (or IP address) and port number.<br />
<br />
When connecting to a data-server/render-server pair, you have to specify all four arguments. The first two are the host name (or IP address) and port number of the data server, the last two those of the render server.<br />
Here are some examples:<br />
<br />
<source lang="python"><br />
# Connect to pvserver running on amber1 (first node of our test cluster)<br />
# using the default port 11111<br />
>>> Connect(‘amber1’)<br />
<br />
# Connect to pvdataserver running on the amber cluster, pvrenderserver <br />
# running on Berk’s desktop<br />
>>> Connect(‘amber1’, 12000, ‘kamino’, 11111)<br />
</source><br />
<br />
Note: Connect() will return None on failure. To be safe, you should check the return value of Connect().<br />
<br />
==Getting Help==<br />
<br />
You can access the documentation of all Proxy types by using Python's built-in help.<br />
<br />
<source lang="python"><br />
>>> help(paraview.simple.Cone)<br />
Help on function CreateObject in module paraview.simple:<br />
<br />
CreateObject(*input, **params)<br />
The Cone source can be used to add a polygonal cone to the 3D scene. The output of the <br />
Cone source is polygonal data.<br />
</source><br />
<br />
To get the full documentation, you have to create an instance.<br />
<br />
<source lang="python"><br />
>>> c = Cone()<br />
>>> help(c)<br />
</source><br />
<br />
This documentation is automatically generated from the Server Manager configuration files. It is identical to the class documentation found under the ParaView Help menu, as well as here: http://paraview.org/OnlineHelpCurrent/. <br />
Beyond this document and the online help, there are a few useful documentation sources:<br />
<br />
* The ParaView Guide: http://www.kitware.com/products/paraviewguide.html<br />
<br />
* The ParaView Wiki: http://paraview.org/Wiki/ParaView<br />
<br />
* The ParaView source documentation: http://www.paraview.org/doc/ <br />
<br />
<br />
If you are interested in learning more about the Visualization Toolkit that is at the foundation of ParaView, visit http://vtk.org.<br />
<br />
=Proxies and Properties=<br />
==Proxies==<br />
<br />
The VTK Server Manager design uses the Proxy design pattern (''See Design Patterns: Elements of Reusable Object-Oriented Software by Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides for details''). Quoting from Wikipedia: “A proxy, in its most general form, is a class functioning as an interface to another thing. The other thing could be anything: a network connection, a large object in memory, a file, or some other resource that is expensive or impossible to duplicate”. In the case of Server Manager, a Proxy object acts as a proxy to one-or-more VTK objects. Most of the time, these are server-side objects and are distributed to the server nodes. Proxy objects allow you to interact with these objects as if you directly have access to them, manipulate them, and obtain information about them. When creating visualization pipelines, you create proxies instead of VTK objects. <br />
<br />
<source lang="python"><br />
>>> sphereSource = vtk.vtkSphereSource() # VTK-Python script<br />
<br />
>>> sphereSourceP = Sphere() # ParaView script<br />
</source><br />
<br />
A proxy also provides an interface to modify the properties of the objects it maintains. For example, instead of:<br />
<br />
<source lang="python"><br />
>>> sphereSource.SetCenter(1.0, 1.0, 0.0)<br />
</source><br />
<br />
you can write the following:<br />
<br />
<source lang="python"><br />
>>> sphere.Center = [1.0, 1.0, 0.0]<br />
</source><br />
<br />
When a pipeline object proxy is created, it is set as the active object. You can also set an object as the active one. This is equivalent to clicking-on an object in the pipeline browser.<br />
<br />
<source lang="python"><br />
>>> c = Cone()<br />
<paraview.servermanager.Cone object at 0xaf73090><br />
>>> GetActiveSource()<br />
<paraview.servermanager.Cone object at 0xaf73090><br />
>>> Shrink()<br />
<paraview.servermanager.Shrink object at 0xb4f8610><br />
# Make the cone active<br />
>>> SetActiveSource(c)<br />
</source><br />
<br />
When dealing with objects created through the graphical interface or by loading a state, it is useful to be able to search through existing pipeline objects. To accomplish this, you can use GetSources() and FindSource(). GetSources() returns a dictionary of (name, id) object pairs. Since multiple objects can have the same name, the (name,id) pair identifies objects uniquely. FindSource() returns an object given its name. If there are more than one objects with the same name, the first one is returned.<br />
<br />
<source lang="python"><br />
>>> Cone()<br />
<paraview.servermanager.Cone object at 0xaf73090><br />
>>> GetActiveSource()<br />
<paraview.servermanager.Cone object at 0xaf73090><br />
>>> Shrink()<br />
<paraview.servermanager.Shrink object at 0xb4f8610><br />
>>> SetActiveSource(c)<br />
</source><br />
<br />
To delete pipeline objects, you need to use the Delete() function. Simply letting a Python variable go out of scope is not enough to delete the object. Following the example above:<br />
<br />
<source lang="python"><br />
# Delete the cone source<br />
>>> Delete(c)<br />
# To fully remove the cone from memory, get rid of the<br />
# variable too<br />
>>> del c<br />
</source><br />
<br />
==Properties==<br />
<br />
Property objects are used to read and modify the properties of pipeline objects. Each proxy has a list of properties defined in the Server Manager configuration files. The property interface of the Server Manager C++ library is somewhat cumbersome. Here is how you can set the radius property of a sphere source:<br />
<br />
<source lang="python"><br />
>>> rp = sphere.GetProperty("Radius")<br />
>>> rp.SetElement(0, 2)<br />
1<br />
>>> sphere.UpdateProperty("Radius")<br />
</source><br />
<br />
The servermanager module makes property access much easier by defining Python property accessors for property objects:<br />
<br />
<source lang="python"><br />
>>> sphere.Radius = 3<br />
</source><br />
<br />
Here, Radius is a Python property which, when a value is assigned to it, calls sphere.SetPropertyWithName("Radius",3). Properties can also passed to the function creating the object:<br />
<br />
<source lang="python"><br />
>>> cone = Cone(Radius=0.5, Center=[1, 0.5, 0])<br />
<paraview.servermanager.Cone object at 0xaf73090><br />
</source><br />
<br />
You can also use the SetProperties() function to set property values.<br />
<br />
<source lang="python"><br />
>>> SetProperties(cone, Radius=0.2, Center=[2, 0.5, 0])<br />
</source><br />
<br />
If the first argument is not specified, the active object is used. You also use SetDisplayProperties() and SetViewProperties() to set display (representation) and view properties respectively.<br />
<br />
All Property classes define the following methods:<br />
<br />
* __len__() <br />
* __getitem__()<br />
* __setitem__()<br />
* __getslice__()<br />
* __setslice__()<br />
* GetData()<br />
* SetData(). <br />
<br />
Therefore, all of the following are supported:<br />
<br />
<source lang="python"><br />
>>> sphere.Center<br />
[0.0, 0.0, 0.0]<br />
>>> sphere.Center[0] = 1<br />
>>> sphere.Center[0:3] = [1,2,3]<br />
>>> sphere.Center[0:3]<br />
[1.0, 2.0, 3.0]<br />
>>> len(sphere.Center)<br />
3<br />
</source><br />
<br />
ProxyProperty and InputProperty also define<br />
<br />
* append()<br />
* __delitem__()<br />
* __delslice__()<br />
<br />
to support del() and append(), similar to Python list objects.<br />
<br />
VectorProperty is used for scalars, vectors and lists of integer and floating point numbers as well as <br />
strings. Most properties of this type are simple. Examples include ''Sphere.Radius'' (double scalar), ''Sphere.Center'' (vector of doubles), ''a2DGlyph.Filled'' (boolean), ''a2DGlyph.GlyphType'' (enumeration), ''a3DText.Text'' (string), and ''Contour.Isosurfaces'' (list of doubles). Some properties may be more complicated because they map to C++ methods with mixed argument types. Two good examples of this case are ''Glyph.Scalars'' and ''ExodusIIReader.PointVariables''.<br />
<br />
<source lang="python"><br />
>>> reader = ExodusIIReader(FileName='.../can.ex2')<br />
# These variables are currently selected<br />
>>> reader.PointVariables<br />
['DISPL', 'VEL', 'ACCL']<br />
# These are available in the file<br />
>>> reader.PointVariables.Available<br />
['DISPL', 'VEL', 'ACCL']<br />
# Enable the DISPL array only<br />
>>> reader.PointVariables = ['DISPL']<br />
# Force read<br />
>>> reader.UpdatePipeline()<br />
# Now check the output. Note: GlobalNodeId is generated automatically by the reader.<br />
>>> reader.PointData[:]<br />
[Array: GlobalNodeId, Array: PedigreeNodeId, Array: DISPL]<br />
</source><br />
<br />
This example demonstrates the use of ''ExodusIIReader.PointVariables''. This is a VectorProperty that represents a list of array names. The underlying C++ function has a signature of SetPointResultArrayStatus(const char* name, int flag). This method is usually called once per array to enable or disable it (i.e. to set whether the reader will read a particular array).<br />
<br />
Glyph.Scalars is a bit more complicated. This property allows the developer to select the scalar array with which to scale the glyphs.<br />
<br />
<source lang="python"><br />
>>> sph = Sphere()<br />
>>> elev=Elevation(sph)<br />
# Glyph the points of the sphere with spheres<br />
>>> glyph=Glyph(elev, GlyphType='Sphere')<br />
# Scale the glyph with the Elevation array<br />
>>> glyph.Scalars = 'Elevation'<br />
>>> glyph.Scalars<br />
['POINTS', 'Elevation']<br />
# The above shows the association of the array as well as its name.<br />
# In this case, the array is associated with POINTS as it has to be<br />
# since Glyph cannot scale by cell arrays. We could have done:<br />
>>> glyph.Scalars = ['POINTS', 'Elevation']<br />
# Enable scaling by scalars<br />
>>> glyph.ScaleMode = 'scalar'<br />
</source><br />
<br />
Here the property Scalars maps to SetInputArrayToProcess(int idx, int port, int connection, int fieldAssociation, const char *name), which has four integer arguments (some of which are enumeration) and one string argument (''see vtkAlgorithm documentation for details'').<br />
<br />
Properties are either regular (push) or information (pull) properties. Information properties do not have a VTK method associated with them and are responsible for getting information from the server. A good example of an information property is TimestepValues, which returns all time steps available in a file (if the reader supports time).<br />
<br />
<source lang="python"><br />
>>> reader = ExodusIIReader(FileName='.../can.ex2')<br />
>>> reader.TimestepValues<br />
[0.0, 0.00010007373930420727, 0.00019990510190837085, 0.00029996439116075635, 0.00040008654468692839,<br />
0.00049991923151537776, 0.00059993512695655227, 0.00070004, ...]<br />
</source><br />
<br />
You can obtain a list of properties a proxy supports by using ''help()''. However, this does not allow introspection programmatically. If you need to obtain information about a proxy’s properties programmatically, you can use a property iterator:<br />
<br />
<source lang="python"><br />
>>> for prop in glyph:<br />
print type(prop), prop.GetXMLLabel()<br />
<br />
<class 'paraview.servermanager.InputProperty'> Input<br />
<class 'paraview.servermanager.VectorProperty'> Maximum Number of Points<br />
<class 'paraview.servermanager.VectorProperty'> Random Mode<br />
<class 'paraview.servermanager.ArraySelectionProperty'> Scalars<br />
<class 'paraview.servermanager.ArraySelectionProperty'> Vectors<br />
<class 'paraview.servermanager.VectorProperty'> Orient<br />
<class 'paraview.servermanager.VectorProperty'> Set Scale Factor<br />
<class 'paraview.servermanager.EnumerationProperty'> Scale Mode<br />
<class 'paraview.servermanager.InputProperty'> Glyph Type<br />
<class 'paraview.servermanager.VectorProperty'> Mask Points<br />
</source><br />
<br />
The XMLLabel is the text display by the graphical user-interface. Note that there is a direct mapping from the XMLLabel to the property name. If you remove all spaces from the label, you get the property name. You can use the ''PropertyIterator'' object directly.<br />
<br />
<source lang="python"><br />
>>> it = iter(s)<br />
>>> for i in it:<br />
print it.GetKey(), it.GetProperty()<br />
</source><br />
<br />
==Domains==<br />
<br />
The Server Manager provides information about values that are valid for properties. The main use of this information is for the user-interface to provide good ranges and choices in enumeration. However, some of this information is also very useful for introspection. For example, enumeration properties look like simple integer properties unless a (value, name) pair is associated with them. The Server Manager uses Domain objects to store this information. The contents of domains may be loaded from xml configuration files or computed automatically. For example:<br />
<br />
<source lang="python"><br />
>>> s = Sphere()<br />
>>> Show(s)<br />
>>> dp = GetDisplayProperties(s)<br />
>>> dp.Representation<br />
'Surface'<br />
# The current representation type is Surface. What other types<br />
# are available?<br />
>>> dp.GetProperty("Representation").Available<br />
['Outline', 'Points', 'Wireframe', 'Surface', 'Surface With Edges']<br />
# Choose outline<br />
>>> dp.Representation = 'Outline'<br />
</source><br />
<br />
==Source Proxies==<br />
<br />
Source proxies are proxies that represent pipeline objects (''For more information about VTK pipelines, see the VTK books: http://vtk.org/buy-books.php''). They have special properties to connect them as well as special method to query the meta-data of their output. To connect a source proxy to another, use one of its input properties.<br />
<br />
<source lang="python"><br />
# Either<br />
>>> glyph = Glyph(elev)<br />
# or<br />
>>> glyph.Input = elev<br />
</source><br />
<br />
The SourceProxy class provides several additional properties and methods that are specific to pipelines (See vtkSMSourceProxy documentation for a full list).<br />
* '''UpdatePipelineInformation()''': This method calls UpdateInformation() on the VTK algorithm. It also calls UpdatePropertyInformation() to update any information properties.<br />
* '''UpdatePipeline()''': This method calls Update() on the VTK algorithm causing a pipeline execution if the pipeline changed. Another way of causing pipeline updates is to render. The render view updates all connected pipelines.<br />
* '''GetDataInformation()''': This method is used to obtain meta-data about one output. It is discussed further below.<br />
* PointData and CellData properties discussed below.<br />
<br />
There are two common ways of getting meta-data information from a proxy: information properties and DataInformation. Information properties are updated automatically every time UpdatePropertyInformation() and UpdatePipelineInformation() are called. All you have to do is read the data from the property as usual. To get a DataInformation object from a source proxy use ''GetDataInformation(port=0''). By default, this method returns data information for the first output. You can pass an optional port number to get information for another output. You can get detailed documentation on DataInformation by using help() and by reading online documentation for vtkPVDataInformation (''http://www.paraview.org/doc/nightly/html/classvtkPVDataInformation.html''). Here are the use of some common methods:<br />
<br />
<source lang="python"><br />
>>> di = glyph.GetDataInformation(0)<br />
>>> di<br />
<paraview.servermanager.DataInformation object at 0x2d0920d0><br />
>>> glyph.UpdatePipeline()<br />
# Get the data type.<br />
>>> di.GetDataClassName()<br />
'vtkPolyData'<br />
# Get information about point data. <br />
>>> pdi = di.PointData<br />
# We are now directly accessing the wrapper for a VTK class<br />
>>> len(pdi)<br />
1<br />
# Get information for a point array<br />
>>> ai = pdi[0]<br />
>>> ai.GetRange(0)<br />
(0.0, 0.5)<br />
</source><br />
<br />
When meta-data is not enough and you need access to the raw data, you can use Fetch() to bring it to the client side. Note that this function is provided by the servermanager module. Fetch() has three modes:<br />
<br />
*Append all of the data together and bring it to the client (only available for polygonal and unstructured datasets). Note: Do not do this if data is large otherwise the client will run out of memory.<br />
<br />
*Bring data from a given process to the client.<br />
<br />
*Use a reduction algorithm and bring its output to the client. For example, find the minimum value of an attribute.<br />
<br />
Here is a demonstration:<br />
<br />
<source lang="python"><br />
>>> from paraview.simple import *<br />
>>> Connect("kamino")<br />
Connection (kamino:11111)<br />
>>> s = Sphere()<br />
# Get the whole sphere. DO NOT DO THIS IF THE DATA IS LARGE otherwise<br />
# the client will run out of memory.<br />
>>> allsphere = servermanager.Fetch(s)<br />
getting appended<br />
use append poly data filter<br />
>>> allsphere.GetNumberOfPolys()<br />
96<br />
# Get the piece of the sphere on process 0.<br />
>>> onesphere = servermanager.Fetch(s, 0)<br />
getting node 0<br />
>>> onesphere.GetNumberOfPolys()<br />
48<br />
# Apply the elevation filter so that we have a useful scalar array.<br />
>>> elev = Elevation(s)<br />
# We will use the MinMax algorithm to compute the minimum value of<br />
# elevation. MinMax will be first applied on each processor. The results<br />
# will then be gathered to the first node. MinMax will be then applied<br />
# to the gathered results.<br />
# We first create MinMax without an input.<br />
>>> mm = MinMax(None)<br />
# Set it to compute min<br />
>>> mm.Operation = "MIN"<br />
# Get the minimum<br />
>>> mindata = servermanager.Fetch(elev, mm, mm)<br />
applying operation<br />
# The result is a vtkPolyData with one point<br />
>>> mindata.GetPointData().GetNumberOfArrays()<br />
2<br />
>>> a0 = mindata.GetPointData().GetArray(1)<br />
>>> a0.GetName()<br />
'Elevation'<br />
>>> a0.GetTuple1(0)<br />
0.0<br />
</source><br />
<br />
==Representations and Views==<br />
<br />
Once a pipeline is created, it can be rendered using representations and views. A view is essentially a “window” in which multiple representations can be displayed. When the view is a VTK view (such as RenderView), this corresponds to a collection of objects including vtkRenderers and a vtkRenderWindow. However, there is no requirement for a view to be a VTK view or to render anything. A representation is a collection of objects, usually a pipeline, that takes a data object, converts it to something that can be rendered, and renders it. When the view is a VTK view, this corresponds to a collection of objects including geometry filters, level-of-detail algorithms, vtkMappers and vtkActors. The simple module automatically creates a view after connecting to a server (including the built-in connection when using the stand-alone mode). Furthermore, the simple module creates a representation the first time a pipeline object is displayed with Show().<br />
It is easy to create new views.<br />
<br />
<source lang="python"><br />
>>> view = CreateRenderView()<br />
</source><br />
<br />
CreateRenderView() is a special method that creates the render view appropriate for the ActiveConnection (or for another connection specified as an argument). It returns a sub-class of Proxy. Like the constructor of Proxy, it can take an arbitrary number of keyword arguments to set initial values for properties. Note that ParaView makes the view that was created last the active view. When using Show() without a view argument, the pipeline is shown in the active view. You can get a list of views as well as the active view as follows:<br />
<br />
<source lang="python"><br />
>>> GetRenderViews()<br />
[<paraview.servermanager.RenderView object at 0xaf64ef0>, <paraview.servermanager.RenderView object at 0xaf64b70>]<br />
>>> GetActiveView()<br />
<paraview.servermanager.RenderView object at 0xaf64b70><br />
</source><br />
<br />
You can also change the active view using SetActiveView().<br />
<br />
Once you have a render view, you can use pass it to Show in order to select in which view a pipeline object is displayed. You can also pass it to Render() to select which view is rendered.<br />
<br />
<source lang="python"><br />
>>> Show(elev, GetRenderViews()[1])<br />
<paraview.servermanager.GeometryRepresentation object at 0xaf64e30><br />
>>> Render(GetRenderViews()[1])<br />
</source><br />
<br />
Notice that Show() returns a representation object (aka DisplayProperties in the simple module). This object can be used to manipulate how the pipeline object is displayed in the view. You can also access the display properties of an object using GetDisplayProperties().<br />
<br />
<source lang="python"><br />
>>> dp = GetDisplayProperties(elev)<br />
>>> dp<br />
<paraview.servermanager.GeometryRepresentation object at 0xaf649d0><br />
</source><br />
<br />
Display properties and views have a large number of documented properties some of which are poorly documented. We will cover some them here.<br />
<br />
<source lang="python"><br />
>>> from paraview.simple import *<br />
# Create a simple pipeline<br />
>>> sph = Sphere()<br />
>>> elev = Elevation(sph)<br />
>>> Show(elev)<br />
>>> Render()<br />
# Set the representation type of elev<br />
>>> dp = GetDisplayProperties(elev)<br />
>>> dp.Representation = 'Points'<br />
# Here is how you get the list of representation types<br />
>>> dp.GetProperty("Representation").Available<br />
['Outline', 'Points', 'Wireframe', 'Surface', 'Surface With Edges']<br />
>>> Render()<br />
# Change the representation to wireframe<br />
>>> dp.Representation = 'Wireframe'<br />
>>> Render()<br />
# Let’s get some information about the output of the elevation<br />
# filter. We want to color the representation by one of it’s<br />
# arrays.<br />
# Second array = Elevation. Interesting. Let’s use this one.<br />
>>> ai = elev.PointData[1]<br />
>>> ai.GetName()<br />
'Elevation'<br />
# What is its range?<br />
>>> ai.GetRange()<br />
(0.0, 0.5)<br />
# To color the representation by an array, we need to first create<br />
# a lookup table. We use the range of the Elevation array<br />
>>> dp.LookupTable = MakeBlueToRedLT(0, 0.5)<br />
>>> dp.ColorAttributeType = 'POINT_DATA'<br />
>>> dp.ColorArrayName = 'Elevation' # color by Elevation<br />
>>> Render()<br />
</source><br />
<br />
Here is the result:<br />
[[Image:SMView.png|thumb|center|800px|'''Figure 14.2''' Object displayed in a view]]<br />
<br />
<br />
Once you create a scene, you will probably want to interact with the camera and ResetCamera() is likely to be insufficient. In this case, you can directly get the camera from the view and manipulate it. GetActiveCamera() returns a VTK object (not a proxy) with which you can interact.<br />
<br />
<source lang="python"><br />
>>> camera = GetActiveCamera()<br />
>>> camera<br />
<libvtkCommonPython.vtkCamera vtkobject at 0xe290><br />
>>> camera.Elevation(45)<br />
>>> Render()<br />
</source><br />
<br />
Another common thing to do is to save the view as an image. For this purpose, you can use the WriteImage() method provided by the view:<br />
<br />
<source lang="python"><br />
>> WriteImage("/Users/berk/image.png")<br />
</source><br />
<br />
The resulting image.png looks like this. See the documentation for WriteImage() for details on choosing file type, as well as a magnification factor to save images larger than the view size.<br />
<br />
[[Image:Image.jpg|thumb|center|800px|'''Figure 14.3''' Saving a view as an image]]<br />
<br />
=Advanced Concepts=<br />
<br />
==Dealing with lookup tables==<br />
<br />
As shown earlier, you can use MakeBlueToRedLt(min, max) to create a lookup table. However, this simply creates a new lookup table that the GUI won't be aware of. In the ParaView Qt application, we have special lookup table management that ensures that the same lookup table is used for all arrays with same name and number of components. To reproduce the same behavior in Python, use GetLookupTableForArray().<br />
<br />
<source lang="python"><br />
def GetLookupTableForArray(arrayname, num_components, **params):<br />
"""Used to get an existing lookuptable for a array or to create one if none<br />
exists. Keyword arguments can be passed in to initialize the LUT if a new<br />
one is created. Returns the lookup table."""<br />
....<br />
</source><br />
<br />
This will create a new lookup table and associate it with that array, if none already exists. Any default arguments to be passed to the lookup table if a new one is created, can be specified as additional parameters. You can always change the properties on the lookup table returned by this function.<br />
<br />
<br />
<source lang="python"><br />
# To color the representation by an array, we need to first create<br />
# a lookup table. We use the range of the Elevation array<br />
>>> dp.LookupTable = GetLookupTableForArray("Elevation", 1,<br />
RGBPoints = [min, 0, 0, 1, max, 1, 0, 0],<br />
ColorSpace = "HSV")<br />
>>> dp.ColorAttributeType = 'POINT_DATA'<br />
>>> dp.ColorArrayName = 'Elevation' # color by Elevation<br />
>>> Render()<br />
</source><br />
<br />
==Loading State and Manipulating It==<br />
<br />
Let’s say you created a complicated visualization using the paraview application and now you want to make slight changes to it and run it in a loop as a batch script. What do you do? The best way of dealing with this is to save your visualization state and then load it from Python. Let’s say you have a state file saved as myteststate.pvsm:<br />
<br />
<source lang="python"><br />
>>> from paraview.simple import *<br />
# Load the state<br />
>>> servermanager.LoadState("/Users/berk/myteststate.pvsm")<br />
# Make sure that the view in the state is the active one<br />
>>> SetActiveView(GetRenderView())<br />
# Now render<br />
>>> Render()<br />
# Get the list of sources<br />
>>> GetSources()<br />
{('Sphere1', '5'): <paraview.servermanager.Sphere object at 0xaf80e30>, <br />
('Shrink1', '11'): <paraview.servermanager.Shrink object at 0xaf80df0>, <br />
('Cone1', '8'): <paraview.servermanager.Cone object at 0xaf80cf0>}<br />
# Change the resolution of the cone and render again<br />
>>> FindSource("Cone1").Resolution = 32<br />
>>> Render()<br />
</source><br />
<br />
You can also save state.<br />
<br />
<source lang="python"><br />
>>> from paraview.simple import *<br />
>>> sph = Sphere()<br />
>>> Render()<br />
>>> servermanager.SaveState("/Users/berk/pythonstate.pvsm")<br />
</source><br />
<br />
==Dealing with Time==<br />
<br />
If a reader or a filter supports time, it is easy to request a certain time step from Python. All time requests are set on views that then propagate them to the representations which then propagate them to the visualization pipeline. Here is an example demonstrating how a time request can be made:<br />
<br />
<source lang="python"><br />
>>> Show(ExodusIIReader(FileName=".../can.ex2"))<br />
>>> Render()<br />
# Get a nice view angle<br />
>>> cam = GetActiveCamera()<br />
>>> cam.Elevation(45)<br />
>>> Render()<br />
# Check the current view time<br />
>>> view = GetActiveView()<br />
>>> view.ViewTime<br />
0.0<br />
>>> reader = GetActiveSource()<br />
>>> reader.TimestepValues<br />
[0.0, 0.00010007373930420727, 0.00019990510190837085, <br />
0.00029996439116075635, 0.00040008654468692839, <br />
...]<br />
>>> tsteps = reader.TimestepValues<br />
# Let’s be fancy and use a time annotation filter. This will show the<br />
# current time value of the reader as text in the corner of the view.<br />
>>> annTime = AnnotateTimeFilter(reader)<br />
# Show the filter<br />
>>> Show(annTime)<br />
# Look at a few time steps. Note that the time value is requested not<br />
# the time step index.<br />
>>> view.ViewTime = tsteps[2]<br />
>>> Render()<br />
>>> view.ViewTime = tsteps[4]<br />
>>> Render()<br />
</source><br />
<br />
==Animating==<br />
<br />
Server Manager has a complicated animation engine based on keyframes and scenes. This section will introduce a few simple ways of animating your visualization. <br />
If you have a time-aware reader, you can animate it with AnimateReader().<br />
<br />
<source lang="python"><br />
>>> reader = ExodusIIReader(FileName=“.../can.ex2”)<br />
>>> Show(reader)<br />
>>> Render()<br />
>>> c = GetActiveCamera()<br />
>>> c.Elevation(95)<br />
# Animate over all time steps. Note that we are not passing the optional<br />
# 3rd argument here. If you pass a filename as the 3rd argument, <br />
# AnimateReader will create a movie.<br />
>>> AnimateReader(reader)<br />
# Save the animation to an avi file<br />
>>> AnimateReader(reader, filename=".../movie.avi")<br />
</source><br />
<br />
To animate properties other than time, you can use regular keyframes.<br />
<br />
'''''ParaView 3.8.0 and earlier'''''<br />
----<br />
<font color="blue">Although the following script will work with 3.8.1 and later, it's not the recommended way since the changes done so will not be reflected in the GUI. Refer to the following sub-section for the recommended style for 3.8.1 and later versions.</font><br />
<br />
<source lang="python"><br />
>>> Sphere()<br />
>>> Show()<br />
>>> Render()<br />
<br />
# Create an animation scene<br />
>>> scene = servermanager.animation.AnimationScene()<br />
# Add one view<br />
>>> scene.ViewModules = [GetActiveView()]<br />
<br />
# Create a cue to animate the StartTheta property<br />
>>> cue = servermanager.animation.KeyFrameAnimationCue()<br />
>>> cue.AnimatedProxy = GetActiveSource()<br />
>>> cue.AnimatedPropertyName = "StartTheta"<br />
# Add it to the scene's cues<br />
>>> scene.Cues = [cue]<br />
<br />
# Create 2 keyframes for the StartTheta track<br />
>>> keyf0 = servermanager.animation.CompositeKeyFrame()<br />
>>> keyf0.Interpolation = 'Ramp'<br />
# At time = 0, value = 0<br />
>>> keyf0.KeyTime = 0<br />
>>> keyf0.KeyValues= [0]<br />
<br />
>>> keyf1 = servermanager.animation.CompositeKeyFrame()<br />
# At time = 1.0, value = 200<br />
>>> keyf1.KeyTime = 1.0<br />
>>> keyf1.KeyValues= [200]<br />
<br />
# Add keyframes.<br />
>>> cue.KeyFrames = [keyf0, keyf1]<br />
<br />
>>> scene.Play()<br />
<br />
# Some properties you can change<br />
#<br />
# Number of frames used in Sequence mode<br />
# scene.NumberOfFrames = 100<br />
#<br />
# Or you can use real time mode<br />
# scene.PlayMode = 'Real Time'<br />
# scene.Duration = 20<br />
</source><br />
<br />
<br />
'''ParaView 3.8.1 onwards'''<br />
----<br />
<font color="blue">The following script will only work with ParaView versions 3.8.1 and later.<br />
It is now the recommended way for accessing animation scenes and tracks since the updates<br />
are reflected in the GUI when running through the Python shell from the ParaView application.<br />
</font><br />
<br />
<source lang="python"><br />
>>> Sphere()<br />
>>> Show()<br />
>>> Render()<br />
<br />
# Get the application-wide animation scene<br />
>>> scene = GetAnimationScene()<br />
<br />
# Get the animation track for animating "StartTheta" on the active source.<br />
# GetAnimationTrack() creates a new track if none exists.<br />
>>> cue = GetAnimationTrack("StartTheta")<br />
<br />
# Create 2 keyframes for the StartTheta track<br />
>>> keyf0 = CompositeKeyFrame()<br />
>>> keyf0.Interpolation = 'Ramp'<br />
# At time = 0, value = 0<br />
>>> keyf0.KeyTime = 0<br />
>>> keyf0.KeyValues= [0]<br />
<br />
>>> keyf1 = CompositeKeyFrame()<br />
# At time = 1.0, value = 200<br />
>>> keyf1.KeyTime = 1.0<br />
>>> keyf1.KeyValues= [200]<br />
<br />
# Add keyframes.<br />
>>> cue.KeyFrames = [keyf0, keyf1]<br />
<br />
>>> scene.Play()<br />
<br />
# Some properties you can change<br />
#<br />
# Number of frames used in Sequence mode<br />
# scene.NumberOfFrames = 100<br />
#<br />
# Or you can use real time mode<br />
# scene.PlayMode = 'Real Time'<br />
# scene.Duration = 20<br />
</source><br />
<br />
===GetAnimationTrack Usages===<br />
----<br />
<br />
<source lang="python"><br />
<br />
# Typical usage<br />
>>> track = GetAnimationTrack("Center", 0, sphere) or<br />
>>> track = GetAnimationTrack(sphere.GetProperty("Radius")) or<br />
<br />
# this returns the track to animate visibility of the active source in<br />
# all views.<br />
>>> track = GetAnimationTrack("Visibility")<br />
<br />
# For animating properties on implicit planes etc., use the following<br />
# signatures:<br />
>>> track = GetAnimationTrack(slice.SliceType.GetProperty("Origin"), 0) or<br />
>>> track = GetAnimationTrack("Origin", 0, slice.SliceType)<br />
<br />
</source><br />
<br />
==Loading Data Files==<br />
<br />
As seen throughout this document, you can always load a data file by explicitly creating the reader that can read the data file as follows:<br />
<br />
<source lang="python"><br />
>>> reader = ExodusIIReader(FileName=“.../can.ex2”)<br />
</source><br />
<br />
Alternatively, starting with ParaView 3.8, you can use OpenDataFile() function to let ParaView pick a reader using the extension of the file.<br />
<br />
<source lang="python"><br />
>>> reader = OpenDataFile(“.../can.ex2”)<br />
</source><br />
<br />
<br />
==Writing Data Files (ParaView 3.9 or later)==<br />
<br />
To create a writer to write the output from a source, one can use the following:<br />
<br />
<source lang="python"><br />
from paraview.simple import *<br />
<br />
# Specifying the source explicitly<br />
>>> writer= CreateWriter("/.../filename.vtk", source)<br />
<br />
# Using the active source<br />
>>> writer= CreateWriter("/.../filename.vtk")<br />
<br />
# Writing data from a particular output port<br />
>>> writer= CreateWriter("/.../filename.vtk", servermanager.OutputPort(source, 1))<br />
<br />
# Now one change change the ivars on the writer <br />
<br />
# To do the actual writing, use:<br />
>>> writer.UpdatePipeline()<br />
<br />
</source><br />
<br />
==Exporting CSV Data==<br />
<br />
To export a csv from the cell or point data associated with a source, one can use the following:<br />
<br />
<source lang="python"><br />
>>> writer = CreateWriter(".../foo.csv", source)<br />
>>> writer.FieldAssociation = "Points" # or "Cells"<br />
>>> writer.UpdatePipeline()<br />
>>> del writer<br />
</source><br />
<br />
==Updating View Layout==<br />
<br />
Starting with ParaView 3.14, Python scripts can be used to update view layout.<br />
<br />
Every tab in the central frame of the ParaView application is represented by '''layout''' proxy. To obtain a map of layout proxies present, use the GetLayouts().<br />
<br />
<source lang="python"><br />
>>> GetLayouts()<br />
{('ViewLayout1', '264'): <paraview.servermanager.ViewLayout object at 0x2e5b7d0>}<br />
</source><br />
<br />
To get the layout corresponding to the active view (or a particular view), use the GetLayout() function.<br />
<br />
<source lang="python"><br />
>>> GetLayout()<br />
<paraview.servermanager.ViewLayout object at 0x2e5b7d0><br />
>>><br />
>>> GetLayout(GetActiveView())<br />
<paraview.servermanager.ViewLayout object at 0x2e5b7d0><br />
</source><br />
<br />
To split the cell containing a particular view, either horizontally or vertically, use:<br />
<br />
<source lang="python"><br />
<br />
>>> layout.SplitViewVertical(view = GetActiveView())<br />
<br />
>>> layout.SplitViewHorizontal(view = GetActiveView(), fraction = 0.7)<br />
<br />
</source><br />
<br />
To resize a cell containing a particular view:<br />
<br />
<source lang="python"><br />
<br />
>>> location = layout.GetViewLocation(view)<br />
>>> layout.SetSplitFraction(location, 0.3)<br />
<br />
</source><br />
<br />
To maximize a particular view<br />
<source lang="python"><br />
<br />
>>> location = layout.GetViewLocation(view)<br />
>>> layout.MaximizeCell(location)<br />
<br />
</source><br />
<br />
There are a host of other methods that are available that can help with layout of the views. Refer to the API exposed by vtkSMViewLayoutProxy. The API is fully accessible through Python.<br />
<br />
To create a new tab, one can use the following piece of code:<br />
<br />
<source lang="python"><br />
<br />
new_layout = servermanager.misc.ViewLayout(registrationGroup="layouts")<br />
<br />
</source><br />
<br />
{{ParaView/Template/Footer}}</div>Katie.osterdahlhttps://public.kitware.com/Wiki/index.php?title=ParaView/Users_Guide/Loading_Plugins&diff=43665ParaView/Users Guide/Loading Plugins2011-10-07T13:17:59Z<p>Katie.osterdahl: </p>
<hr />
<div>== Loading Plugins ==<br />
There are three ways for loading plugins:<br />
<br />
* Using the GUI ('''Plugin Manager''')<br />
: Plugins can be loaded into ParaView using the '''Plugin Manager''' accessible from '''Tools | Manage Plugins/Extensions''' menu. The Plugin Manager has two sections for loading local plugins and remote plugins (enabled only when connected to a server). To load a plugin on the local as well as remote side, simply browse to the plugin shared library. If the loading is successful, the plugin will appear in the list of loaded plugins. The Plugin manager also lists the paths it searched to load plugins automatically.<br />
: The Plugin Manager remembers all loaded plugins, so next time to load the plugin, simply locate it in the list and click "Load Selected" button. <br />
: You can set up ParaView to automatically load the plugin at startup (in case of client-side plugins) or on connecting to the server (in case of server-side plugins) by checking the "Auto Load" checkbox on a loaded plugin.<br />
<table><br />
<tr><br />
<td><br />
[[Image:LocalPlugin_Manager.png|thumb|300px|'''Figure 16.1:''' Plugin Manager when not connected to a remote server, showing loaded plugins on the local site.''']]<br />
</td><br />
<td><br />
[[Image:RemotePlugin_Manager.png|thumb|300px|'''Figure 16.2:''' Plugin Manager when connected to a server showing loaded plugins on the local as well as remote sites.''']]<br />
</td><br />
</table><br />
* Using environment variable (Auto-loading plugins)<br />
: If one wants ParaView to automatically load a set of plugins on startup, one can use the '''PV_PLUGIN_PATH''' environment variable. '''PV_PLUGIN_PATH''' can be used to list a set of directories (separated by colon (:) or semi-colon (;)) which ParaView will search on startup to load plugins. This enviromnent variable needs to be set on both the client node to load local plugins as well as the remote server to load remote plugins. Note that plugins in PV_PLUGIN_PATH are always auto-loaded irrespective of the status of the "Auto Load" checkbox in the Plugin Manager.<br />
* Placing the plugins in a recognized location. Recognized locations are:<br />
** A plugins subdirectory beneath the directory containing the paraview client or server executables. This can be a system-wide location if installed as such.<br />
** A Plugins subdirectory in the user's home area. On Unix/Linux/Mac, $HOME/.config/ParaView/ParaView<version>/Plugins. On Windows %APPDATA$\ParaView\ParaView<version>\Plugins.</div>Katie.osterdahlhttps://public.kitware.com/Wiki/index.php?title=CoProcessing&diff=43664CoProcessing2011-10-07T13:16:47Z<p>Katie.osterdahl: </p>
<hr />
<div>== Background ==<br />
Several factors are driving the growth of simulations. Computational power of computer clusters is growing, while the price of individual computers is decreasing. Distributed computing techniques allow hundreds, or even thousands, of computer nodes to participate in a single simulation. The benefit of this computational power is that simulations are getting more accurate and useful for predicting complex phenomena. The downside to this growth is the enormous amounts of data that need to be saved and analyzed to determine the results of the simulation. The ability to generate data has outpaced our ability to save and analyze the data. This bottleneck is throttling our ability to benefit from our improved computing resources. Simulations save their states only very infrequently to minimize storage requirements. This coarse temporal sampling makes it difficult to notice some complex behavior. To get past this barrier, ParaView can now be easily used to integrate post-processing/visualization directly with simulation codes. This feature is called<br />
co-processing in ParaView and the difference between workflows when using co-processing can be seen in the figures below.<br />
[[File:FullWorkFlow.png|thumb|center|800px|'''Figure 15.1''' Full Workflow]]<br />
[[File:CoProcessingWorkFlow.png|thumb|center|800px|'''Figure 15.1''' Workflow With Co-Processing]]<br />
<br />
<br />
== Technical Objectives ==<br />
<br />
The main objective of the co-processing toolset is to integrate core data processing with the simulation to enable scalable data analysis,<br />
while also being simple to use for the analyst. The tool set has two main parts:<br />
<br />
* '''An extensible and flexible co-processing library''': The co-processing library was designed to be flexible enough to be embedded in various simulation codes with relative ease. This flexibility is critical, as a library that requires a lot of effort to embed cannot be successfully deployed in a large number of simulations. The co-processing library is also easily-extended so that users can deploy new analysis and visualization techniques to existing co-processing installations.<br />
<br />
* '''Configuration tools for co-processing configuration''': It is important for users to be able to configure the co-processor using graphical user interfaces that are part of their daily work-flow. <br />
<br />
Note: All of this must be done for large data. The co-processing library will almost always be run on a distributed system. For the largest simulations, the visualization of extracts may also require a distributed system (i.e. a visualization cluster).<br />
<br />
== Build Directions ==<br />
As mentioned above, the two components for doing co-processing are a client-side plugin and a server-side library. <br />
It is recommended that they be compiled separately, but from the same ParaView source<br />
revision/release. This is because currently the client-side configuration tools outputs Python<br />
code for the server-side library to use. Differing ParaView versions may have different<br />
Python interfaces to objects causing simulation co-processed runs to fail. <br />
<br />
==== ParaView Co-Processing Script Generator Plugin ====<br />
<br />
The plugin for generating Python scripts for co-processing is a client-side plugin. The CMake option<br />
to turn-on the script generator plugin is PARAVIEW_BUILD_PLUGIN_CoProcessingScriptGenerator. Note: since this<br />
is a client-side plugin, the PARAVIEW_BUILT_QT_GUI option must be on.<br />
<br />
==== Co-Processing Library ====<br />
<br />
The directions for building the co-processing library can be a bit more complex. We assume that<br />
it will be built on a cluster or supercomputer. Complexities may arise from having to build Mesa, use off-screen rendering, build<br />
static libraries, and/or [http://paraview.org/Wiki/Cross_compiling_ParaView3_and_VTK cross-compiling]. <br />
We won't go into those details here, but refer interested people to the [http://paraview.org/Wiki/ParaView ParaView] <br />
and [http://www.vtk.org/Wiki/VTK VTK] wikis.<br />
<br />
The additional flags that should be turned on for coprocessing include:<br />
* '''BUILD_SHARED_LIBS''': Should normally be set to ON unless you're compiling on a machine that doesn't support shared libs (e.g. IBM BG/L).<br />
* '''PARAVIEW_ENABLE_PYTHON''': Set to ON in order to use the scripts created from the co-processing plugin. Note: For the 3.10 release, this is not required to be on.<br />
* '''PARAVIEW_USE_MPI''': Set the ParaView server to use MPI to run in parallel. Also, check that the proper version of MPI is getting used.<br />
* '''CMAKE_BUILD_TYPE''': Should be set to Release in order to optimize the ParaView code.<br />
* '''PARAVIEW_ENABLE_COPROCESSING''': The CMake option to build the co-processing libraries. <br />
* '''BUILD_COPROCESSING_ADAPTORS''': The CMake option to turn on code that may be useful for creating the simulation code adaptor.<br />
* '''BUILD_FORTRAN_COPROCESSING_ADAPTORS''': The CMake option to turn-on code that may be useful for creating an adapter for a simulation code written in Fortran or C.<br />
* '''PYTHON_ENABLE_MODULE_vtkCoProcessorPython''': On by default.<br />
* '''BUILD_PYTHON_COPROCESSING_ADAPTOR''': Experimental code.<br />
<br />
If ParaView was build with python enabled, the co-processing library can be tested on the installed system with the CTest<br />
command ''ctest -R CoProcessing''. <br />
The CoProcessingTestPythonScript test does an actual coprocessing run and the CoProcessingPythonScriptGridPlot <br />
and CoProcessingPythonScriptPressurePlot test verify the output is correct. There are parallel versions of<br />
the coprocessing runs as well that run with multiple processes.In addition, looking at the code<br />
for this test is a useful beginning point for learning to use the co-processing library.<br />
<br />
If you are using Mesa, the following options should be used:<br />
* '''VTK_OPENGL_HAS_OSMESA''': Set to ON.<br />
* '''VTK_USE_X''': Set to OFF.<br />
* '''OSMESA_INCLUDE_DIR''' and '''OPENGL_INCLUDE_DIR''': Make sure these are not set to the OpenGL directory location of the header files.<br />
* '''OSMESA_LIBRARY''': Set this to the Mesa library.<br />
* '''OPENGL_gl_LIBRARY''' and '''OPENGL_glu_LIBRARY''': These should not be set.<br />
* '''VTK_USE_OFFSCREEN''': Set to ON<br />
<br />
== Running the Co-Processing Script Generator ==<br />
<br />
After starting the ParaView client, go to '''Tools'''|Manage Plugins, highlight CoProcessingPlugin, and click Load Selected. <br />
Alternatively, if you expect to be using this plugin often, you can tell ParaView to automatically load it by<br />
clicking to the left of CoProcessingPlugin to expand the list and choose the Auto Load option.<br />
This will add a CoProcessing and Writers menu to the GUI.<br />
<br />
Once the plugin is loaded, load a simulation result into ParaView that is similar to the run you wish to do<br />
co-processing with. Normally the result will be for a discretization of the same geometry and contain the same field variables <br />
(or at least all of the field variables you wish to examine) as the simulation grid that co-processing will be performed on.<br />
The only difference between these two grids will be that the grid used for the co-processing run will be at<br />
a much higher resolution. In the picture below, a pipeline is shown for a result from a PHASTA (A CFD code<br />
led by Ken Jansen at the University of Colorado) simulation <br />
of incompressible flow through an aortic aneurysm. The simulation results include the velocity and pressure fields, and<br />
was done on a grid with 235,282 cells and 45,175 points. It is important to use the same names for the <br />
field arrays as will be used in the grids the co-processing library will be working with.<br />
The filters specify which fields to use by their name and problems will occur if the filters cannot find the correct array.<br />
The pipeline computes the vorticity, takes 20 slices through the<br />
domain, and extracts the surface of the grid.<br />
<br />
[[File:phastaPipeline.jpg|thumb|center|800px|'''Figure 15.2''' Phasta Pipeline]]<br />
<br />
Once the pipeline is set-up, the writers must be added to use for the filters that results are desired from. This is done by<br />
selecting the appropriate writer to output the results from each desired filter. In this example, a ParallelPolyDataWriter<br />
is created for the Slice filter and the ExtractSurface filter. For the writer for the <br />
Slice filter we set the name of the file to be ''slice_%t.pvtp'' where %t will get replaced<br />
with the time step each time it is output. We also set the write frequency to be every fifth time step.<br />
Figure 15.3 below shows this.<br />
<br />
[[File:phastaPipelineWithWriters.jpg|thumb|center|800px|'''Figure 15.3''' Phasta Pipeline with Writers]]<br />
<br />
Similarly, we do the same for the writer for the ExtractSurface filter but we want to use a different file name<br />
and we can set a different write frequency if desired.<br />
<br />
Note that when we hit enter we get the error message ''Cannot show the data in the current view although the view<br />
reported that it can show the data.'' This message can be ignored and is already entered as a bug to fix in ParaView.<br />
<br />
The final step is to go through the CoProcessing->Export State wizard to associate the grid with a name that the python<br />
script uses and specify a file name for the script. The steps are:<br />
<br />
1. '''Export Co-Processing State''' Click Next to proceed.<br />
<br />
2. '''Select Simulation Inputs''' Choose which grids to use by highlighting the grid and clicking Add, then click Next.<br />
<br />
[[Image:cpExport1.jpg|400px]]<br />
<br />
3. '''Name Simulation Inputs''' Click in the boxes under ''Simulation Name'' and change the name to what you have named the grid in your adaptor. Our convention is to use "input" for simulations with a single grid or multiblock data set.<br />
<br />
[[Image:cpExport2.jpg|400px]]<br />
<br />
4. '''Configuration''' We usually want the full data and not just a picture of the results so for this we leave "Output rendering components i.e. views" unchecked and just hit Finish. <br />
<br />
[[Image:noRendering.png]] <br />
<br />
If we do want to output images in addition to any writers we may have specified, check "Output rendering components i.e. views" and fill in the proper information. Note that the image type is specified based on the file name extension and that %t will be replaced by the actual time step in the output file name. Additionally, if there are multiple views then %v will be replaced by the view index in the output file name. <br />
<br />
[[Image:outputRendering.png]]<br />
<br />
5. '''Save Server State:''' Specify the file name the script is to be saved as.<br />
<br />
The resulting python script should look something like:<br />
<br />
<source lang="python"><br />
try: paraview.simple<br />
except: from paraview.simple import *<br />
<br />
cp_writers = []<br />
<br />
def RequestDataDescription(datadescription):<br />
"Callback to populate the request for current timestep"<br />
timestep = datadescription.GetTimeStep()<br />
<br />
<br />
if (timestep % 5 == 0) or (timestep % 200 == 0) :<br />
datadescription.GetInputDescriptionByName('input').AllFieldsOn()<br />
datadescription.GetInputDescriptionByName('input').GenerateMeshOn()<br />
<br />
<br />
def DoCoProcessing(datadescription):<br />
"Callback to do co-processing for current timestep"<br />
global cp_writers<br />
cp_writers = []<br />
timestep = datadescription.GetTimeStep()<br />
<br />
grid5_0_vtu = CreateProducer( datadescription, "input" )<br />
<br />
GradientOfUnstructuredDataSet1 = GradientOfUnstructuredDataSet( guiName="GradientOfUnstructuredDataSet1", ScalarArray=['POINTS', 'velocity'], ResultArray<br />
Name='Vorticity', ComputeVorticity=1, FasterApproximation=0 )<br />
<br />
Slice2 = Slice( guiName="Slice2", SliceOffsetValues=[-10.23284210526316, -8.8684631578947375, -7.5040842105263152, -6.1397052631578966, -4.77532631578947<br />
43, -3.4109473684210529, -2.0465684210526316, -0.68218947368421201, 0.68218947368420935, 2.0465684210526316, 3.4109473684210521, 4.7753263157894743, 6.139705<br />
263157893, 7.5040842105263152, 8.8684631578947375, 10.23284210526316, 11.597221052631578, 12.961600000000001], SliceType="Plane" )<br />
<br />
SetActiveSource(GradientOfUnstructuredDataSet1)<br />
ExtractSurface1 = ExtractSurface( guiName="ExtractSurface1", PieceInvariant=1 )<br />
<br />
SetActiveSource(Slice2)<br />
ParallelPolyDataWriter3 = CreateWriter( XMLPPolyDataWriter, "slice_%t.pvtp", 5 )<br />
<br />
SetActiveSource(ExtractSurface1)<br />
ParallelPolyDataWriter2 = CreateWriter( XMLPPolyDataWriter, "surface_%t.pvtp", 200 )<br />
<br />
Slice2.SliceType.Origin = [-2.8049160242080688, 2.1192346811294556, 1.7417440414428711]<br />
Slice2.SliceType.Offset = 0.0<br />
Slice2.SliceType.Normal = [0.0, 0.0, 1.0]<br />
<br />
<br />
<br />
for writer in cp_writers:<br />
if timestep % writer.cpFrequency == 0:<br />
writer.FileName = writer.cpFileName.replace("%t", str(timestep))<br />
writer.UpdatePipeline()<br />
<br />
def CreateProducer(datadescription, gridname):<br />
"Creates a producer proxy for the grid"<br />
if not datadescription.GetInputDescriptionByName(gridname):<br />
raise RuntimeError, "Simulation input name '%s' does not exist" % gridname<br />
grid = datadescription.GetInputDescriptionByName(gridname).GetGrid()<br />
producer = TrivialProducer()<br />
producer.GetClientSideObject().SetOutput(grid)<br />
producer.UpdatePipeline()<br />
return producer<br />
<br />
<br />
def CreateWriter(proxy_ctor, filename, freq):<br />
global cp_writers<br />
writer = proxy_ctor()<br />
writer.FileName = filename<br />
writer.add_attribute("cpFrequency", freq)<br />
writer.add_attribute("cpFileName", filename)<br />
cp_writers.append(writer)<br />
return writer<br />
</source><br />
<br />
== Creating the Adaptor ==<br />
<br />
The largest amount of work in getting co-processing working with a simulation code is usually<br />
creating the adaptor that can pass a VTK data set or composite data set with fields specified<br />
over it. A simple view of the program control is<br />
<br />
[[File:CoProcessorFlow.png]]<br />
<br />
By doing it like this, there is minimal modification to the simulation code (only calls to the adaptor like Initialize, Finalize, and CoProcess). The adaptor deals with the coprocessing library as well as creating VTK data structures from the simulation code as needed. The general flow for the simulation code and where it calls the adaptor would look like:<br />
<br />
initialize coprocessor<br />
for i in number of time steps<br />
compute simulation information at time step i<br />
call coprocessing library<br />
coprocessing library determines if any coprocessing needs to be performed at time step i<br />
finalize coprocessor<br />
<br />
The interactions between the adaptor and ParaView are mostly done through the vtkCPProcessor class. <br />
Documentation for this and the other classes in the coprocessing library are in<br />
the ParaView online [http://www.paraview.org/ParaView3/Doc/Nightly/html/classes.html documentation] as well as grouped in a [http://www.paraview.org/ParaView3/Doc/Nightly/html/group__CoProcessing.html module]. Details on the specific steps are provided below. <br />
<br />
=== Initialize the Co-Processor ===<br />
To initialize the co-processor, a vtkCPProcessor object must be created. This object should not be deleted until the finalization step. After creating a vtkCPProcessor object, you must call vtkCPProcessor::Initialize() to initialize the coprocessing library. The next step is to create vtkCPPipeline objects. These objects are used to represent the VTK pipelines that will be used to generate the output data. Most users will probably only use the vtkCPPythonScriptPipeline class that derives from vtkCPPipeline since that pipeline is the one that is used with the python scripts generated from the coprocessing plugin. vtkCPPythonScriptPipeline::Initialize() takes in the python script name with the full path and sets up the ParaView python interpretor. <br />
<br />
=== Call the Co-Processor to Execute the Desired Filters ===<br />
Most users will have a single call to the adaptor at the end of each simulation time step. This will pass in the simulation data structures to create the VTK data structures from. The created VTK data structures will be an object that derives from vtkDataObject. First though we want to check if we actually need to do any co-processing during this call. The simulation code will not know this information. Because of this, the simulation code should call the adaptor every time step. The adaptor gets the information about what data is needed for executing the vtkCPPipelines for each call. This is done in vtkCPProcessor::RequestDataDescription() by going through all of the vtkCPPipeline objects and querying them for what is needed. vtkCPProcessor::RequestDataDescription() takes in a vtkCPDataDescription object that contains information about the current simulation time and time step. The method returns 0 if no coprocessing information needs to be computed during the call and 1 otherwise. If no coprocessing needs to be performed then the adaptor should return control back to the simulation code. <br />
<br />
If co-processing is requested then the adaptor needs to make sure that the VTK grids and fields are up to date. Upon return from vtkCPProcessor::RequestDataDescription(), the vtkCPDataDescription object will have information on what is needed by the pipelines in order to successfully execute them during this call to the adaptor. This information is stored for each co-processing input (the data objects that are given identifier names in the plugin) and accessed through the vtkCPDataDescription as vtkCPInputDataDescription objects. The vtkCPInputDataDescription objects specify whether or not they require a grid and if so which fields they require. These objects are also used to pass the VTK data objects created in the adaptor to the pipeline by using the vtkCPInputDataDescription::SetGrid() method. The final step in this call to the adaptor is then to perform the actual co-processing by calling the vtkCPProcessor::CoProcess() method.<br />
<br />
=== Finalize the Co-Processor ===<br />
Finalization entails calling vtkCPProcessor::Finalize() and cleaning up any remaining VTK objects by calling Delete();<br />
<br />
<br />
----<br />
<br />
While initially there may seem to be a significant hurdle to overcome in order to implement the adaptor for co-processing, the user only needs to know enough information to create the VTK data objects from their own simulation data structures. The adaptor can be made computationally efficient by taking advantage of intimate knowledge of the simulation code and knowing that VTK filters will not modify input data. Examples include:<br />
* Only creating the VTK grid in the first call to the adaptor if the grid is not changing topologically or geometrically.<br />
* Using the SetArray() method to build vtkDataArray objects that use existing memory used by the simulation code instead of allocating and copying existing memory. <br />
<br />
Finally, we suggest looking at either the C++ [[coprocessing example]] and/or the [[python coprocessing example]] to see how the entire co-processing flow works. Additonally, the code in<br />
ParaView3/CoProcessing/CoProcessor/Testing/Cxx/PythonScriptCoProcessingExample.cxx is also worth a look.<br />
This is used to test the co-processing library and can be run with the command "ctest -R CoProcessing".</div>Katie.osterdahlhttps://public.kitware.com/Wiki/index.php?title=CoProcessing&diff=43663CoProcessing2011-10-07T13:15:12Z<p>Katie.osterdahl: </p>
<hr />
<div>== Background ==<br />
Several factors are driving the growth of simulations. Computational power of computer clusters is growing, while the price of individual computers is decreasing. Distributed computing techniques allow hundreds, or even thousands, of computer nodes to participate in a single simulation. The benefit of this computational power is that simulations are getting more accurate and useful for predicting complex phenomena. The downside to this growth is the enormous amounts of data that need to be saved and analyzed to determine the results of the simulation. The ability to generate data has outpaced our ability to save and analyze the data. This bottleneck is throttling our ability to benefit from our improved computing resources. Simulations save their states only very infrequently to minimize storage requirements. This coarse temporal sampling makes it difficult to notice some complex behavior. To get past this barrier, ParaView can now be easily used to integrate post-processing/visualization directly with simulation codes. This feature is called<br />
co-processing in ParaView and the difference between workflows when using co-processing can be seen in the figures below.<br />
[[File:FullWorkFlow.png|thumb|center|800px|'''Figure 15.1''' Full Workflow]]<br />
[[File:CoProcessingWorkFlow.png|thumb|center|800px|'''Figure 15.2''' Workflow With Co-Processing]]<br />
<br />
<br />
== Technical Objectives ==<br />
<br />
The main objective of the co-processing toolset is to integrate core data processing with the simulation to enable scalable data analysis,<br />
while also being simple to use for the analyst. The tool set has two main parts:<br />
<br />
* '''An extensible and flexible co-processing library''': The co-processing library was designed to be flexible enough to be embedded in various simulation codes with relative ease. This flexibility is critical, as a library that requires a lot of effort to embed cannot be successfully deployed in a large number of simulations. The co-processing library is also easily-extended so that users can deploy new analysis and visualization techniques to existing co-processing installations.<br />
<br />
* '''Configuration tools for co-processing configuration''': It is important for users to be able to configure the co-processor using graphical user interfaces that are part of their daily work-flow. <br />
<br />
Note: All of this must be done for large data. The co-processing library will almost always be run on a distributed system. For the largest simulations, the visualization of extracts may also require a distributed system (i.e. a visualization cluster).<br />
<br />
== Build Directions ==<br />
As mentioned above, the two components for doing co-processing are a client-side plugin and a server-side library. <br />
It is recommended that they be compiled separately, but from the same ParaView source<br />
revision/release. This is because currently the client-side configuration tools outputs Python<br />
code for the server-side library to use. Differing ParaView versions may have different<br />
Python interfaces to objects causing simulation co-processed runs to fail. <br />
<br />
==== ParaView Co-Processing Script Generator Plugin ====<br />
<br />
The plugin for generating Python scripts for co-processing is a client-side plugin. The CMake option<br />
to turn-on the script generator plugin is PARAVIEW_BUILD_PLUGIN_CoProcessingScriptGenerator. Note: since this<br />
is a client-side plugin, the PARAVIEW_BUILT_QT_GUI option must be on.<br />
<br />
==== Co-Processing Library ====<br />
<br />
The directions for building the co-processing library can be a bit more complex. We assume that<br />
it will be built on a cluster or supercomputer. Complexities may arise from having to build Mesa, use off-screen rendering, build<br />
static libraries, and/or [http://paraview.org/Wiki/Cross_compiling_ParaView3_and_VTK cross-compiling]. <br />
We won't go into those details here, but refer interested people to the [http://paraview.org/Wiki/ParaView ParaView] <br />
and [http://www.vtk.org/Wiki/VTK VTK] wikis.<br />
<br />
The additional flags that should be turned on for coprocessing include:<br />
* '''BUILD_SHARED_LIBS''': Should normally be set to ON unless you're compiling on a machine that doesn't support shared libs (e.g. IBM BG/L).<br />
* '''PARAVIEW_ENABLE_PYTHON''': Set to ON in order to use the scripts created from the co-processing plugin. Note: For the 3.10 release, this is not required to be on.<br />
* '''PARAVIEW_USE_MPI''': Set the ParaView server to use MPI to run in parallel. Also, check that the proper version of MPI is getting used.<br />
* '''CMAKE_BUILD_TYPE''': Should be set to Release in order to optimize the ParaView code.<br />
* '''PARAVIEW_ENABLE_COPROCESSING''': The CMake option to build the co-processing libraries. <br />
* '''BUILD_COPROCESSING_ADAPTORS''': The CMake option to turn on code that may be useful for creating the simulation code adaptor.<br />
* '''BUILD_FORTRAN_COPROCESSING_ADAPTORS''': The CMake option to turn-on code that may be useful for creating an adapter for a simulation code written in Fortran or C.<br />
* '''PYTHON_ENABLE_MODULE_vtkCoProcessorPython''': On by default.<br />
* '''BUILD_PYTHON_COPROCESSING_ADAPTOR''': Experimental code.<br />
<br />
If ParaView was build with python enabled, the co-processing library can be tested on the installed system with the CTest<br />
command ''ctest -R CoProcessing''. <br />
The CoProcessingTestPythonScript test does an actual coprocessing run and the CoProcessingPythonScriptGridPlot <br />
and CoProcessingPythonScriptPressurePlot test verify the output is correct. There are parallel versions of<br />
the coprocessing runs as well that run with multiple processes.In addition, looking at the code<br />
for this test is a useful beginning point for learning to use the co-processing library.<br />
<br />
If you are using Mesa, the following options should be used:<br />
* '''VTK_OPENGL_HAS_OSMESA''': Set to ON.<br />
* '''VTK_USE_X''': Set to OFF.<br />
* '''OSMESA_INCLUDE_DIR''' and '''OPENGL_INCLUDE_DIR''': Make sure these are not set to the OpenGL directory location of the header files.<br />
* '''OSMESA_LIBRARY''': Set this to the Mesa library.<br />
* '''OPENGL_gl_LIBRARY''' and '''OPENGL_glu_LIBRARY''': These should not be set.<br />
* '''VTK_USE_OFFSCREEN''': Set to ON<br />
<br />
== Running the Co-Processing Script Generator ==<br />
<br />
After starting the ParaView client, go to '''Tools'''|Manage Plugins, highlight CoProcessingPlugin, and click Load Selected. <br />
Alternatively, if you expect to be using this plugin often, you can tell ParaView to automatically load it by<br />
clicking to the left of CoProcessingPlugin to expand the list and choose the Auto Load option.<br />
This will add a CoProcessing and Writers menu to the GUI.<br />
<br />
Once the plugin is loaded, load a simulation result into ParaView that is similar to the run you wish to do<br />
co-processing with. Normally the result will be for a discretization of the same geometry and contain the same field variables <br />
(or at least all of the field variables you wish to examine) as the simulation grid that co-processing will be performed on.<br />
The only difference between these two grids will be that the grid used for the co-processing run will be at<br />
a much higher resolution. In the picture below, a pipeline is shown for a result from a PHASTA (A CFD code<br />
led by Ken Jansen at the University of Colorado) simulation <br />
of incompressible flow through an aortic aneurysm. The simulation results include the velocity and pressure fields, and<br />
was done on a grid with 235,282 cells and 45,175 points. It is important to use the same names for the <br />
field arrays as will be used in the grids the co-processing library will be working with.<br />
The filters specify which fields to use by their name and problems will occur if the filters cannot find the correct array.<br />
The pipeline computes the vorticity, takes 20 slices through the<br />
domain, and extracts the surface of the grid.<br />
<br />
[[File:phastaPipeline.jpg|thumb|center|800px|'''Figure 15.3''' Phasta Pipeline]]<br />
<br />
Once the pipeline is set-up, the writers must be added to use for the filters that results are desired from. This is done by<br />
selecting the appropriate writer to output the results from each desired filter. In this example, a ParallelPolyDataWriter<br />
is created for the Slice filter and the ExtractSurface filter. For the writer for the <br />
Slice filter we set the name of the file to be ''slice_%t.pvtp'' where %t will get replaced<br />
with the time step each time it is output. We also set the write frequency to be every fifth time step.<br />
Figure 15.4 below shows this.<br />
<br />
[[File:phastaPipelineWithWriters.jpg|thumb|center|800px|'''Figure 15.4''' Phasta Pipeline with Writers]]<br />
<br />
Similarly, we do the same for the writer for the ExtractSurface filter but we want to use a different file name<br />
and we can set a different write frequency if desired.<br />
<br />
Note that when we hit enter we get the error message ''Cannot show the data in the current view although the view<br />
reported that it can show the data.'' This message can be ignored and is already entered as a bug to fix in ParaView.<br />
<br />
The final step is to go through the CoProcessing->Export State wizard to associate the grid with a name that the python<br />
script uses and specify a file name for the script. The steps are:<br />
<br />
1. '''Export Co-Processing State''' Click Next to proceed.<br />
<br />
2. '''Select Simulation Inputs''' Choose which grids to use by highlighting the grid and clicking Add, then click Next.<br />
<br />
[[Image:cpExport1.jpg|400px]]<br />
<br />
3. '''Name Simulation Inputs''' Click in the boxes under ''Simulation Name'' and change the name to what you have named the grid in your adaptor. Our convention is to use "input" for simulations with a single grid or multiblock data set.<br />
<br />
[[Image:cpExport2.jpg|400px]]<br />
<br />
4. '''Configuration''' We usually want the full data and not just a picture of the results so for this we leave "Output rendering components i.e. views" unchecked and just hit Finish. <br />
<br />
[[Image:noRendering.png]] <br />
<br />
If we do want to output images in addition to any writers we may have specified, check "Output rendering components i.e. views" and fill in the proper information. Note that the image type is specified based on the file name extension and that %t will be replaced by the actual time step in the output file name. Additionally, if there are multiple views then %v will be replaced by the view index in the output file name. <br />
<br />
[[Image:outputRendering.png]]<br />
<br />
5. '''Save Server State:''' Specify the file name the script is to be saved as.<br />
<br />
The resulting python script should look something like:<br />
<br />
<source lang="python"><br />
try: paraview.simple<br />
except: from paraview.simple import *<br />
<br />
cp_writers = []<br />
<br />
def RequestDataDescription(datadescription):<br />
"Callback to populate the request for current timestep"<br />
timestep = datadescription.GetTimeStep()<br />
<br />
<br />
if (timestep % 5 == 0) or (timestep % 200 == 0) :<br />
datadescription.GetInputDescriptionByName('input').AllFieldsOn()<br />
datadescription.GetInputDescriptionByName('input').GenerateMeshOn()<br />
<br />
<br />
def DoCoProcessing(datadescription):<br />
"Callback to do co-processing for current timestep"<br />
global cp_writers<br />
cp_writers = []<br />
timestep = datadescription.GetTimeStep()<br />
<br />
grid5_0_vtu = CreateProducer( datadescription, "input" )<br />
<br />
GradientOfUnstructuredDataSet1 = GradientOfUnstructuredDataSet( guiName="GradientOfUnstructuredDataSet1", ScalarArray=['POINTS', 'velocity'], ResultArray<br />
Name='Vorticity', ComputeVorticity=1, FasterApproximation=0 )<br />
<br />
Slice2 = Slice( guiName="Slice2", SliceOffsetValues=[-10.23284210526316, -8.8684631578947375, -7.5040842105263152, -6.1397052631578966, -4.77532631578947<br />
43, -3.4109473684210529, -2.0465684210526316, -0.68218947368421201, 0.68218947368420935, 2.0465684210526316, 3.4109473684210521, 4.7753263157894743, 6.139705<br />
263157893, 7.5040842105263152, 8.8684631578947375, 10.23284210526316, 11.597221052631578, 12.961600000000001], SliceType="Plane" )<br />
<br />
SetActiveSource(GradientOfUnstructuredDataSet1)<br />
ExtractSurface1 = ExtractSurface( guiName="ExtractSurface1", PieceInvariant=1 )<br />
<br />
SetActiveSource(Slice2)<br />
ParallelPolyDataWriter3 = CreateWriter( XMLPPolyDataWriter, "slice_%t.pvtp", 5 )<br />
<br />
SetActiveSource(ExtractSurface1)<br />
ParallelPolyDataWriter2 = CreateWriter( XMLPPolyDataWriter, "surface_%t.pvtp", 200 )<br />
<br />
Slice2.SliceType.Origin = [-2.8049160242080688, 2.1192346811294556, 1.7417440414428711]<br />
Slice2.SliceType.Offset = 0.0<br />
Slice2.SliceType.Normal = [0.0, 0.0, 1.0]<br />
<br />
<br />
<br />
for writer in cp_writers:<br />
if timestep % writer.cpFrequency == 0:<br />
writer.FileName = writer.cpFileName.replace("%t", str(timestep))<br />
writer.UpdatePipeline()<br />
<br />
def CreateProducer(datadescription, gridname):<br />
"Creates a producer proxy for the grid"<br />
if not datadescription.GetInputDescriptionByName(gridname):<br />
raise RuntimeError, "Simulation input name '%s' does not exist" % gridname<br />
grid = datadescription.GetInputDescriptionByName(gridname).GetGrid()<br />
producer = TrivialProducer()<br />
producer.GetClientSideObject().SetOutput(grid)<br />
producer.UpdatePipeline()<br />
return producer<br />
<br />
<br />
def CreateWriter(proxy_ctor, filename, freq):<br />
global cp_writers<br />
writer = proxy_ctor()<br />
writer.FileName = filename<br />
writer.add_attribute("cpFrequency", freq)<br />
writer.add_attribute("cpFileName", filename)<br />
cp_writers.append(writer)<br />
return writer<br />
</source><br />
<br />
== Creating the Adaptor ==<br />
<br />
The largest amount of work in getting co-processing working with a simulation code is usually<br />
creating the adaptor that can pass a VTK data set or composite data set with fields specified<br />
over it. A simple view of the program control is<br />
<br />
[[File:CoProcessorFlow.png]]<br />
<br />
By doing it like this, there is minimal modification to the simulation code (only calls to the adaptor like Initialize, Finalize, and CoProcess). The adaptor deals with the coprocessing library as well as creating VTK data structures from the simulation code as needed. The general flow for the simulation code and where it calls the adaptor would look like:<br />
<br />
initialize coprocessor<br />
for i in number of time steps<br />
compute simulation information at time step i<br />
call coprocessing library<br />
coprocessing library determines if any coprocessing needs to be performed at time step i<br />
finalize coprocessor<br />
<br />
The interactions between the adaptor and ParaView are mostly done through the vtkCPProcessor class. <br />
Documentation for this and the other classes in the coprocessing library are in<br />
the ParaView online [http://www.paraview.org/ParaView3/Doc/Nightly/html/classes.html documentation] as well as grouped in a [http://www.paraview.org/ParaView3/Doc/Nightly/html/group__CoProcessing.html module]. Details on the specific steps are provided below. <br />
<br />
=== Initialize the Co-Processor ===<br />
To initialize the co-processor, a vtkCPProcessor object must be created. This object should not be deleted until the finalization step. After creating a vtkCPProcessor object, you must call vtkCPProcessor::Initialize() to initialize the coprocessing library. The next step is to create vtkCPPipeline objects. These objects are used to represent the VTK pipelines that will be used to generate the output data. Most users will probably only use the vtkCPPythonScriptPipeline class that derives from vtkCPPipeline since that pipeline is the one that is used with the python scripts generated from the coprocessing plugin. vtkCPPythonScriptPipeline::Initialize() takes in the python script name with the full path and sets up the ParaView python interpretor. <br />
<br />
=== Call the Co-Processor to Execute the Desired Filters ===<br />
Most users will have a single call to the adaptor at the end of each simulation time step. This will pass in the simulation data structures to create the VTK data structures from. The created VTK data structures will be an object that derives from vtkDataObject. First though we want to check if we actually need to do any co-processing during this call. The simulation code will not know this information. Because of this, the simulation code should call the adaptor every time step. The adaptor gets the information about what data is needed for executing the vtkCPPipelines for each call. This is done in vtkCPProcessor::RequestDataDescription() by going through all of the vtkCPPipeline objects and querying them for what is needed. vtkCPProcessor::RequestDataDescription() takes in a vtkCPDataDescription object that contains information about the current simulation time and time step. The method returns 0 if no coprocessing information needs to be computed during the call and 1 otherwise. If no coprocessing needs to be performed then the adaptor should return control back to the simulation code. <br />
<br />
If co-processing is requested then the adaptor needs to make sure that the VTK grids and fields are up to date. Upon return from vtkCPProcessor::RequestDataDescription(), the vtkCPDataDescription object will have information on what is needed by the pipelines in order to successfully execute them during this call to the adaptor. This information is stored for each co-processing input (the data objects that are given identifier names in the plugin) and accessed through the vtkCPDataDescription as vtkCPInputDataDescription objects. The vtkCPInputDataDescription objects specify whether or not they require a grid and if so which fields they require. These objects are also used to pass the VTK data objects created in the adaptor to the pipeline by using the vtkCPInputDataDescription::SetGrid() method. The final step in this call to the adaptor is then to perform the actual co-processing by calling the vtkCPProcessor::CoProcess() method.<br />
<br />
=== Finalize the Co-Processor ===<br />
Finalization entails calling vtkCPProcessor::Finalize() and cleaning up any remaining VTK objects by calling Delete();<br />
<br />
<br />
----<br />
<br />
While initially there may seem to be a significant hurdle to overcome in order to implement the adaptor for co-processing, the user only needs to know enough information to create the VTK data objects from their own simulation data structures. The adaptor can be made computationally efficient by taking advantage of intimate knowledge of the simulation code and knowing that VTK filters will not modify input data. Examples include:<br />
* Only creating the VTK grid in the first call to the adaptor if the grid is not changing topologically or geometrically.<br />
* Using the SetArray() method to build vtkDataArray objects that use existing memory used by the simulation code instead of allocating and copying existing memory. <br />
<br />
Finally, we suggest looking at either the C++ [[coprocessing example]] and/or the [[python coprocessing example]] to see how the entire co-processing flow works. Additonally, the code in<br />
ParaView3/CoProcessing/CoProcessor/Testing/Cxx/PythonScriptCoProcessingExample.cxx is also worth a look.<br />
This is used to test the co-processing library and can be run with the command "ctest -R CoProcessing".</div>Katie.osterdahlhttps://public.kitware.com/Wiki/index.php?title=ParaView/Users_Guide/Tiled_Display&diff=43662ParaView/Users Guide/Tiled Display2011-10-07T13:13:00Z<p>Katie.osterdahl: </p>
<hr />
<div>== Tiled Display ==<br />
ParaView’s parallel architecture makes it possible to visualize massive amounts of data interactively. When the data is of sufficient resolution that parallel processing is necessary for interactive display, it is often the case that high-resolution images are needed to inspect the data in adequate detail. If you have a 2D grid of display devices, you can run ParaView in tiled display mode to take advantage of it.<br />
<br />
To put ParaView in tiled display mode, give pvserver (or pvrenderserver) the X and Y dimensions of the 2D grid with the ''--tile-dimensions-x'' (or ''-tdx'') and ''--tile-dimensions-y'' (or ''‑tdy'') arguments. The X and Y dimensions default to 0, which disables tiled display mode. If you set only one of them to a positive value on the command line, the other will be set to 1. In tiled display mode, there must be at least as many server (in client / server mode) or render server (in client / data server / render server mode) nodes as tiles. The example below will create a 3x2 tiled display.<br />
<br />
''pvserver -tdx=3 -tdy=2''<br />
<br />
Unless you have a high-end display wall, it is likely that each monitor's bezel creates a gap between the images shown in your tiled display. You can compensate for the bezel width by considering them to be like mullions on a window. To do that, specify the size of the gap (in pixels) through the ''--tile-mullion-x'' (''-tmx'') and ''--tile-mullion-y'' (''-tmy'') command line arguments.<br />
<br />
The IceT library, which ParaView uses for its image compositing, has custom compositing algorithms that work on tiled displays. Although compositing images for large tiled displays is a compute-intensive process, IceT reduces the overall amount of work by employing custom compositing strategies and removing empty tiles from the computation, as demonstrated in Figure 13.5. If the number of nodes is greater than the number of tiles, then the image compositing work will be divided amongst all the processes in the render server. In general, rendering to a tiled display will perform significantly better if there are many more nodes in the cluster than tiles in the display it drives. It also greatly helps if the geometry to be rendered is spatially distributed. Spatially distributed data is broken into contiguous pieces that are contained in small regions of space and are therefore rendered to smaller areas of the screen. IceT takes advantage of this property to reduce the amount of work required to composite the final images. ParaView includes the D3 filter, which redistributes data amongst the processors to ensure a spatially distributed geometry and thus improves tiled rendering performance. <br />
<br />
[[File:ParaView_UsersGuide_TileComposite.png|thumb|center|800px|'''Figure 13.5''' Compositing images for 8 processes on a 4-tile display]]<br />
<br />
Unlike other parallel rendering modes, composited images are not delivered to the client. Instead, image compositing is reserved for generating images on the tiled display, and the desktop renders its own images from a lower resolution version of the geometry to display in the UI. In Tiled Display Mode, ParaView automatically decimates the geometry and sends it to the client to make this happen. However, when the data is very large, even a decimated version of the geometry can overwhelm the client. In this case, ParaView will replace the geometry on the client with a bounding box.<br />
<br />
You have several controls at run-time over the tiled rendering algorithm that you can tune to maintain interactivity while visualizing very large data on very high-resolution tiled displays. These are located on the Tile Display Parameters section of the Render View / Server page of the application settings dialog. These controls are described in the [[ParaView/Users_Guide/Settings | Application Settings]] section of the Appendix.</div>Katie.osterdahlhttps://public.kitware.com/Wiki/index.php?title=ParaView/Users_Guide/Establishing_Connections&diff=43661ParaView/Users Guide/Establishing Connections2011-10-07T13:12:21Z<p>Katie.osterdahl: </p>
<hr />
<div>== Connecting the Client ==<br />
<br />
You establish connections between the independent programs that make up parallel ParaView from within the client’s user interface. The user interface even allows you to spawn the external programs and then automatically connect to them. Once you specify the information that ParaView needs to connect or spawn and connect to the server components, ParaView saves it to make it easy to reuse the same server configuration at a later time. Some visualization centers provide predefined configurations, which makes it trivial to connect to a server that is tailored to that center by simply choosing one from a list in ParaView's GUI.<br />
<br />
The Choose Server dialog shown in Figure 12.8 is the starting point for making and using server configurations. The Connect entry on ParaView client’s File menu brings it up. The dialog shows the servers that you have previously configured. To connect to a server, click its name to select it; then click the Connect button at the bottom of the dialog box. To make changes to settings for a server, select it and click Edit Server. To remove a server from the list, select it and click Delete Server.<br />
<br />
[[File:ParaView_UsersGuide_ConfigureServerDialog.png|thumb|center|800px|'''Figure 12.8''' The Choose Server dialog establishes connections to configured servers]]<br />
<br />
To configure a new server connection, click the Add Server button to add it to the list. The dialog box shown below will appear. Enter a name in the first text entry box; this is the name that will appear in the Choose Server dialog (shown above).<br />
<br />
[[File:ParaView_UsersGuide_ConfigureNewServerDialog.png|thumb|center|800px|'''Figure 12.9''' Configuring a new server]]<br />
<br />
Next, select the type of connection you wish to establish from the Server Type menu. The possibilities are as follows. The “reverse connection” entries mean that the server connects to the client instead of the client connecting to the server. This may be necessary when the server is behind a firewall. Servers are usually run with multiple processes and on a machine other than where the client is running.<br />
<br />
* '''Client / Server''': Attach the ParaView client to a server.<br />
* '''Client / Server (reverse connection)''': Connect a server to the ParaView client.<br />
* '''Client / Data Server / Render Server''': Attach the ParaView client to separate data and render servers.<br />
* '''Client / Data Server / Render Server (reverse connection)''': Attach both a data and a render server to the ParaView client.<br />
<br />
In either of the client / server modes, you must specify the name or IP address of the host machine (node 0) for the server. You may also enter a port number to use, or you may use the default (11111). If you are running in client / data server / render server mode, you must specify one host machine for the data server and another for the render server. You will also need two port numbers. The default one for the data server is 11111; the default for the render server is 22221. <br />
<br />
When all of these values have been set, click the Configure button at the bottom of the dialog. This will cause the Configure Server dialog box, shown in Figure 12.10, to appear. You must first specify the start-up type. The options are Command and Manual. Choose Manual to connect to a server that has been started or will be started externally, on the command line for instance, outside of the ParaView user interface. After selecting Manual, click the Save button at the bottom of the dialog.<br />
<br />
[[File:ParaView_UsersGuide_ConfigureServerManualDialog.png|thumb|center|800px|'''Figure 12.10''' Configure the server manually. It must be started outside of ParaView]]<br />
<br />
If you choose the Command option, in the text window labeled "Execute an external command to start the server:," you must give the command(s) and any arguments for starting the server. This includes commands to execute a command on a remote machine (e.g., ssh) and to run the server in parallel (e.g., mpirun). You may also specify an amount of time to wait after executing the startup command(s) and before making the connection between the client and the server(s). (See the spin box at the bottom of the dialog.) When you have finished, click the Save button at the bottom of the dialog.<br />
<br />
[[File:ParaView_UsersGuide_ConfigureServerCommandDialog.png|thumb|center|800px|'''Figure 12.11''' Enter a command that will launch a new server]]<br />
<br />
Clicking the Save button in the Configure Server dialog will return you to the Choose Server dialog (shown earlier in this section). The server you just configured will now be in the list of servers you may choose from. Thereafter, whenever you run ParaView, you can connect to any of the servers that you have configured. You can also give the ParaView client the ''–-server=server_config_name'' command-line argument to make it automatically connect to any of the servers from the list when it starts.<br />
<br />
You can save and/or load server configurations to and/or from a file using the Save Servers and Load Servers buttons, respectively, on the Choose Server dialog. This is how some visualization centers provide system-wide server configurations to allow the novice user to simply click his or her choice and connect to an already configured ParaView server. The format of the XML file for saving the server configurations is discussed online at http://paraview.org/Wiki/Server_Configuration.</div>Katie.osterdahlhttps://public.kitware.com/Wiki/index.php?title=ParaView/Users_Guide/Starting_Parallel_Servers&diff=43660ParaView/Users Guide/Starting Parallel Servers2011-10-07T13:11:29Z<p>Katie.osterdahl: </p>
<hr />
<div>== Client / Server Mode ==<br />
<br />
Client / Server Mode refers to a parallel ParaView session in which data server and render server components reside within the same set of processes, and the client is completely separate. The pvserver executable combines the two server components into one process. <br />
<br />
You can run pvserver as a serial process on a single machine. If ParaView was compiled with parallel support, you can also run it as an MPI parallel program on a group of machines. Instructions for starting a program with MPI are implementation and system-dependent, so contact your system administrator for information about starting an application with MPI. With the MPICH implementation of MPI, the command to start the server in parallel usually follows the format shown here:<br />
<br />
''mpirun –np number_of_processes path_to/pvserver arguments for pvserver''<br />
<br />
By default, pvserver will start and then wait for the client to connect to it. See the next section for a full description. Briefly, to make the connection, select Connection from the File menu, select (or make and then select) a configuration for the server, and click Connect. Note that you must start the server before the client attempts to connect to it.<br />
<br />
If the computer running the server is behind a firewall, it is useful to have the server initiate the connection instead of the client. The ''‑-reverse-connection'' (or ''-rc'') command-line option tells the server to do this. The server must know the name of the machine to which it should connect; this is specified with the ''--client-host'' (or ''-ch'') argument. Note that when the connection is reversed, you must start the client and instruct it to wait for a connection before the server attempts to connect to it.<br />
<br />
The client-to-server connection is made over TCP, using a default port of 11111. If your firewall puts restrictions on TCP ports, you may want to choose a different port number. In the client dialog, simply choose a port number in the Port entry of the Configure New Server dialog. Meanwhile, give pvserver the same port number by including ''--server-port'' (or ''–sp'') in its command-line argument list.<br />
<br />
An example command line to start the server and have it initiate the connection to a particular client on a particular port number is given below:<br />
<br />
''pvserver –rc –ch=magrathea –sp=26623''<br />
<br />
== Render/Server Mode ==<br />
<br />
The render server allows you to designate a separate group of machines (i.e., apart from the data server and the client) to perform rendering. This parallel mode lets you use dedicated rendering machines for parallel rendering rather than relying on the data server machines, which may have limited or no rendering capabilities. In ParaView, the number of machines (N) composing the render server must be no more than the number (M) composing the data server. <br />
<br />
Note that it is true that some large installations with particularly high-performing, parallel rendering resources it can be very efficient to run ParaView in Render/Server Mode. However, we have found in practice that it is almost always the case that the data transfer time between the two servers overwhelms the speed gained by rendering on the dedicated graphics cluster. For this reason, we typically recommend that you combine the data and render servers together as one component, and either render in software via Mesa on the data processing cluster or do all of the visualization processing directly on the GPU cluster.<br />
<br />
If you still want to break-up the data processing and rendering tasks, there are two sets of connections that must be made for ParaView to run in render-server mode. The first connection set is between the client and the first node of each of the data and render servers. The second connection set is between the nodes of the render server and the first ''n'' nodes of the data server. Once all of these connections are established, they are bi-directional. The diagram in Figure 12.3 depicts the connections established when ParaView is running in render server mode. Each double-ended arrow indicates a bi-directional TCP connection between pairs of machines. The dashed lines represent MPI connections between all machines within a server. In all the diagrams in this section, the render server nodes are denoted by RS 0, RS 1, …, RS N. The data server nodes are similarly denoted by DS 0, DS 1, …, DS N, …, DS M.<br />
<br />
<br />
[[File:ParaView_UsersGuide_RenderServerConnections.png|thumb|center|800px|'''Figure 12.3''' Connections required in render server mode]]<br />
<br />
The establishment of connections between client and servers can either be forward (from client-to-servers) or reverse (from servers-to-client). Likewise, the connections between render server and data server nodes can be established either from the data server to the render server, or from the render server to the data server. <br />
<br />
The main reason for reversing the direction of any of the initial connections is that machines behind firewalls are able to initiate connections to machines outside the firewall, but not vice versa. If the data server is behind a firewall, the data server should initiate the connection with the client, and the data server nodes should connect to the render server nodes. If the render server is behind the firewall instead, both servers should initiate connections to the client, but the render server nodes should initiate the connections with the nodes of the data server.<br />
<br />
In the remaining diagrams in this section, each arrow indicates the direction in which the connection is initially established. Double-ended arrows indicate bi-directional connections that have already been established. In the example command lines, optional arguments are enclosed in <nowiki>[]</nowiki>’s. The rest of this section will be devoted to discussing the two connections required for running ParaView in render server mode.<br />
<br />
=== Connection 1: Connecting the client and servers ===<br />
The first connection that must be established is between the client and the first node of both the data and render servers. By default, the client initiates the connection to each server, as shown in Figure 12.4. In this case, both the data server and the render server must be running before the client attempts to connect to them.<br />
<br />
[[File:ParaView_UsersGuide_RenderServerConnectionsStartNormal.png|thumb|center|800px|'''Figure 12.4''' Starting ParaView in render-server mode using standard connections]]<br />
<br />
To establish the connections shown above, do the following. First, from the command line of the machine that will run the data server, enter ''pvdataserver'' to start it. Next, from the command line of the machine that will run the render server, enter ''pvrenderserver'' to start the render server. Now, from the machine that will run the client, start the client application, and connect to the running servers, as described in section 1.2 and summarized below.<br />
<br />
Start ParaView and select Connect from the File menu to open the Choose Server dialog. Select Add Server to open the Configure New Server dialog. Create a new server connection with a Server Type of Client / Data Server / Render Server. Enter the machine names or IP addresses of the server machines in the Host entries. Select Configure, and then in the Configure Server dialog, choose Manual. Save the server configuration and connect to it. At this point, ParaView will establish the two connections. This is similar to running ParaView in client/server mode, but with the addition of a render server. <br />
<br />
The connection between the client and the servers can also be initiated by the servers. As explained above, this is useful when the servers are running on machines behind a firewall. In this case, the client must be waiting for both servers when they start. The diagram indicating the initial connections is shown in Figure 12.5.<br />
<br />
[[File:ParaView_UsersGuide_RenderServerConnectionsStartReverse.png|thumb|center|800px|'''Figure 12.5''' Reversing the connections between the servers and the client]]<br />
<br />
To establish the connections shown above, start by opening the Configure New Server dialog on the client. Choose '''Client'''|Data Server|Render Server (reverse connection) for the Server Type in the Configure New Server dialog. Next, add both ''--reverse-connection'' (''-rc'') and ''--client-host'' (''-ch'') to the command lines for the data server and render server. The value of the ''--client-host'' parameter is the name or IP address of the machine running the client. You can use the default port numbers for these connections, or you can specify ports in the client dialog by adding the ''--data-server-port'' (''–dsp'') and ''--render-server-port'' (''–rsp'') command-line arguments to the data server and render server command lines. The port numbers for each server must agree with the corresponding Port entries in the dialog, and they must be different from each other.<br />
<br />
For the remainder of this chapter, ''-rc'' will be used instead of ''--reverse-connection'' when the connection between the client and the servers is to be reversed.<br />
<br />
=== Connection 2: Connecting the render and data servers ===<br />
After the connections are made between the client and the two servers, the servers will establish connections with each other. In parallel runs, this server-to-server connection is a set of connections between all N nodes of the render server and the first N nodes of the data server. By default, the data server initiates the connection to the render server, but this can be changed with a configuration file. The format of this file is described below. <br />
<br />
The server that initiates the connection must know the name of the machine running the other server and the port number it is using. In parallel runs, each node of the connecting server must know the name of the machine for the corresponding process in the other server to which it should connect. The port numbers are randomly assigned, but they can be assigned in the configuration file as described below. <br />
<br />
The default set of connections is illustrated in Figure 12.6. To establish these connections, you must give the data server the connection information discussed above, which you specify within a configuration file. Use the ''--machines'' (''–m'') command line argument to tell the data server the name of the configuration file. In practice, the same file should be given to all three ParaView components. This ensures that the client, the render server, and the data server all agree on the network parameters. <br />
<br />
<br />
[[File:ParaView_UsersGuide_RenderDataServerConnectionsStartNormal.png|thumb|center|800px|'''Figure 12.6''' Initializing the connection from the data server to the render server]]<br />
<br />
An example network configuration file, called machines.pvx in this case, is given below: <br />
<br />
<source lang="xml"><br />
<?xml version="1.0" ?><br />
<pvx><br />
<br />
<Process Type="client">><br />
</Process><br />
<br />
<Process Type="render-server"><br />
<Option Name="render-node-port" Value="1357"/><br />
<Machine Name="rs_m1" <br />
Environment="DISPLAY=rs_m1:0"/> <br />
<Machine Name="rs_m2"<br />
Environment="DISPLAY=rs_m2:0"/><br />
</Process><br />
<br />
<Process Host="data-server"><br />
<Machine Name="ds_m1" /><br />
<Machine Name="ds_m2" /><br />
<Machine Name="ds_m3" /><br />
<Machine Name="ds_m4" /><br />
</Process><br />
<br />
</pvx> <br />
<br />
</source><br />
<br />
Sample command-line arguments that use the configuration file above to initiate the network illustrated in Figure 12.6 are given below:<br />
<br />
mpirun –np 2 pvdataserver –m=machines.pvx<br />
<br />
mpirun –np 2 pvrenderserver -m=machines.pvx<br />
<br />
paraview –m=machines.pvx<br />
<br />
It should be noted that the machine configuration file discussed here is a distinct entity and has a different syntax from the server configuration file discussed at the end of the next section. That file is read only by the client; the file discussed here will be given to the client and both servers.<br />
<br />
In the machine file above, the render-node-port entry in the render server’s XML element tells the render server the port number on which it should listen for a connection from the data server, and it tells the data server what port number it should attempt to contact. This entry is optional and if it does not appear in the file, the port number will be chosen automatically. Note that it is not possible to assign port numbers to individual machines within the server; all will be given the same port number or use the automatically-chosen one. Note also that each render server machine is given a display environment variable in this file. This is not required to establish the connections, but it is helpful if you need to assign particular X11 display names to the various render server nodes.<br />
<br />
The initial connection between the nodes of the two servers is made from the data server to the render server. You can reverse this such that the render server nodes connect to the corresponding nodes of the data server instead as shown in Figure 12.7. <br />
<br />
[[File:ParaView_UsersGuide_RenderDataServerConnectionsStartReverse.png|thumb|center|800px|'''Figure 12.7''' Reversing the connection between the servers and client and connecting the render server to the data server]]<br />
<br />
Typically, when the server connection is reversed, the direction of the connection between the client and the servers is also reversed (e.g., if the render server is behind a firewall). In this case, the render server must have the machine names and a connection port number to connect to the data server. The same XML file is used for this arrangement as is with the standard connection. The only difference in this case is that the render-node-port entry, if it is used, must appear in the data server’s XML element instead of the render server’s element. Example command-line arguments to initiate this type of network are given here:<br />
<br />
paraview –m=machines.pvx <br />
<br />
mpirun –np M pvdataserver –m=machines.pvx -rc -ch=''client''<br />
<br />
mpirun –np N pvrenderserver –m=machines.pvx -rc -ch=''client''</div>Katie.osterdahlhttps://public.kitware.com/Wiki/index.php?title=ParaView/Users_Guide/Parallel_Rendering&diff=43659ParaView/Users Guide/Parallel Rendering2011-10-07T13:10:04Z<p>Katie.osterdahl: </p>
<hr />
<div>== X Forwarding - Not a Good Idea ==<br />
<br />
Parallel Rendering implies that many processors have some context to render their pixels into. Even though X11 forwarding might be available, you should not run the client remotely and forward its X calls. ParaView will be far more efficient if you let it directly handle the data transfer between local and remote machines. When doing hardware accelerated rendering in GPUs, this implies having X11 or Windows display contexts (either off-screen of on-screen). Otherwise. this implies using off-screen Mesa (OSMesa) linked in to ParaView to do the rendering entirely off-screen into software buffers.<br />
<br />
== Onscreen GPU Accelerated Rendering via X11 Connections ==<br />
<br />
One of the most common problems people have with setting up the ParaView server is allowing the server processes to open windows on the graphics card on each process' node. When ParaView needs to do parallel rendering, each process will create a window that it will use to render. This window is necessary because you need the "x" window before you can create an OpenGL context on the graphics hardware.<br />
<br />
There is a way around this. If you are using the Mesa as your OpenGL implementation, then you can also use the supplemental OSMesa library to create an OpenGL context without an "x" window. However, Mesa is strictly a CPU rendering library so, '''use the OSMesa solution if and only if your server hardware does not have rendering hardware'''. If your cluster does not have graphics hardware, then compile ParaView with [[#OSMesa support|OSMesa support]] and use the ''--use-offscreen-rendering'' flag when launching the server.<br />
<br />
Assuming that your cluster does have graphics hardware, you will need to establish the following three things:<br />
<br />
# Have xdm run on each cluster node at start-up. Although xdm is almost always run at startup on workstation installations, it is not as commonplace to be run on cluster nodes. Talk to your system administrators for help in setting this up.<br />
# Disable all security on the "x" server. That is, allow any process to open a window on the "x" server without having to log-in. Again, talk to your system administrators for help.<br />
# Use the ''-display'' flag for pvserver to make sure that each process is connecting to the display <tt>localhost:0</tt> (or just <tt>:0</tt>).<br />
<br />
To enable the last condition, you would run something like:<br />
<br />
mpirun -np 4 ./pvserver -display localhost:0<br />
<br />
An easy way to test your setup is to use the <tt>glxgears</tt> program. Unlike pvserver, it will quickly tell you (or, rather, fail to start) if it cannot connect to the local "x" server.<br />
<br />
mpirun -np 4 /usr/X11R6/bin/glxgears -display localhost:0<br />
<br />
== Offscreen Software Rendering via OSMesa ==<br />
<br />
When running ParaView in a parallel mode, it may be helpful for the remote rendering processes to do their rendering in off-screen buffers. For example, other windows may be displayed on the node(s) where you are rendering; if these windows cover part of the rendering window, depending on the platform and graphics capabilities, they might even be captured as part of the display results from that node. A similar situation could occur if more than one rendering process is assigned to a single machine and the processes share a display. Also, in some cases, the remote rendering nodes are not directly connected to a display and otherwise if your cluster does not have graphics hardware, then compile ParaView with OSMesa support and use the ''--use-offscreen-rendering'' flag when launching the server.<br />
<br />
The first step to compiling OSMesa support is to make sure that you are compiling with the [http://mesa3d.org Mesa 3D Graphics Library]. It is difficult to tell an installation of Mesa from any other OpenGL implementation (although the existence of an osmesa.h header and a libOSMesa library is a good clue). If you are not sure, you can always download your own copy from http://mesa3d.org. We recommend using either Mesa version 7.6.1 or 7.9.1.<br />
<br />
There are three different ways to use Mesa as ParaView's openGL library:<br />
* You can use it purely as a substitute for GPU enabled onscreen rendering. To do this, set the CMake variable ''OPENGL_INCLUDE_DIR'' to point to the Mesa include directory (the one containing the GL subdirectory) and set the ''OPENGL_gl_LIBRARY'' and ''OPENGL_glu_LIBRARY'' to the libGL and libGLU library files, respectively.<br><br />
<br />
{| border="0" cellpadding="4" cellspacing="4" style="width: 100%;"<br />
|- <br />
| bgcolor="#abcdef" height="8" | '''Variable'''<br />
| bgcolor="#abcdef" height="8" | '''Value'''<br />
| bgcolor="#abcdef" height="8" | '''Description'''<br />
|-<br />
| PARAVIEW_BUILD_QT_GUI<br />
| ON<br />
|<br />
|-<br />
| VTK_USE_COCOA<br />
| ON<br />
| Mac Only. X11 is not supported.<br />
|-<br />
| VTK_OPENGL_HAS_OSMESA<br />
| OFF<br />
| Disable off screen rendering.<br />
|-<br />
| OPENGL_INCLUDE_DIR<br />
| <mesa include dir><br />
| Set this to the include directory in MESA.<br />
|-<br />
| OPENGL_gl_LIBRARY<br />
| libGL<br />
| Set this to the libGL.a or libGL.so file in MESA.<br />
|-<br />
| OPENGL_glu_LIBRARY<br />
| libGLU<br />
| Set this to the libGLU.a or libGLU.so file in MESA.<br />
|}<br />
<br />
* You can use it as a supplement to on-screen rendering. This mode requires that you have a display (X11 is running). In addition to specifying the GL library (which may be a GPU implementation of the Mesa one above), you must tell ParaView where Mesa's OSMesa library is. Do that by turning the ''VTK_OPENGL_HAS_OSMESA'' variable to ON. After you configure again, you will see a new CMake variable called ''OSMESA_LIBRARY''. Set this to the libOSMesa library file.<br><br />
<br />
{| border="0" cellpadding="4" cellspacing="4" style="width: 100%;"<br />
|- <br />
| bgcolor="#abcdef" height="8" | '''Variable'''<br />
| bgcolor="#abcdef" height="8" | '''Value'''<br />
| bgcolor="#abcdef" height="8" | '''Description'''<br />
|-<br />
| PARAVIEW_BUILD_QT_GUI || ON ||<br />
|-<br />
| VTK_USE_COCOA || ON || Mac Only. X11 is not supported.<br />
|-<br />
| VTK_OPENGL_HAS_OSMESA || ON || Turn this to ON to enable software rendering. <br />
|-<br />
| OSMESA_INCLUDE_DIR || <mesa include dir> || Set this to the include directory for MESA.<br />
|-<br />
| OPENGL_INCLUDE_DIR || <mesa include dir> || Set this to the include directory for MESA.<br />
|-<br />
| OPENGL_gl_LIBRARY || libGL || Set this to the libGL.a or libGL.so file.<br />
|-<br />
| OPENGL_glu_LIBRARY || libGLU || Set this to the libGLU.a or libGLU.so file.<br />
|-<br />
| OSMESA_LIBRARY || libOSMesa || Set this to the libOSMesa.a or libOSMesa.so file.<br />
|}<br />
<br />
* You can use it for pure off-screen rendering, which is necessary when there is no display. To do this, make sure that the ''OPENGL_gl_LIBRARY'' variable is empty and that ''VTK_USE_X'' is off. Specify the location of OSMesa and ''OPENGL_glu_LIBRARY'' as above and turn on the ''VTK_USE_OFFSCREEN'' variable.<br><br />
<br />
{| border="0" cellpadding="4" cellspacing="4" style="width: 100%;"<br />
|- <br />
| bgcolor="#abcdef" height="8" | '''Variable'''<br />
| bgcolor="#abcdef" height="8" | '''Value'''<br />
| bgcolor="#abcdef" height="8" | '''Description'''<br />
|-<br />
| PARAVIEW_BUILD_QT_GUI || OFF || When using offscreen rendering there is no gui<br />
|-<br />
| VTK_USE_COCOA || OFF || Mac only.<br />
|-<br />
| VTK_OPENGL_HAS_OSMESA || ON ||Turn this to ON to enable Off Screen MESA.<br />
|-<br />
| OSMESA_INCLUDE_DIR || <mesa include dir> || Set this to the include directory for MESA.<br />
|-<br />
| OPENGL_INCLUDE_DIR || <mesa include dir> || Set this to the include directory for MESA.<br />
|-<br />
| OPENGL_gl_LIBRARY || <empty> || Set this to empty.<br />
|-<br />
| OPENGL_glu_LIBRARY || libGLU || Set this to the libGLU.a or libGLU.so file.<br />
|-<br />
| OSMESA_LIBRARY || libOSMesa || Set this to the libOSMesa.a or libOSMesa.so file.<br />
|}<br />
<br />
Once again, once you build with OSMesa support, it will not take effect unless you launch the server with the ''--use-offscreen-rendering'' flag or alternatively, set the ''PV_OFFSCREEN'' environment variable on the server to one.<br />
<br />
== Compositing ==<br />
<br />
Given that you are connected to a server that is capable of rendering, you have a choice of whether to do the rendering remotely or to do it locally. ParaView’s server performs all data-processing tasks. This includes generation of a polygonal representation of the full data set and of decimated LOD models. Once the data is generated on the server, it is sometimes better to do the rendering remotely and ship pixels to the client for display; other times, it's better to instead shift geometry to the client and have the client render it locally.<br />
<br />
In many cases, the polygonal representation of the data set is much smaller than the original data set. In an extreme case, a simple outline may be used to represent a very large structured mesh; in these instances, it may be better to transmit the polygonal representation from the server to the client, and then let the client render it. The client can render the data repeatedly, when the viewpoint is changed for instance, without causing additional network traffic. Network traffic will only occur when the data changes. If the client workstation has high-performance rendering hardware, it can sometimes render even large data sets interactively in this way.<br />
<br />
The second option is to have each node of the server render its geometry and send the resulting images to the client for display. There is a penalty per rendered frame for compositing images and sending the image across the network. However, ParaView’s image compositing and delivery is very fast, and there are many options to ensure interactive rendering in this mode. Therefore, although small models may be collected and rendered on the client interactively, ParaView’s distributed rendering can render models of all sizes interactively.<br />
<br />
ParaView automatically chooses a rendering strategy to achieve the best rendering performance. You can control the rendering strategy explicitly, forcing rendering to occur entirely on the server or entirely on the client for example, by choosing Settings from the Edit menu of ParaView. Double-click on Render View from the window on the left-hand side of the Settings dialog, and then click on Server. The rendering strategy parameters shown in Figure 13.1 will now be visible. Here we explain in detail the most important of these controls. For an explanation of all controls, see the [[ParaView/Users_Guide/Settings | Appendix]].<br />
<br />
[[File:ParaView_UsersGuide_settings_server.png|thumb|center|600px|'''Figure 13.1''' Parallel rendering parameters]]<br />
<br />
'''Remote Render Threshold''': This slider determines how large the dataset must be in order for parallel rendering with image compositing and delivery to be used (as opposed to collecting the geometry to the client). The value of this slider is measured in megabytes. Only when the entire data set consumes more memory than this value will compositing of images occur. If the check-box beside the Remote Render Threshold slider is unmarked, then compositing will not happen; the geometry will always be collected. This is only a reasonable option when you can be sure the dataset you are using is very small. In general, it is safer to move the slider to the right than to uncheck the box.<br />
<br />
ParaView uses IceT to perform image compositing. IceT is a parallel rendering library that takes multiple images rendered from different portions of the geometry and combines them into a single image. IceT employs several image-compositing algorithms, all of which are designed to work well on distributed memory machines. Examples of two such image-compositing algorithms are depicted in Figure 13.2 and Figure 13.3. IceT will automatically choose a compositing algorithm based on the current workload and available computing resources.<br />
<br />
[[File:ParaView_UsersGuide_TreeComposite.png|thumb|center|800px|'''File 13.2''' Tree compositing on four processes]]<br />
<br />
[[File:ParaView_UsersGuide_BinarySwap.png|thumb|center|800px|'''File 13.3''' Binary swap on four processes]]<br />
<br />
'''Interactive Subsample Rate''': The time it takes to composite and deliver images is directly proportional to the size of the images. The overhead of parallel rendering can be reduced by simply reducing the size of the images. ParaView has the ability to subsample images before they are composited and inflate them after they have been composited. The Interactive Subsample Rate slider specifies the amount by which images are subsampled. This is measured in pixels, and the subsampling is the same in both horizontal and vertical directions. Thus, a subsample rate of two will result in an image that is ¼ the size of the original image. The image is scaled to full-size before it is displayed on the user interface, so the higher the subsample rate, the more obviously pixilated the image will be during interaction as demonstrated in Figure 13.4. When the user is not interacting with the data, no subsampling will be used. If you want subsampling to always be off, unmark the check-box beside the Interactive Subsample Rate slider. <br />
<br />
<br />
{| style="border-spacing:100;"<br />
| style="align:center;border:none;padding-top:0in;padding-bottom:0in;padding-left:0.075in;padding-right:0.075in;"| <br />
<center>[[File:ParaView_UsersGuide_NoSubsampling.png||link=]]</center><br />
| style="align:center;border:none;padding-top:0in;padding-bottom:0in;padding-left:0.075in;padding-right:0.075in;"| <br />
<center>[[File:ParaView_UsersGuide_TwoPixelSubsampling.png||link=]]</center><br />
| style="align:center;border:none;padding-top:0in;padding-bottom:0in;padding-left:0.075in;padding-right:0.075in;"| <br />
<center>[[File:ParaView_UsersGuide_EightPixelSubsampling.png||link=]]</center><br />
<br />
|-<br />
| style="align:center;border:none;padding-top:0in;padding-bottom:0in;padding-left:0.075in;padding-right:0.075in;"| No Subsampling<br />
| style="align:center;border:none;padding-top:0in;padding-bottom:0in;padding-left:0.075in;padding-right:0.075in;"| Subsample Rate: 2 pixels<br />
| style="align:center;border:none;padding-top:0in;padding-bottom:0in;padding-left:0.075in;padding-right:0.075in;"| Subsample Rate: 8 pixels<br />
<br />
|}<br />
<br />
'''Figure 13.4 The effect of subsampling on image quality'''<br />
<br />
<br />
'''Squirt Compression''': When ParaView is run in client/server mode, it uses image compression to optimize the image transfer. The compression uses an encoding algorithm optimized for images called SQUIRT (developed at Sandia National Laboratories). <br />
<br />
SQUIRT uses simple run-length encoding for its compression. A run-length image encoder will find sequences of pixels that are all the same color and encode them as a single run length (the count of pixels repeated) and the color value. ParaView represents colors as 24-bit values, but SQUIRT will optionally apply a bit mask to the colors before comparing them. Although information is lost when this mask is applied, the sizes of the run lengths are increased and the compression improves. The bit masks used by SQUIRT are carefully chosen to match the color sensitivity of the human visual system. A 19-bit mask employed by SQUIRT greatly improves compression with little or no noticeable image artifacts. Reducing the number of bits further can improve compression even more, but it can lead to more noticeable color-banding artifacts. <br />
<br />
The Squirt Compression slider determines the bit mask used during interactive rendering (i.e., rendering that occurs while the user is changing the camera position or otherwise interacting with the data). During still rendering (when the user is not interacting with the data), lossless compression is always used. The check-box to the left of the Squirt Compression slider toggles whether the SQUIRT compression algorithm is used at all.</div>Katie.osterdahlhttps://public.kitware.com/Wiki/index.php?title=ParaView/Python_Scripting&diff=43658ParaView/Python Scripting2011-10-07T13:08:06Z<p>Katie.osterdahl: </p>
<hr />
<div>Note: This document if based on ParaView 3.6 or higher. If you are using 3.4, go to the history page and select the version from May 13, 2009.<br />
<br />
=ParaView and Python=<br />
ParaView offers rich scripting support through Python. This support is available as part of the ParaView client (paraview), an MPI-enabled batch application (pvbatch), the ParaView python client (pvpython), or any other Python-enabled application. Using Python, users and developers can gain access to the ParaView engine called Server Manager.<br />
<br />
Note: Server Manager is a library that is designed to make it easy to build distributed client-server applications.<br />
<br />
This document is a short introduction to ParaView's Python interface. You may also visit the [[Python recipes]] page for some examples.<br />
<br />
=Quick Start - a Tutorial=<br />
==Getting Started==<br />
<br />
To start interacting with the Server Manager, you have to load the "simple" module. This module can be loaded from any python interpreter as long as the necessary files are in PYTHONPATH. These files are the shared libraries located in the paraview binary directory and python modules in the paraview directory: ''paraview/simple.py'', ''paraview/vtk.py'' etc. You can also use either pvpython (for stand-alone or client/server execution), pvbatch (for non-interactive, distributed batch processing) or the python shell invoked from '''Tools'''|Python Shell using the ParaView client to execute Python scripts. You do not have to set PYTHONPATH when using these.<br />
<br />
This tutorial will be using the python integrated development environment IDLE. PYTHONPATH is set to the following: <br />
<br />
/Users/berk/work/paraview3-build/bin:/Users/berk/work/paraview3-build/Utilities/VTKPythonWrapping/site-packages<br />
<br />
Note: For older versions of ParaView this was ''/Users/berk/work/paraview3-build/bin:/Users/berk/work/paraview3-build/Utilities/VTKPythonWrapping'' --[[User:Andy.bauer|Andy.bauer]] 23 July 2010.<br />
<br />
You may also need to set your path variable for searching for shared libraries (i.e. PATH on Windows and LD_LIBRARY_PATH on Unix/Linux/Mac). The corresponding LD_LIBRARY_PATH would be:<br />
/Users/berk/work/paraview3-build/bin<br />
<br />
(Under WindowsXP for a debug build of paraview, set both PATH and PYTHONPATH environment variables to include ${BUILD}/bin/Debug and ${BUILD}/Utilities/VTKPythonWrapping to make it work.<br />
--[[User:DaveDemarle|DaveDemarle]] 21:09, 29 June 2009 (UTC))<br />
<br />
When using a Mac to use the build tree in IDLE, start by loading the servermanager module:<br />
<br />
<source lang="python"><br />
>>> from paraview.simple import *<br />
</source><br />
<br />
Note: Importing the paraview module directly is deprecated, although still possible for backwards compatibility. This document refers to the simple module alone. <br />
<br />
In this example, we will use ParaView in the stand-alone mode. Connecting to a ParaView server running on a cluster is covered later in this document.<br />
<br />
==Creating a Pipeline==<br />
<br />
The simple module contains many functions to instantiate sources, filters, and other related objects. You can get a list of objects this module can create from ParaView's online help (from help menu or here: http://paraview.org/OnlineHelpCurrent/)<br />
<br />
Start by creating a Cone object:<br />
<br />
<source lang="python"><br />
>>> cone = Cone()<br />
</source><br />
<br />
You can get some documentation about the cone object using help().<br />
<br />
<source lang="python"><br />
>>> help(cone)<br />
Help on Cone in module paraview.servermanager object:<br />
<br />
class Cone(SourceProxy)<br />
| The Cone source can be used to add a polygonal cone to the 3D scene. The output of the <br />
Cone source is polygonal data.<br />
| <br />
| Method resolution order:<br />
| Cone<br />
| SourceProxy<br />
| Proxy<br />
| __builtin__.object<br />
| <br />
| Methods defined here:<br />
| <br />
| Initialize = aInitialize(self, connection=None)<br />
| <br />
| ----------------------------------------------------------------------<br />
| Data descriptors defined here:<br />
| <br />
| Capping<br />
| If this property is set to 1, the base of the cone will be capped with a filled polygon. <br />
Otherwise, the base of the cone will be open.<br />
| <br />
| Center<br />
| This property specifies the center of the cone.<br />
| <br />
| Direction<br />
| Set the orientation vector of the cone. The vector does not have to be normalized. The cone <br />
will point in the direction specified.<br />
| <br />
| Height<br />
| This property specifies the height of the cone.<br />
| <br />
| Radius<br />
| This property specifies the radius of the base of the cone.<br />
| <br />
| Resolution<br />
| This property indicates the number of divisions around the cone. The higher this number, the <br />
closer the polygonal approximation will come to representing a cone, and the more polygons it will <br />
contain.<br />
| <br />
|... <br />
</source><br />
<br />
This gives you a full list of properties. Check what the resolution property is set to:<br />
<br />
<source lang="python"><br />
>>> cone.Resolution<br />
6<br />
</source><br />
<br />
You can increase the resolution as shown below:<br />
<br />
<source lang="python"><br />
>>> cone.Resolution = 32<br />
</source><br />
<br />
Alternatively, we could have specified a value for resolution when creating the object:<br />
<br />
<source lang="python"><br />
>>> cone = Cone(Resolution=32)<br />
</source><br />
<br />
You can assign values to any number of properties during construction using keyword arguments:<br />
You can also change the center.<br />
<br />
<source lang="python"><br />
>>> cone.Center<br />
[0.0, 0.0, 0.0]<br />
>>> cone.Center = [1, 2, 3]<br />
</source><br />
<br />
Vector properties such as this one support setting and retrieval of individual elements, as well as slices (ranges of elements):<br />
<br />
<source lang="python"><br />
>>> cone.Center[0:2] = [2, 4]<br />
>>> cone.Center<br />
[2.0, 4.0, 3.0]<br />
</source><br />
<br />
Next, apply a shrink filter to the cone:<br />
<br />
<source lang="python"><br />
>>> shrinkFilter = Shrink(cone)<br />
>>> shrinkFilter.Input<br />
<paraview.servermanager.Cone object at 0xaf701f0><br />
</source><br />
<br />
At this point, if you are interested in getting some information about the output of the shrink filter, you can force it to update (which will also cause the execution of the cone source). For details about VTK's demand-driven pipeline model used by ParaView, see one of the VTK books.<br />
<br />
<source lang="python"><br />
>>> shrinkFilter.UpdatePipeline()<br />
>>> shrinkFilter.GetDataInformation().GetNumberOfCells()<br />
33L<br />
>>> shrinkFilter.GetDataInformation().GetNumberOfPoints()<br />
128L<br />
</source><br />
<br />
We will cover the DataInformation class in more detail later.<br />
<br />
==Rendering==<br />
<br />
Now that you've created a small pipeline, render the result. You will need two objects to render the output of an algorithm in a scene: a representation and a view. A representation is responsible for taking a data object and rendering it in a view. A view is responsible for managing a render context and a collection of representations. Simple creates a view by default. The representation object is created automatically with Show().<br />
<br />
<source lang="python"><br />
>>> Show(shrinkFilter)<br />
>>> Render()<br />
</source><br />
<br />
Et voila:<br />
<br />
[[File:Servermanager_snapshot.png|thumb|center|800px|'''Figure 14.1''' Server manager snapshot]]<br />
<br />
In example Figure 14.1, the value returned by Cone() and Shrink() was assigned to Python variables and used to build the pipeline. ParaView keeps track of the last pipeline object created by the user. This allows you to accomplish everything you did above using the following code:<br />
<br />
<source lang="python"><br />
>>> from paraview.simple import *<br />
# Create a cone and assign it as the active object<br />
>>> Cone()<br />
<paraview.servermanager.Cone object at 0x2910f0><br />
# Set a property of the active object<br />
>>> SetProperties(Resolution=32)<br />
# Apply the shrink filter to the active object<br />
# Shrink is now active<br />
>>> Shrink() <br />
<paraview.servermanager.Shrink object at 0xaf64050><br />
# Show shrink<br />
>>> Show() <br />
<paraview.servermanager.UnstructuredGridRepresentation object at 0xaf57f90><br />
# Render the active view<br />
>>> Render() <br />
<paraview.servermanager.RenderView object at 0xaf57ff0><br />
</source><br />
<br />
This was a quick introduction to the paraview.simple module. In the following sections, we will discuss the Python interface in more detail and introduce more advanced concepts.<br />
<br />
=paraview.simple Module=<br />
<br />
The simple module is a ParaView component written using Python on top of the Server Manager C++ library. Its purpose is to make it easier to create ParaView data analysis and visualization pipelines using Python. The simple module can be loaded from Python interpreters running in several applications.<br />
<br />
* '''pvpython''': The pvpython application, distributed with the ParaView application suite, is a Python client to the ParaView servers. It supports interactive execution as well as batch execution.<br />
<br />
* '''pvbatch''': The pvbatch application, also distributed with the ParaView application suite, is a Python application designed to run batch scripts on distributed servers. When ParaView is compiled with MPI, pvbatch can be launched as an MPI program. In this mode, the first node will load a Python script specified as a command-line argument and execute it using a special built-in connection on all nodes. This application does not support interactive execution.<br />
<br />
* '''paraview''': Python scripts can be run from the paraview client using the Python shell that is invoked from '''Tools'''|Python Shell. The Python shell supports interactive mode as well as loading of scripts from file.<br />
<br />
* '''External Python interpreter''': Any Python-capable application can load the paraview.simple module if the right environment is configured. For this to work, you either have to install the paraview Python modules (including the right shared libraries) somewhere in sys.path or you have to set PYTHONPATH to point to the right locations. <br />
<br />
==Overview==<br />
<br />
The paraview.simple module contains several Python classes designed to be Python-friendly, as well as all classes wrapped from the C++ Server Manager library. The following sections cover the usage of this module and occasionally the paraview.servermanager module, which is lower level.<br />
<br />
==Connecting to a Server==<br />
<br />
ParaView can run in two modes: stand-alone and client/server where the server is usually a visualization cluster. In this section, we discuss how to establish a connection to a server when using ParaView in the client/server mode. If you are using the ParaView graphical interface, you should use Connect from the File menu to connect to a server. If you are using ParaView from a Python shell (not the Python console that is part of the graphical interface), you need to use ''servermanager.Connect()'' to connect a server. <em>Note: you cannot connect to the ParaView application from a stand-alone Python shell. You can only connect to a server.</em> This method takes four arguments, all of which have default values.<br />
<br />
<source lang="python"><br />
def Connect(ds_host=None, ds_port=11111, rs_host=None, rs_port=11111)<br />
</source><br />
<br />
When connecting to a server (pvserver), specify only the first two arguments. These are the server name (or IP address) and port number.<br />
<br />
When connecting to a data-server/render-server pair, you have to specify all four arguments. The first two are the host name (or IP address) and port number of the data server, the last two those of the render server.<br />
Here are some examples:<br />
<br />
<source lang="python"><br />
# Connect to pvserver running on amber1 (first node of our test cluster)<br />
# using the default port 11111<br />
>>> Connect(‘amber1’)<br />
<br />
# Connect to pvdataserver running on the amber cluster, pvrenderserver <br />
# running on Berk’s desktop<br />
>>> Connect(‘amber1’, 12000, ‘kamino’, 11111)<br />
</source><br />
<br />
Note: Connect() will return None on failure. To be safe, you should check the return value of Connect().<br />
<br />
==Getting Help==<br />
<br />
You can access the documentation of all Proxy types by using Python's built-in help.<br />
<br />
<source lang="python"><br />
>>> help(paraview.simple.Cone)<br />
Help on function CreateObject in module paraview.simple:<br />
<br />
CreateObject(*input, **params)<br />
The Cone source can be used to add a polygonal cone to the 3D scene. The output of the <br />
Cone source is polygonal data.<br />
</source><br />
<br />
To get the full documentation, you have to create an instance.<br />
<br />
<source lang="python"><br />
>>> c = Cone()<br />
>>> help(c)<br />
</source><br />
<br />
This documentation is automatically generated from the Server Manager configuration files. It is identical to the class documentation found under the ParaView Help menu, as well as here: http://paraview.org/OnlineHelpCurrent/. <br />
Beyond this document and the online help, there are a few useful documentation sources:<br />
<br />
* The ParaView Guide: http://www.kitware.com/products/paraviewguide.html<br />
<br />
* The ParaView Wiki: http://paraview.org/Wiki/ParaView<br />
<br />
* The ParaView source documentation: http://www.paraview.org/doc/ <br />
<br />
<br />
If you are interested in learning more about the Visualization Toolkit that is at the foundation of ParaView, visit http://vtk.org.<br />
<br />
=Proxies and Properties=<br />
==Proxies==<br />
<br />
The VTK Server Manager design uses the Proxy design pattern (''See Design Patterns: Elements of Reusable Object-Oriented Software by Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides for details''). Quoting from Wikipedia: “A proxy, in its most general form, is a class functioning as an interface to another thing. The other thing could be anything: a network connection, a large object in memory, a file, or some other resource that is expensive or impossible to duplicate”. In the case of Server Manager, a Proxy object acts as a proxy to one-or-more VTK objects. Most of the time, these are server-side objects and are distributed to the server nodes. Proxy objects allow you to interact with these objects as if you directly have access to them, manipulate them, and obtain information about them. When creating visualization pipelines, you create proxies instead of VTK objects. <br />
<br />
<source lang="python"><br />
>>> sphereSource = vtk.vtkSphereSource() # VTK-Python script<br />
<br />
>>> sphereSourceP = Sphere() # ParaView script<br />
</source><br />
<br />
A proxy also provides an interface to modify the properties of the objects it maintains. For example, instead of:<br />
<br />
<source lang="python"><br />
>>> sphereSource.SetCenter(1.0, 1.0, 0.0)<br />
</source><br />
<br />
you can write the following:<br />
<br />
<source lang="python"><br />
>>> sphere.Center = [1.0, 1.0, 0.0]<br />
</source><br />
<br />
When a pipeline object proxy is created, it is set as the active object. You can also set an object as the active one. This is equivalent to clicking-on an object in the pipeline browser.<br />
<br />
<source lang="python"><br />
>>> c = Cone()<br />
<paraview.servermanager.Cone object at 0xaf73090><br />
>>> GetActiveSource()<br />
<paraview.servermanager.Cone object at 0xaf73090><br />
>>> Shrink()<br />
<paraview.servermanager.Shrink object at 0xb4f8610><br />
# Make the cone active<br />
>>> SetActiveSource(c)<br />
</source><br />
<br />
When dealing with objects created through the graphical interface or by loading a state, it is useful to be able to search through existing pipeline objects. To accomplish this, you can use GetSources() and FindSource(). GetSources() returns a dictionary of (name, id) object pairs. Since multiple objects can have the same name, the (name,id) pair identifies objects uniquely. FindSource() returns an object given its name. If there are more than one objects with the same name, the first one is returned.<br />
<br />
<source lang="python"><br />
>>> Cone()<br />
<paraview.servermanager.Cone object at 0xaf73090><br />
>>> GetActiveSource()<br />
<paraview.servermanager.Cone object at 0xaf73090><br />
>>> Shrink()<br />
<paraview.servermanager.Shrink object at 0xb4f8610><br />
>>> SetActiveSource(c)<br />
</source><br />
<br />
To delete pipeline objects, you need to use the Delete() function. Simply letting a Python variable go out of scope is not enough to delete the object. Following the example above:<br />
<br />
<source lang="python"><br />
# Delete the cone source<br />
>>> Delete(c)<br />
# To fully remove the cone from memory, get rid of the<br />
# variable too<br />
>>> del c<br />
</source><br />
<br />
==Properties==<br />
<br />
Property objects are used to read and modify the properties of pipeline objects. Each proxy has a list of properties defined in the Server Manager configuration files. The property interface of the Server Manager C++ library is somewhat cumbersome. Here is how you can set the radius property of a sphere source:<br />
<br />
<source lang="python"><br />
>>> rp = sphere.GetProperty("Radius")<br />
>>> rp.SetElement(0, 2)<br />
1<br />
>>> sphere.UpdateProperty("Radius")<br />
</source><br />
<br />
The servermanager module makes property access much easier by defining Python property accessors for property objects:<br />
<br />
<source lang="python"><br />
>>> sphere.Radius = 3<br />
</source><br />
<br />
Here, Radius is a Python property which, when a value is assigned to it, calls sphere.SetPropertyWithName("Radius",3). Properties can also passed to the function creating the object:<br />
<br />
<source lang="python"><br />
>>> cone = Cone(Radius=0.5, Center=[1, 0.5, 0])<br />
<paraview.servermanager.Cone object at 0xaf73090><br />
</source><br />
<br />
You can also use the SetProperties() function to set property values.<br />
<br />
<source lang="python"><br />
>>> SetProperties(cone, Radius=0.2, Center=[2, 0.5, 0])<br />
</source><br />
<br />
If the first argument is not specified, the active object is used. You also use SetDisplayProperties() and SetViewProperties() to set display (representation) and view properties respectively.<br />
<br />
All Property classes define the following methods:<br />
<br />
* __len__() <br />
* __getitem__()<br />
* __setitem__()<br />
* __getslice__()<br />
* __setslice__()<br />
* GetData()<br />
* SetData(). <br />
<br />
Therefore, all of the following are supported:<br />
<br />
<source lang="python"><br />
>>> sphere.Center<br />
[0.0, 0.0, 0.0]<br />
>>> sphere.Center[0] = 1<br />
>>> sphere.Center[0:3] = [1,2,3]<br />
>>> sphere.Center[0:3]<br />
[1.0, 2.0, 3.0]<br />
>>> len(sphere.Center)<br />
3<br />
</source><br />
<br />
ProxyProperty and InputProperty also define<br />
<br />
* append()<br />
* __delitem__()<br />
* __delslice__()<br />
<br />
to support del() and append(), similar to Python list objects.<br />
<br />
VectorProperty is used for scalars, vectors and lists of integer and floating point numbers as well as <br />
strings. Most properties of this type are simple. Examples include ''Sphere.Radius'' (double scalar), ''Sphere.Center'' (vector of doubles), ''a2DGlyph.Filled'' (boolean), ''a2DGlyph.GlyphType'' (enumeration), ''a3DText.Text'' (string), and ''Contour.Isosurfaces'' (list of doubles). Some properties may be more complicated because they map to C++ methods with mixed argument types. Two good examples of this case are ''Glyph.Scalars'' and ''ExodusIIReader.PointVariables''.<br />
<br />
<source lang="python"><br />
>>> reader = ExodusIIReader(FileName='.../can.ex2')<br />
# These variables are currently selected<br />
>>> reader.PointVariables<br />
['DISPL', 'VEL', 'ACCL']<br />
# These are available in the file<br />
>>> reader.PointVariables.Available<br />
['DISPL', 'VEL', 'ACCL']<br />
# Enable the DISPL array only<br />
>>> reader.PointVariables = ['DISPL']<br />
# Force read<br />
>>> reader.UpdatePipeline()<br />
# Now check the output. Note: GlobalNodeId is generated automatically by the reader.<br />
>>> reader.PointData[:]<br />
[Array: GlobalNodeId, Array: PedigreeNodeId, Array: DISPL]<br />
</source><br />
<br />
This example demonstrates the use of ''ExodusIIReader.PointVariables''. This is a VectorProperty that represents a list of array names. The underlying C++ function has a signature of SetPointResultArrayStatus(const char* name, int flag). This method is usually called once per array to enable or disable it (i.e. to set whether the reader will read a particular array).<br />
<br />
Glyph.Scalars is a bit more complicated. This property allows the developer to select the scalar array with which to scale the glyphs.<br />
<br />
<source lang="python"><br />
>>> sph = Sphere()<br />
>>> elev=Elevation(sph)<br />
# Glyph the points of the sphere with spheres<br />
>>> glyph=Glyph(elev, GlyphType='Sphere')<br />
# Scale the glyph with the Elevation array<br />
>>> glyph.Scalars = 'Elevation'<br />
>>> glyph.Scalars<br />
['POINTS', 'Elevation']<br />
# The above shows the association of the array as well as its name.<br />
# In this case, the array is associated with POINTS as it has to be<br />
# since Glyph cannot scale by cell arrays. We could have done:<br />
>>> glyph.Scalars = ['POINTS', 'Elevation']<br />
# Enable scaling by scalars<br />
>>> glyph.ScaleMode = 'scalar'<br />
</source><br />
<br />
Here the property Scalars maps to SetInputArrayToProcess(int idx, int port, int connection, int fieldAssociation, const char *name), which has four integer arguments (some of which are enumeration) and one string argument (''see vtkAlgorithm documentation for details'').<br />
<br />
Properties are either regular (push) or information (pull) properties. Information properties do not have a VTK method associated with them and are responsible for getting information from the server. A good example of an information property is TimestepValues, which returns all time steps available in a file (if the reader supports time).<br />
<br />
<source lang="python"><br />
>>> reader = ExodusIIReader(FileName='.../can.ex2')<br />
>>> reader.TimestepValues<br />
[0.0, 0.00010007373930420727, 0.00019990510190837085, 0.00029996439116075635, 0.00040008654468692839,<br />
0.00049991923151537776, 0.00059993512695655227, 0.00070004, ...]<br />
</source><br />
<br />
You can obtain a list of properties a proxy supports by using ''help()''. However, this does not allow introspection programmatically. If you need to obtain information about a proxy’s properties programmatically, you can use a property iterator:<br />
<br />
<source lang="python"><br />
>>> for prop in glyph:<br />
print type(prop), prop.GetXMLLabel()<br />
<br />
<class 'paraview.servermanager.InputProperty'> Input<br />
<class 'paraview.servermanager.VectorProperty'> Maximum Number of Points<br />
<class 'paraview.servermanager.VectorProperty'> Random Mode<br />
<class 'paraview.servermanager.ArraySelectionProperty'> Scalars<br />
<class 'paraview.servermanager.ArraySelectionProperty'> Vectors<br />
<class 'paraview.servermanager.VectorProperty'> Orient<br />
<class 'paraview.servermanager.VectorProperty'> Set Scale Factor<br />
<class 'paraview.servermanager.EnumerationProperty'> Scale Mode<br />
<class 'paraview.servermanager.InputProperty'> Glyph Type<br />
<class 'paraview.servermanager.VectorProperty'> Mask Points<br />
</source><br />
<br />
The XMLLabel is the text display by the graphical user-interface. Note that there is a direct mapping from the XMLLabel to the property name. If you remove all spaces from the label, you get the property name. You can use the ''PropertyIterator'' object directly.<br />
<br />
<source lang="python"><br />
>>> it = iter(s)<br />
>>> for i in it:<br />
print it.GetKey(), it.GetProperty()<br />
</source><br />
<br />
==Domains==<br />
<br />
The Server Manager provides information about values that are valid for properties. The main use of this information is for the user-interface to provide good ranges and choices in enumeration. However, some of this information is also very useful for introspection. For example, enumeration properties look like simple integer properties unless a (value, name) pair is associated with them. The Server Manager uses Domain objects to store this information. The contents of domains may be loaded from xml configuration files or computed automatically. For example:<br />
<br />
<source lang="python"><br />
>>> s = Sphere()<br />
>>> Show(s)<br />
>>> dp = GetDisplayProperties(s)<br />
>>> dp.Representation<br />
'Surface'<br />
# The current representation type is Surface. What other types<br />
# are available?<br />
>>> dp.GetProperty("Representation").Available<br />
['Outline', 'Points', 'Wireframe', 'Surface', 'Surface With Edges']<br />
# Choose outline<br />
>>> dp.Representation = 'Outline'<br />
</source><br />
<br />
==Source Proxies==<br />
<br />
Source proxies are proxies that represent pipeline objects (''For more information about VTK pipelines, see the VTK books: http://vtk.org/buy-books.php''). They have special properties to connect them as well as special method to query the meta-data of their output. To connect a source proxy to another, use one of its input properties.<br />
<br />
<source lang="python"><br />
# Either<br />
>>> glyph = Glyph(elev)<br />
# or<br />
>>> glyph.Input = elev<br />
</source><br />
<br />
The SourceProxy class provides several additional properties and methods that are specific to pipelines (See vtkSMSourceProxy documentation for a full list).<br />
* '''UpdatePipelineInformation()''': This method calls UpdateInformation() on the VTK algorithm. It also calls UpdatePropertyInformation() to update any information properties.<br />
* '''UpdatePipeline()''': This method calls Update() on the VTK algorithm causing a pipeline execution if the pipeline changed. Another way of causing pipeline updates is to render. The render view updates all connected pipelines.<br />
* '''GetDataInformation()''': This method is used to obtain meta-data about one output. It is discussed further below.<br />
* PointData and CellData properties discussed below.<br />
<br />
There are two common ways of getting meta-data information from a proxy: information properties and DataInformation. Information properties are updated automatically every time UpdatePropertyInformation() and UpdatePipelineInformation() are called. All you have to do is read the data from the property as usual. To get a DataInformation object from a source proxy use ''GetDataInformation(port=0''). By default, this method returns data information for the first output. You can pass an optional port number to get information for another output. You can get detailed documentation on DataInformation by using help() and by reading online documentation for vtkPVDataInformation (''http://www.paraview.org/doc/nightly/html/classvtkPVDataInformation.html''). Here are the use of some common methods:<br />
<br />
<source lang="python"><br />
>>> di = glyph.GetDataInformation(0)<br />
>>> di<br />
<paraview.servermanager.DataInformation object at 0x2d0920d0><br />
>>> glyph.UpdatePipeline()<br />
# Get the data type.<br />
>>> di.GetDataClassName()<br />
'vtkPolyData'<br />
# Get information about point data. <br />
>>> pdi = di.PointData<br />
# We are now directly accessing the wrapper for a VTK class<br />
>>> len(pdi)<br />
1<br />
# Get information for a point array<br />
>>> ai = pdi[0]<br />
>>> ai.GetRange(0)<br />
(0.0, 0.5)<br />
</source><br />
<br />
When meta-data is not enough and you need access to the raw data, you can use Fetch() to bring it to the client side. Note that this function is provided by the servermanager module. Fetch() has three modes:<br />
<br />
*Append all of the data together and bring it to the client (only available for polygonal and unstructured datasets). Note: Do not do this if data is large otherwise the client will run out of memory.<br />
<br />
*Bring data from a given process to the client.<br />
<br />
*Use a reduction algorithm and bring its output to the client. For example, find the minimum value of an attribute.<br />
<br />
Here is a demonstration:<br />
<br />
<source lang="python"><br />
>>> from paraview.simple import *<br />
>>> Connect("kamino")<br />
Connection (kamino:11111)<br />
>>> s = Sphere()<br />
# Get the whole sphere. DO NOT DO THIS IF THE DATA IS LARGE otherwise<br />
# the client will run out of memory.<br />
>>> allsphere = servermanager.Fetch(s)<br />
getting appended<br />
use append poly data filter<br />
>>> allsphere.GetNumberOfPolys()<br />
96<br />
# Get the piece of the sphere on process 0.<br />
>>> onesphere = servermanager.Fetch(s, 0)<br />
getting node 0<br />
>>> onesphere.GetNumberOfPolys()<br />
48<br />
# Apply the elevation filter so that we have a useful scalar array.<br />
>>> elev = Elevation(s)<br />
# We will use the MinMax algorithm to compute the minimum value of<br />
# elevation. MinMax will be first applied on each processor. The results<br />
# will then be gathered to the first node. MinMax will be then applied<br />
# to the gathered results.<br />
# We first create MinMax without an input.<br />
>>> mm = MinMax(None)<br />
# Set it to compute min<br />
>>> mm.Operation = "MIN"<br />
# Get the minimum<br />
>>> mindata = servermanager.Fetch(elev, mm, mm)<br />
applying operation<br />
# The result is a vtkPolyData with one point<br />
>>> mindata.GetPointData().GetNumberOfArrays()<br />
2<br />
>>> a0 = mindata.GetPointData().GetArray(1)<br />
>>> a0.GetName()<br />
'Elevation'<br />
>>> a0.GetTuple1(0)<br />
0.0<br />
</source><br />
<br />
==Representations and Views==<br />
<br />
Once a pipeline is created, it can be rendered using representations and views. A view is essentially a “window” in which multiple representations can be displayed. When the view is a VTK view (such as RenderView), this corresponds to a collection of objects including vtkRenderers and a vtkRenderWindow. However, there is no requirement for a view to be a VTK view or to render anything. A representation is a collection of objects, usually a pipeline, that takes a data object, converts it to something that can be rendered, and renders it. When the view is a VTK view, this corresponds to a collection of objects including geometry filters, level-of-detail algorithms, vtkMappers and vtkActors. The simple module automatically creates a view after connecting to a server (including the built-in connection when using the stand-alone mode). Furthermore, the simple module creates a representation the first time a pipeline object is displayed with Show().<br />
It is easy to create new views.<br />
<br />
<source lang="python"><br />
>>> view = CreateRenderView()<br />
</source><br />
<br />
CreateRenderView() is a special method that creates the render view appropriate for the ActiveConnection (or for another connection specified as an argument). It returns a sub-class of Proxy. Like the constructor of Proxy, it can take an arbitrary number of keyword arguments to set initial values for properties. Note that ParaView makes the view that was created last the active view. When using Show() without a view argument, the pipeline is shown in the active view. You can get a list of views as well as the active view as follows:<br />
<br />
<source lang="python"><br />
>>> GetRenderViews()<br />
[<paraview.servermanager.RenderView object at 0xaf64ef0>, <paraview.servermanager.RenderView object at 0xaf64b70>]<br />
>>> GetActiveView()<br />
<paraview.servermanager.RenderView object at 0xaf64b70><br />
</source><br />
<br />
You can also change the active view using SetActiveView().<br />
<br />
Once you have a render view, you can use pass it to Show in order to select in which view a pipeline object is displayed. You can also pass it to Render() to select which view is rendered.<br />
<br />
<source lang="python"><br />
>>> Show(elev, GetRenderViews()[1])<br />
<paraview.servermanager.GeometryRepresentation object at 0xaf64e30><br />
>>> Render(GetRenderViews()[1])<br />
</source><br />
<br />
Notice that Show() returns a representation object (aka DisplayProperties in the simple module). This object can be used to manipulate how the pipeline object is displayed in the view. You can also access the display properties of an object using GetDisplayProperties().<br />
<br />
<source lang="python"><br />
>>> dp = GetDisplayProperties(elev)<br />
>>> dp<br />
<paraview.servermanager.GeometryRepresentation object at 0xaf649d0><br />
</source><br />
<br />
Display properties and views have a large number of documented properties some of which are poorly documented. We will cover some them here.<br />
<br />
<source lang="python"><br />
>>> from paraview.simple import *<br />
# Create a simple pipeline<br />
>>> sph = Sphere()<br />
>>> elev = Elevation(sph)<br />
>>> Show(elev)<br />
>>> Render()<br />
# Set the representation type of elev<br />
>>> dp = GetDisplayProperties(elev)<br />
>>> dp.Representation = 'Points'<br />
# Here is how you get the list of representation types<br />
>>> dp.GetProperty("Representation").Available<br />
['Outline', 'Points', 'Wireframe', 'Surface', 'Surface With Edges']<br />
>>> Render()<br />
# Change the representation to wireframe<br />
>>> dp.Representation = 'Wireframe'<br />
>>> Render()<br />
# Let’s get some information about the output of the elevation<br />
# filter. We want to color the representation by one of it’s<br />
# arrays.<br />
# Second array = Elevation. Interesting. Let’s use this one.<br />
>>> ai = elev.PointData[1]<br />
>>> ai.GetName()<br />
'Elevation'<br />
# What is its range?<br />
>>> ai.GetRange()<br />
(0.0, 0.5)<br />
# To color the representation by an array, we need to first create<br />
# a lookup table. We use the range of the Elevation array<br />
>>> dp.LookupTable = MakeBlueToRedLT(0, 0.5)<br />
>>> dp.ColorAttributeType = 'POINT_DATA'<br />
>>> dp.ColorArrayName = 'Elevation' # color by Elevation<br />
>>> Render()<br />
</source><br />
<br />
Here is the result:<br />
[[Image:SMView.png|thumb|center|800px|'''Figure 14.2''' Object displayed in a view]]<br />
<br />
<br />
Once you create a scene, you will probably want to interact with the camera and ResetCamera() is likely to be insufficient. In this case, you can directly get the camera from the view and manipulate it. GetActiveCamera() returns a VTK object (not a proxy) with which you can interact.<br />
<br />
<source lang="python"><br />
>>> camera = GetActiveCamera()<br />
>>> camera<br />
<libvtkCommonPython.vtkCamera vtkobject at 0xe290><br />
>>> camera.Elevation(45)<br />
>>> Render()<br />
</source><br />
<br />
Another common thing to do is to save the view as an image. For this purpose, you can use the WriteImage() method provided by the view:<br />
<br />
<source lang="python"><br />
>> WriteImage("/Users/berk/image.png")<br />
</source><br />
<br />
The resulting image.png looks like this. See the documentation for WriteImage() for details on choosing file type, as well as a magnification factor to save images larger than the view size.<br />
<br />
[[Image:Image.jpg|thumb|center|800px|'''Figure 14.3''' Saving a view as an image]]<br />
<br />
=Advanced Concepts=<br />
<br />
==Dealing with lookup tables==<br />
<br />
As shown earlier, you can use MakeBlueToRedLt(min, max) to create a lookup table. However, this simply creates a new lookup table that the GUI won't be aware of. In the ParaView Qt application, we have special lookup table management that ensures that the same lookup table is used for all arrays with same name and number of components. To reproduce the same behavior in Python, use GetLookupTableForArray().<br />
<br />
<source lang="python"><br />
def GetLookupTableForArray(arrayname, num_components, **params):<br />
"""Used to get an existing lookuptable for a array or to create one if none<br />
exists. Keyword arguments can be passed in to initialize the LUT if a new<br />
one is created. Returns the lookup table."""<br />
....<br />
</source><br />
<br />
This will create a new lookup table and associate it with that array, if none already exists. Any default arguments to be passed to the lookup table if a new one is created, can be specified as additional parameters. You can always change the properties on the lookup table returned by this function.<br />
<br />
<br />
<source lang="python"><br />
# To color the representation by an array, we need to first create<br />
# a lookup table. We use the range of the Elevation array<br />
>>> dp.LookupTable = GetLookupTableForArray("Elevation", 1,<br />
RGBPoints = [min, 0, 0, 1, max, 1, 0, 0],<br />
ColorSpace = "HSV")<br />
>>> dp.ColorAttributeType = 'POINT_DATA'<br />
>>> dp.ColorArrayName = 'Elevation' # color by Elevation<br />
>>> Render()<br />
</source><br />
<br />
==Loading State and Manipulating It==<br />
<br />
Let’s say you created a complicated visualization using the paraview application and now you want to make slight changes to it and run it in a loop as a batch script. What do you do? The best way of dealing with this is to save your visualization state and then load it from Python. Let’s say you have a state file saved as myteststate.pvsm:<br />
<br />
<source lang="python"><br />
>>> from paraview.simple import *<br />
# Load the state<br />
>>> servermanager.LoadState("/Users/berk/myteststate.pvsm")<br />
# Make sure that the view in the state is the active one<br />
>>> SetActiveView(GetRenderView())<br />
# Now render<br />
>>> Render()<br />
# Get the list of sources<br />
>>> GetSources()<br />
{('Sphere1', '5'): <paraview.servermanager.Sphere object at 0xaf80e30>, <br />
('Shrink1', '11'): <paraview.servermanager.Shrink object at 0xaf80df0>, <br />
('Cone1', '8'): <paraview.servermanager.Cone object at 0xaf80cf0>}<br />
# Change the resolution of the cone and render again<br />
>>> FindSource("Cone1").Resolution = 32<br />
>>> Render()<br />
</source><br />
<br />
You can also save state.<br />
<br />
<source lang="python"><br />
>>> from paraview.simple import *<br />
>>> sph = Sphere()<br />
>>> Render()<br />
>>> servermanager.SaveState("/Users/berk/pythonstate.pvsm")<br />
</source><br />
<br />
==Dealing with Time==<br />
<br />
If a reader or a filter supports time, it is easy to request a certain time step from Python. All time requests are set on views that then propagate them to the representations which then propagate them to the visualization pipeline. Here is an example demonstrating how a time request can be made:<br />
<br />
<source lang="python"><br />
>>> Show(ExodusIIReader(FileName=".../can.ex2"))<br />
>>> Render()<br />
# Get a nice view angle<br />
>>> cam = GetActiveCamera()<br />
>>> cam.Elevation(45)<br />
>>> Render()<br />
# Check the current view time<br />
>>> view = GetActiveView()<br />
>>> view.ViewTime<br />
0.0<br />
>>> reader = GetActiveSource()<br />
>>> reader.TimestepValues<br />
[0.0, 0.00010007373930420727, 0.00019990510190837085, <br />
0.00029996439116075635, 0.00040008654468692839, <br />
...]<br />
>>> tsteps = reader.TimestepValues<br />
# Let’s be fancy and use a time annotation filter. This will show the<br />
# current time value of the reader as text in the corner of the view.<br />
>>> annTime = AnnotateTimeFilter(reader)<br />
# Show the filter<br />
>>> Show(annTime)<br />
# Look at a few time steps. Note that the time value is requested not<br />
# the time step index.<br />
>>> view.ViewTime = tsteps[2]<br />
>>> Render()<br />
>>> view.ViewTime = tsteps[4]<br />
>>> Render()<br />
</source><br />
<br />
==Animating==<br />
<br />
Server Manager has a complicated animation engine based on keyframes and scenes. This section will introduce a few simple ways of animating your visualization. <br />
If you have a time-aware reader, you can animate it with AnimateReader().<br />
<br />
<source lang="python"><br />
>>> reader = ExodusIIReader(FileName=“.../can.ex2”)<br />
>>> Show(reader)<br />
>>> Render()<br />
>>> c = GetActiveCamera()<br />
>>> c.Elevation(95)<br />
# Animate over all time steps. Note that we are not passing the optional<br />
# 3rd argument here. If you pass a filename as the 3rd argument, <br />
# AnimateReader will create a movie.<br />
>>> AnimateReader(reader)<br />
# Save the animation to an avi file<br />
>>> AnimateReader(reader, filename=".../movie.avi")<br />
</source><br />
<br />
To animate properties other than time, you can use regular keyframes.<br />
<br />
'''''ParaView 3.8.0 and earlier'''''<br />
----<br />
<font color="blue">Although the following script will work with 3.8.1 and later, it's not the recommended way since the changes done so will not be reflected in the GUI. Refer to the following sub-section for the recommended style for 3.8.1 and later versions.</font><br />
<br />
<source lang="python"><br />
>>> Sphere()<br />
>>> Show()<br />
>>> Render()<br />
<br />
# Create an animation scene<br />
>>> scene = servermanager.animation.AnimationScene()<br />
# Add one view<br />
>>> scene.ViewModules = [GetActiveView()]<br />
<br />
# Create a cue to animate the StartTheta property<br />
>>> cue = servermanager.animation.KeyFrameAnimationCue()<br />
>>> cue.AnimatedProxy = GetActiveSource()<br />
>>> cue.AnimatedPropertyName = "StartTheta"<br />
# Add it to the scene's cues<br />
>>> scene.Cues = [cue]<br />
<br />
# Create 2 keyframes for the StartTheta track<br />
>>> keyf0 = servermanager.animation.CompositeKeyFrame()<br />
>>> keyf0.Interpolation = 'Ramp'<br />
# At time = 0, value = 0<br />
>>> keyf0.KeyTime = 0<br />
>>> keyf0.KeyValues= [0]<br />
<br />
>>> keyf1 = servermanager.animation.CompositeKeyFrame()<br />
# At time = 1.0, value = 200<br />
>>> keyf1.KeyTime = 1.0<br />
>>> keyf1.KeyValues= [200]<br />
<br />
# Add keyframes.<br />
>>> cue.KeyFrames = [keyf0, keyf1]<br />
<br />
>>> scene.Play()<br />
<br />
# Some properties you can change<br />
#<br />
# Number of frames used in Sequence mode<br />
# scene.NumberOfFrames = 100<br />
#<br />
# Or you can use real time mode<br />
# scene.PlayMode = 'Real Time'<br />
# scene.Duration = 20<br />
</source><br />
<br />
<br />
'''ParaView 3.8.1 onwards'''<br />
----<br />
<font color="blue">The following script will only work with ParaView versions 3.8.1 and later.<br />
It is now the recommended way for accessing animation scenes and tracks since the updates<br />
are reflected in the GUI when running through the Python shell from the ParaView application.<br />
</font><br />
<br />
<source lang="python"><br />
>>> Sphere()<br />
>>> Show()<br />
>>> Render()<br />
<br />
# Get the application-wide animation scene<br />
>>> scene = GetAnimationScene()<br />
<br />
# Get the animation track for animating "StartTheta" on the active source.<br />
# GetAnimationTrack() creates a new track if none exists.<br />
>>> cue = GetAnimationTrack("StartTheta")<br />
<br />
# Create 2 keyframes for the StartTheta track<br />
>>> keyf0 = CompositeKeyFrame()<br />
>>> keyf0.Interpolation = 'Ramp'<br />
# At time = 0, value = 0<br />
>>> keyf0.KeyTime = 0<br />
>>> keyf0.KeyValues= [0]<br />
<br />
>>> keyf1 = CompositeKeyFrame()<br />
# At time = 1.0, value = 200<br />
>>> keyf1.KeyTime = 1.0<br />
>>> keyf1.KeyValues= [200]<br />
<br />
# Add keyframes.<br />
>>> cue.KeyFrames = [keyf0, keyf1]<br />
<br />
>>> scene.Play()<br />
<br />
# Some properties you can change<br />
#<br />
# Number of frames used in Sequence mode<br />
# scene.NumberOfFrames = 100<br />
#<br />
# Or you can use real time mode<br />
# scene.PlayMode = 'Real Time'<br />
# scene.Duration = 20<br />
</source><br />
<br />
===GetAnimationTrack Usages===<br />
----<br />
<br />
<source lang="python"><br />
<br />
# Typical usage<br />
>>> track = GetAnimationTrack("Center", 0, sphere) or<br />
>>> track = GetAnimationTrack(sphere.GetProperty("Radius")) or<br />
<br />
# this returns the track to animate visibility of the active source in<br />
# all views.<br />
>>> track = GetAnimationTrack("Visibility")<br />
<br />
# For animating properties on implicit planes etc., use the following<br />
# signatures:<br />
>>> track = GetAnimationTrack(slice.SliceType.GetProperty("Origin"), 0) or<br />
>>> track = GetAnimationTrack("Origin", 0, slice.SliceType)<br />
<br />
</source><br />
<br />
==Loading Data Files==<br />
<br />
As seen throughout this document, you can always load a data file by explicitly creating the reader that can read the data file as follows:<br />
<br />
<source lang="python"><br />
>>> reader = ExodusIIReader(FileName=“.../can.ex2”)<br />
</source><br />
<br />
Alternatively, starting with ParaView 3.8, you can use OpenDataFile() function to let ParaView pick a reader using the extension of the file.<br />
<br />
<source lang="python"><br />
>>> reader = OpenDataFile(“.../can.ex2”)<br />
</source><br />
<br />
==Writing Data Files (ParaView 3.9 or later)==<br />
<br />
To create a writer to write the output from a source, one can use the following:<br />
<br />
<source lang="python"><br />
from paraview.simple import *<br />
<br />
# Specifying the source explicitly<br />
>>> writer= CreateWriter("/.../filename.vtk", source)<br />
<br />
# Using the active source<br />
>>> writer= CreateWriter("/.../filename.vtk")<br />
<br />
# Writing data from a particular output port<br />
>>> writer= CreateWriter("/.../filename.vtk", servermanager.OutputPort(source, 1))<br />
<br />
# Now one change change the ivars on the writer <br />
<br />
# To do the actual writing, use:<br />
>>> writer.UpdatePipeline()<br />
<br />
</source><br />
<br />
==Exporting CSV Data==<br />
<br />
To export a csv from the cell or point data associated with a source, one can use the following:<br />
<br />
<source lang="python"><br />
>>> writer = CreateWriter(".../foo.csv", source)<br />
>>> writer.FieldAssociation = "Points" # or "Cells"<br />
>>> writer.UpdatePipeline()<br />
>>> del writer<br />
</source><br />
<br />
{{ParaView/Template/Footer}}</div>Katie.osterdahlhttps://public.kitware.com/Wiki/index.php?title=ParaView/Users_Guide/Tiled_Display&diff=43657ParaView/Users Guide/Tiled Display2011-10-07T13:01:57Z<p>Katie.osterdahl: </p>
<hr />
<div>== Tiled Display ==<br />
ParaView’s parallel architecture makes it possible to visualize massive amounts of data interactively. When the data is of sufficient resolution that parallel processing is necessary for interactive display, it is often the case that high-resolution images are needed to inspect the data in adequate detail. If you have a 2D grid of display devices, you can run ParaView in tiled display mode to take advantage of it.<br />
<br />
To put ParaView in tiled display mode, give pvserver (or pvrenderserver) the X and Y dimensions of the 2D grid with the ''--tile-dimensions-x'' (or ''-tdx'') and ''--tile-dimensions-y'' (or ''‑tdy'') arguments. The X and Y dimensions default to 0, which disables tiled display mode. If you set only one of them to a positive value on the command line, the other will be set to 1. In tiled display mode, there must be at least as many server (in client / server mode) or render server (in client / data server / render server mode) nodes as tiles. The example below will create a 3x2 tiled display.<br />
<br />
''pvserver -tdx=3 -tdy=2''<br />
<br />
Unless you have a high-end display wall, it is likely that each monitor's bezel creates a gap between the images shown in your tiled display. You can compensate for the bezel width by considering them to be like mullions on a window. To do that, specify the size of the gap (in pixels) through the ''--tile-mullion-x'' (''-tmx'') and ''--tile-mullion-y'' (''-tmy'') command line arguments.<br />
<br />
The IceT library, which ParaView uses for its image compositing, has custom compositing algorithms that work on tiled displays. Although compositing images for large tiled displays is a compute-intensive process, IceT reduces the overall amount of work by employing custom compositing strategies and removing empty tiles from the computation, as demonstrated in Figure 12.5. If the number of nodes is greater than the number of tiles, then the image compositing work will be divided amongst all the processes in the render server. In general, rendering to a tiled display will perform significantly better if there are many more nodes in the cluster than tiles in the display it drives. It also greatly helps if the geometry to be rendered is spatially distributed. Spatially distributed data is broken into contiguous pieces that are contained in small regions of space and are therefore rendered to smaller areas of the screen. IceT takes advantage of this property to reduce the amount of work required to composite the final images. ParaView includes the D3 filter, which redistributes data amongst the processors to ensure a spatially distributed geometry and thus improves tiled rendering performance. <br />
<br />
[[File:ParaView_UsersGuide_TileComposite.png|thumb|center|800px|'''Figure 13.5''' Compositing images for 8 processes on a 4-tile display]]<br />
<br />
Unlike other parallel rendering modes, composited images are not delivered to the client. Instead, image compositing is reserved for generating images on the tiled display, and the desktop renders its own images from a lower resolution version of the geometry to display in the UI. In Tiled Display Mode, ParaView automatically decimates the geometry and sends it to the client to make this happen. However, when the data is very large, even a decimated version of the geometry can overwhelm the client. In this case, ParaView will replace the geometry on the client with a bounding box.<br />
<br />
You have several controls at run-time over the tiled rendering algorithm that you can tune to maintain interactivity while visualizing very large data on very high-resolution tiled displays. These are located on the Tile Display Parameters section of the Render View / Server page of the application settings dialog. These controls are described in the [[ParaView/Users_Guide/Settings | Application Settings]] section of the Appendix.</div>Katie.osterdahlhttps://public.kitware.com/Wiki/index.php?title=ParaView/Users_Guide/Parallel_Rendering&diff=43656ParaView/Users Guide/Parallel Rendering2011-10-07T13:01:18Z<p>Katie.osterdahl: </p>
<hr />
<div>== X Forwarding - Not a Good Idea ==<br />
<br />
Parallel Rendering implies that many processors have some context to render their pixels into. Even though X11 forwarding might be available, you should not run the client remotely and forward its X calls. ParaView will be far more efficient if you let it directly handle the data transfer between local and remote machines. When doing hardware accelerated rendering in GPUs, this implies having X11 or Windows display contexts (either off-screen of on-screen). Otherwise. this implies using off-screen Mesa (OSMesa) linked in to ParaView to do the rendering entirely off-screen into software buffers.<br />
<br />
== Onscreen GPU Accelerated Rendering via X11 Connections ==<br />
<br />
One of the most common problems people have with setting up the ParaView server is allowing the server processes to open windows on the graphics card on each process' node. When ParaView needs to do parallel rendering, each process will create a window that it will use to render. This window is necessary because you need the "x" window before you can create an OpenGL context on the graphics hardware.<br />
<br />
There is a way around this. If you are using the Mesa as your OpenGL implementation, then you can also use the supplemental OSMesa library to create an OpenGL context without an "x" window. However, Mesa is strictly a CPU rendering library so, '''use the OSMesa solution if and only if your server hardware does not have rendering hardware'''. If your cluster does not have graphics hardware, then compile ParaView with [[#OSMesa support|OSMesa support]] and use the ''--use-offscreen-rendering'' flag when launching the server.<br />
<br />
Assuming that your cluster does have graphics hardware, you will need to establish the following three things:<br />
<br />
# Have xdm run on each cluster node at start-up. Although xdm is almost always run at startup on workstation installations, it is not as commonplace to be run on cluster nodes. Talk to your system administrators for help in setting this up.<br />
# Disable all security on the "x" server. That is, allow any process to open a window on the "x" server without having to log-in. Again, talk to your system administrators for help.<br />
# Use the ''-display'' flag for pvserver to make sure that each process is connecting to the display <tt>localhost:0</tt> (or just <tt>:0</tt>).<br />
<br />
To enable the last condition, you would run something like:<br />
<br />
mpirun -np 4 ./pvserver -display localhost:0<br />
<br />
An easy way to test your setup is to use the <tt>glxgears</tt> program. Unlike pvserver, it will quickly tell you (or, rather, fail to start) if it cannot connect to the local "x" server.<br />
<br />
mpirun -np 4 /usr/X11R6/bin/glxgears -display localhost:0<br />
<br />
== Offscreen Software Rendering via OSMesa ==<br />
<br />
When running ParaView in a parallel mode, it may be helpful for the remote rendering processes to do their rendering in off-screen buffers. For example, other windows may be displayed on the node(s) where you are rendering; if these windows cover part of the rendering window, depending on the platform and graphics capabilities, they might even be captured as part of the display results from that node. A similar situation could occur if more than one rendering process is assigned to a single machine and the processes share a display. Also, in some cases, the remote rendering nodes are not directly connected to a display and otherwise if your cluster does not have graphics hardware, then compile ParaView with OSMesa support and use the ''--use-offscreen-rendering'' flag when launching the server.<br />
<br />
The first step to compiling OSMesa support is to make sure that you are compiling with the [http://mesa3d.org Mesa 3D Graphics Library]. It is difficult to tell an installation of Mesa from any other OpenGL implementation (although the existence of an osmesa.h header and a libOSMesa library is a good clue). If you are not sure, you can always download your own copy from http://mesa3d.org. We recommend using either Mesa version 7.6.1 or 7.9.1.<br />
<br />
There are three different ways to use Mesa as ParaView's openGL library:<br />
* You can use it purely as a substitute for GPU enabled onscreen rendering. To do this, set the CMake variable ''OPENGL_INCLUDE_DIR'' to point to the Mesa include directory (the one containing the GL subdirectory) and set the ''OPENGL_gl_LIBRARY'' and ''OPENGL_glu_LIBRARY'' to the libGL and libGLU library files, respectively.<br><br />
<br />
{| border="0" cellpadding="4" cellspacing="4" style="width: 100%;"<br />
|- <br />
| bgcolor="#abcdef" height="8" | '''Variable'''<br />
| bgcolor="#abcdef" height="8" | '''Value'''<br />
| bgcolor="#abcdef" height="8" | '''Description'''<br />
|-<br />
| PARAVIEW_BUILD_QT_GUI<br />
| ON<br />
|<br />
|-<br />
| VTK_USE_COCOA<br />
| ON<br />
| Mac Only. X11 is not supported.<br />
|-<br />
| VTK_OPENGL_HAS_OSMESA<br />
| OFF<br />
| Disable off screen rendering.<br />
|-<br />
| OPENGL_INCLUDE_DIR<br />
| <mesa include dir><br />
| Set this to the include directory in MESA.<br />
|-<br />
| OPENGL_gl_LIBRARY<br />
| libGL<br />
| Set this to the libGL.a or libGL.so file in MESA.<br />
|-<br />
| OPENGL_glu_LIBRARY<br />
| libGLU<br />
| Set this to the libGLU.a or libGLU.so file in MESA.<br />
|}<br />
<br />
* You can use it as a supplement to on-screen rendering. This mode requires that you have a display (X11 is running). In addition to specifying the GL library (which may be a GPU implementation of the Mesa one above), you must tell ParaView where Mesa's OSMesa library is. Do that by turning the ''VTK_OPENGL_HAS_OSMESA'' variable to ON. After you configure again, you will see a new CMake variable called ''OSMESA_LIBRARY''. Set this to the libOSMesa library file.<br><br />
<br />
{| border="0" cellpadding="4" cellspacing="4" style="width: 100%;"<br />
|- <br />
| bgcolor="#abcdef" height="8" | '''Variable'''<br />
| bgcolor="#abcdef" height="8" | '''Value'''<br />
| bgcolor="#abcdef" height="8" | '''Description'''<br />
|-<br />
| PARAVIEW_BUILD_QT_GUI || ON ||<br />
|-<br />
| VTK_USE_COCOA || ON || Mac Only. X11 is not supported.<br />
|-<br />
| VTK_OPENGL_HAS_OSMESA || ON || Turn this to ON to enable software rendering. <br />
|-<br />
| OSMESA_INCLUDE_DIR || <mesa include dir> || Set this to the include directory for MESA.<br />
|-<br />
| OPENGL_INCLUDE_DIR || <mesa include dir> || Set this to the include directory for MESA.<br />
|-<br />
| OPENGL_gl_LIBRARY || libGL || Set this to the libGL.a or libGL.so file.<br />
|-<br />
| OPENGL_glu_LIBRARY || libGLU || Set this to the libGLU.a or libGLU.so file.<br />
|-<br />
| OSMESA_LIBRARY || libOSMesa || Set this to the libOSMesa.a or libOSMesa.so file.<br />
|}<br />
<br />
* You can use it for pure off-screen rendering, which is necessary when there is no display. To do this, make sure that the ''OPENGL_gl_LIBRARY'' variable is empty and that ''VTK_USE_X'' is off. Specify the location of OSMesa and ''OPENGL_glu_LIBRARY'' as above and turn on the ''VTK_USE_OFFSCREEN'' variable.<br><br />
<br />
{| border="0" cellpadding="4" cellspacing="4" style="width: 100%;"<br />
|- <br />
| bgcolor="#abcdef" height="8" | '''Variable'''<br />
| bgcolor="#abcdef" height="8" | '''Value'''<br />
| bgcolor="#abcdef" height="8" | '''Description'''<br />
|-<br />
| PARAVIEW_BUILD_QT_GUI || OFF || When using offscreen rendering there is no gui<br />
|-<br />
| VTK_USE_COCOA || OFF || Mac only.<br />
|-<br />
| VTK_OPENGL_HAS_OSMESA || ON ||Turn this to ON to enable Off Screen MESA.<br />
|-<br />
| OSMESA_INCLUDE_DIR || <mesa include dir> || Set this to the include directory for MESA.<br />
|-<br />
| OPENGL_INCLUDE_DIR || <mesa include dir> || Set this to the include directory for MESA.<br />
|-<br />
| OPENGL_gl_LIBRARY || <empty> || Set this to empty.<br />
|-<br />
| OPENGL_glu_LIBRARY || libGLU || Set this to the libGLU.a or libGLU.so file.<br />
|-<br />
| OSMESA_LIBRARY || libOSMesa || Set this to the libOSMesa.a or libOSMesa.so file.<br />
|}<br />
<br />
Once again, once you build with OSMesa support, it will not take effect unless you launch the server with the ''--use-offscreen-rendering'' flag or alternatively, set the ''PV_OFFSCREEN'' environment variable on the server to one.<br />
<br />
== Compositing ==<br />
<br />
Given that you are connected to a server that is capable of rendering, you have a choice of whether to do the rendering remotely or to do it locally. ParaView’s server performs all data-processing tasks. This includes generation of a polygonal representation of the full data set and of decimated LOD models. Once the data is generated on the server, it is sometimes better to do the rendering remotely and ship pixels to the client for display; other times, it's better to instead shift geometry to the client and have the client render it locally.<br />
<br />
In many cases, the polygonal representation of the data set is much smaller than the original data set. In an extreme case, a simple outline may be used to represent a very large structured mesh; in these instances, it may be better to transmit the polygonal representation from the server to the client, and then let the client render it. The client can render the data repeatedly, when the viewpoint is changed for instance, without causing additional network traffic. Network traffic will only occur when the data changes. If the client workstation has high-performance rendering hardware, it can sometimes render even large data sets interactively in this way.<br />
<br />
The second option is to have each node of the server render its geometry and send the resulting images to the client for display. There is a penalty per rendered frame for compositing images and sending the image across the network. However, ParaView’s image compositing and delivery is very fast, and there are many options to ensure interactive rendering in this mode. Therefore, although small models may be collected and rendered on the client interactively, ParaView’s distributed rendering can render models of all sizes interactively.<br />
<br />
ParaView automatically chooses a rendering strategy to achieve the best rendering performance. You can control the rendering strategy explicitly, forcing rendering to occur entirely on the server or entirely on the client for example, by choosing Settings from the Edit menu of ParaView. Double-click on Render View from the window on the left-hand side of the Settings dialog, and then click on Server. The rendering strategy parameters shown in Figure 12.1 will now be visible. Here we explain in detail the most important of these controls. For an explanation of all controls, see the [[ParaView/Users_Guide/Settings | Appendix]].<br />
<br />
[[File:ParaView_UsersGuide_settings_server.png|thumb|center|600px|'''Figure 13.1''' Parallel rendering parameters]]<br />
<br />
'''Remote Render Threshold''': This slider determines how large the dataset must be in order for parallel rendering with image compositing and delivery to be used (as opposed to collecting the geometry to the client). The value of this slider is measured in megabytes. Only when the entire data set consumes more memory than this value will compositing of images occur. If the check-box beside the Remote Render Threshold slider is unmarked, then compositing will not happen; the geometry will always be collected. This is only a reasonable option when you can be sure the dataset you are using is very small. In general, it is safer to move the slider to the right than to uncheck the box.<br />
<br />
ParaView uses IceT to perform image compositing. IceT is a parallel rendering library that takes multiple images rendered from different portions of the geometry and combines them into a single image. IceT employs several image-compositing algorithms, all of which are designed to work well on distributed memory machines. Examples of two such image-compositing algorithms are depicted in Figure 12.2 and Figure 12.3. IceT will automatically choose a compositing algorithm based on the current workload and available computing resources.<br />
<br />
[[File:ParaView_UsersGuide_TreeComposite.png|thumb|center|800px|'''File 13.2''' Tree compositing on four processes]]<br />
<br />
[[File:ParaView_UsersGuide_BinarySwap.png|thumb|center|800px|'''File 13.3''' Binary swap on four processes]]<br />
<br />
'''Interactive Subsample Rate''': The time it takes to composite and deliver images is directly proportional to the size of the images. The overhead of parallel rendering can be reduced by simply reducing the size of the images. ParaView has the ability to subsample images before they are composited and inflate them after they have been composited. The Interactive Subsample Rate slider specifies the amount by which images are subsampled. This is measured in pixels, and the subsampling is the same in both horizontal and vertical directions. Thus, a subsample rate of two will result in an image that is ¼ the size of the original image. The image is scaled to full-size before it is displayed on the user interface, so the higher the subsample rate, the more obviously pixilated the image will be during interaction as demonstrated in Figure 12.4. When the user is not interacting with the data, no subsampling will be used. If you want subsampling to always be off, unmark the check-box beside the Interactive Subsample Rate slider. <br />
<br />
<br />
{| style="border-spacing:100;"<br />
| style="align:center;border:none;padding-top:0in;padding-bottom:0in;padding-left:0.075in;padding-right:0.075in;"| <br />
<center>[[File:ParaView_UsersGuide_NoSubsampling.png||link=]]</center><br />
| style="align:center;border:none;padding-top:0in;padding-bottom:0in;padding-left:0.075in;padding-right:0.075in;"| <br />
<center>[[File:ParaView_UsersGuide_TwoPixelSubsampling.png||link=]]</center><br />
| style="align:center;border:none;padding-top:0in;padding-bottom:0in;padding-left:0.075in;padding-right:0.075in;"| <br />
<center>[[File:ParaView_UsersGuide_EightPixelSubsampling.png||link=]]</center><br />
<br />
|-<br />
| style="align:center;border:none;padding-top:0in;padding-bottom:0in;padding-left:0.075in;padding-right:0.075in;"| No Subsampling<br />
| style="align:center;border:none;padding-top:0in;padding-bottom:0in;padding-left:0.075in;padding-right:0.075in;"| Subsample Rate: 2 pixels<br />
| style="align:center;border:none;padding-top:0in;padding-bottom:0in;padding-left:0.075in;padding-right:0.075in;"| Subsample Rate: 8 pixels<br />
<br />
|}<br />
<br />
'''Figure 13.4 The effect of subsampling on image quality'''<br />
<br />
<br />
'''Squirt Compression''': When ParaView is run in client/server mode, it uses image compression to optimize the image transfer. The compression uses an encoding algorithm optimized for images called SQUIRT (developed at Sandia National Laboratories). <br />
<br />
SQUIRT uses simple run-length encoding for its compression. A run-length image encoder will find sequences of pixels that are all the same color and encode them as a single run length (the count of pixels repeated) and the color value. ParaView represents colors as 24-bit values, but SQUIRT will optionally apply a bit mask to the colors before comparing them. Although information is lost when this mask is applied, the sizes of the run lengths are increased and the compression improves. The bit masks used by SQUIRT are carefully chosen to match the color sensitivity of the human visual system. A 19-bit mask employed by SQUIRT greatly improves compression with little or no noticeable image artifacts. Reducing the number of bits further can improve compression even more, but it can lead to more noticeable color-banding artifacts. <br />
<br />
The Squirt Compression slider determines the bit mask used during interactive rendering (i.e., rendering that occurs while the user is changing the camera position or otherwise interacting with the data). During still rendering (when the user is not interacting with the data), lossless compression is always used. The check-box to the left of the Squirt Compression slider toggles whether the SQUIRT compression algorithm is used at all.</div>Katie.osterdahlhttps://public.kitware.com/Wiki/index.php?title=ParaView/Users_Guide/Establishing_Connections&diff=43655ParaView/Users Guide/Establishing Connections2011-10-07T13:00:00Z<p>Katie.osterdahl: </p>
<hr />
<div>== Connecting the Client ==<br />
<br />
You establish connections between the independent programs that make up parallel ParaView from within the client’s user interface. The user interface even allows you to spawn the external programs and then automatically connect to them. Once you specify the information that ParaView needs to connect or spawn and connect to the server components, ParaView saves it to make it easy to reuse the same server configuration at a later time. Some visualization centers provide predefined configurations, which makes it trivial to connect to a server that is tailored to that center by simply choosing one from a list in ParaView's GUI.<br />
<br />
The Choose Server dialog shown in Figure 11.8 is the starting point for making and using server configurations. The Connect entry on ParaView client’s File menu brings it up. The dialog shows the servers that you have previously configured. To connect to a server, click its name to select it; then click the Connect button at the bottom of the dialog box. To make changes to settings for a server, select it and click Edit Server. To remove a server from the list, select it and click Delete Server.<br />
<br />
[[File:ParaView_UsersGuide_ConfigureServerDialog.png|thumb|center|800px|'''Figure 12.8''' The Choose Server dialog establishes connections to configured servers]]<br />
<br />
To configure a new server connection, click the Add Server button to add it to the list. The dialog box shown below will appear. Enter a name in the first text entry box; this is the name that will appear in the Choose Server dialog (shown above).<br />
<br />
[[File:ParaView_UsersGuide_ConfigureNewServerDialog.png|thumb|center|800px|'''Figure 12.9''' Configuring a new server]]<br />
<br />
Next, select the type of connection you wish to establish from the Server Type menu. The possibilities are as follows. The “reverse connection” entries mean that the server connects to the client instead of the client connecting to the server. This may be necessary when the server is behind a firewall. Servers are usually run with multiple processes and on a machine other than where the client is running.<br />
<br />
* '''Client / Server''': Attach the ParaView client to a server.<br />
* '''Client / Server (reverse connection)''': Connect a server to the ParaView client.<br />
* '''Client / Data Server / Render Server''': Attach the ParaView client to separate data and render servers.<br />
* '''Client / Data Server / Render Server (reverse connection)''': Attach both a data and a render server to the ParaView client.<br />
<br />
In either of the client / server modes, you must specify the name or IP address of the host machine (node 0) for the server. You may also enter a port number to use, or you may use the default (11111). If you are running in client / data server / render server mode, you must specify one host machine for the data server and another for the render server. You will also need two port numbers. The default one for the data server is 11111; the default for the render server is 22221. <br />
<br />
When all of these values have been set, click the Configure button at the bottom of the dialog. This will cause the Configure Server dialog box, shown in Figure 11.10, to appear. You must first specify the start-up type. The options are Command and Manual. Choose Manual to connect to a server that has been started or will be started externally, on the command line for instance, outside of the ParaView user interface. After selecting Manual, click the Save button at the bottom of the dialog.<br />
<br />
[[File:ParaView_UsersGuide_ConfigureServerManualDialog.png|thumb|center|800px|'''Figure 12.10''' Configure the server manually. It must be started outside of ParaView]]<br />
<br />
If you choose the Command option, in the text window labeled "Execute an external command to start the server:," you must give the command(s) and any arguments for starting the server. This includes commands to execute a command on a remote machine (e.g., ssh) and to run the server in parallel (e.g., mpirun). You may also specify an amount of time to wait after executing the startup command(s) and before making the connection between the client and the server(s). (See the spin box at the bottom of the dialog.) When you have finished, click the Save button at the bottom of the dialog.<br />
<br />
[[File:ParaView_UsersGuide_ConfigureServerCommandDialog.png|thumb|center|800px|'''Figure 12.11''' Enter a command that will launch a new server]]<br />
<br />
Clicking the Save button in the Configure Server dialog will return you to the Choose Server dialog (shown earlier in this section). The server you just configured will now be in the list of servers you may choose from. Thereafter, whenever you run ParaView, you can connect to any of the servers that you have configured. You can also give the ParaView client the ''–-server=server_config_name'' command-line argument to make it automatically connect to any of the servers from the list when it starts.<br />
<br />
You can save and/or load server configurations to and/or from a file using the Save Servers and Load Servers buttons, respectively, on the Choose Server dialog. This is how some visualization centers provide system-wide server configurations to allow the novice user to simply click his or her choice and connect to an already configured ParaView server. The format of the XML file for saving the server configurations is discussed online at http://paraview.org/Wiki/Server_Configuration.</div>Katie.osterdahlhttps://public.kitware.com/Wiki/index.php?title=ParaView/Users_Guide/Starting_Parallel_Servers&diff=43654ParaView/Users Guide/Starting Parallel Servers2011-10-07T12:58:47Z<p>Katie.osterdahl: </p>
<hr />
<div>== Client / Server Mode ==<br />
<br />
Client / Server Mode refers to a parallel ParaView session in which data server and render server components reside within the same set of processes, and the client is completely separate. The pvserver executable combines the two server components into one process. <br />
<br />
You can run pvserver as a serial process on a single machine. If ParaView was compiled with parallel support, you can also run it as an MPI parallel program on a group of machines. Instructions for starting a program with MPI are implementation and system-dependent, so contact your system administrator for information about starting an application with MPI. With the MPICH implementation of MPI, the command to start the server in parallel usually follows the format shown here:<br />
<br />
''mpirun –np number_of_processes path_to/pvserver arguments for pvserver''<br />
<br />
By default, pvserver will start and then wait for the client to connect to it. See the next section for a full description. Briefly, to make the connection, select Connection from the File menu, select (or make and then select) a configuration for the server, and click Connect. Note that you must start the server before the client attempts to connect to it.<br />
<br />
If the computer running the server is behind a firewall, it is useful to have the server initiate the connection instead of the client. The ''‑-reverse-connection'' (or ''-rc'') command-line option tells the server to do this. The server must know the name of the machine to which it should connect; this is specified with the ''--client-host'' (or ''-ch'') argument. Note that when the connection is reversed, you must start the client and instruct it to wait for a connection before the server attempts to connect to it.<br />
<br />
The client-to-server connection is made over TCP, using a default port of 11111. If your firewall puts restrictions on TCP ports, you may want to choose a different port number. In the client dialog, simply choose a port number in the Port entry of the Configure New Server dialog. Meanwhile, give pvserver the same port number by including ''--server-port'' (or ''–sp'') in its command-line argument list.<br />
<br />
An example command line to start the server and have it initiate the connection to a particular client on a particular port number is given below:<br />
<br />
''pvserver –rc –ch=magrathea –sp=26623''<br />
<br />
== Render/Server Mode ==<br />
<br />
The render server allows you to designate a separate group of machines (i.e., apart from the data server and the client) to perform rendering. This parallel mode lets you use dedicated rendering machines for parallel rendering rather than relying on the data server machines, which may have limited or no rendering capabilities. In ParaView, the number of machines (N) composing the render server must be no more than the number (M) composing the data server. <br />
<br />
Note that it is true that some large installations with particularly high-performing, parallel rendering resources it can be very efficient to run ParaView in Render/Server Mode. However, we have found in practice that it is almost always the case that the data transfer time between the two servers overwhelms the speed gained by rendering on the dedicated graphics cluster. For this reason, we typically recommend that you combine the data and render servers together as one component, and either render in software via Mesa on the data processing cluster or do all of the visualization processing directly on the GPU cluster.<br />
<br />
If you still want to break-up the data processing and rendering tasks, there are two sets of connections that must be made for ParaView to run in render-server mode. The first connection set is between the client and the first node of each of the data and render servers. The second connection set is between the nodes of the render server and the first ''n'' nodes of the data server. Once all of these connections are established, they are bi-directional. The diagram in Figure 11.3 depicts the connections established when ParaView is running in render server mode. Each double-ended arrow indicates a bi-directional TCP connection between pairs of machines. The dashed lines represent MPI connections between all machines within a server. In all the diagrams in this section, the render server nodes are denoted by RS 0, RS 1, …, RS N. The data server nodes are similarly denoted by DS 0, DS 1, …, DS N, …, DS M.<br />
<br />
<br />
[[File:ParaView_UsersGuide_RenderServerConnections.png|thumb|center|800px|'''Figure 12.3''' Connections required in render server mode]]<br />
<br />
The establishment of connections between client and servers can either be forward (from client-to-servers) or reverse (from servers-to-client). Likewise, the connections between render server and data server nodes can be established either from the data server to the render server, or from the render server to the data server. <br />
<br />
The main reason for reversing the direction of any of the initial connections is that machines behind firewalls are able to initiate connections to machines outside the firewall, but not vice versa. If the data server is behind a firewall, the data server should initiate the connection with the client, and the data server nodes should connect to the render server nodes. If the render server is behind the firewall instead, both servers should initiate connections to the client, but the render server nodes should initiate the connections with the nodes of the data server.<br />
<br />
In the remaining diagrams in this section, each arrow indicates the direction in which the connection is initially established. Double-ended arrows indicate bi-directional connections that have already been established. In the example command lines, optional arguments are enclosed in <nowiki>[]</nowiki>’s. The rest of this section will be devoted to discussing the two connections required for running ParaView in render server mode.<br />
<br />
=== Connection 1: Connecting the client and servers ===<br />
The first connection that must be established is between the client and the first node of both the data and render servers. By default, the client initiates the connection to each server, as shown in Figure 11.4. In this case, both the data server and the render server must be running before the client attempts to connect to them.<br />
<br />
[[File:ParaView_UsersGuide_RenderServerConnectionsStartNormal.png|thumb|center|800px|'''Figure 12.4''' Starting ParaView in render-server mode using standard connections]]<br />
<br />
To establish the connections shown above, do the following. First, from the command line of the machine that will run the data server, enter ''pvdataserver'' to start it. Next, from the command line of the machine that will run the render server, enter ''pvrenderserver'' to start the render server. Now, from the machine that will run the client, start the client application, and connect to the running servers, as described in section 1.2 and summarized below.<br />
<br />
Start ParaView and select Connect from the File menu to open the Choose Server dialog. Select Add Server to open the Configure New Server dialog. Create a new server connection with a Server Type of Client / Data Server / Render Server. Enter the machine names or IP addresses of the server machines in the Host entries. Select Configure, and then in the Configure Server dialog, choose Manual. Save the server configuration and connect to it. At this point, ParaView will establish the two connections. This is similar to running ParaView in client/server mode, but with the addition of a render server. <br />
<br />
The connection between the client and the servers can also be initiated by the servers. As explained above, this is useful when the servers are running on machines behind a firewall. In this case, the client must be waiting for both servers when they start. The diagram indicating the initial connections is shown in Figure 11.5.<br />
<br />
[[File:ParaView_UsersGuide_RenderServerConnectionsStartReverse.png|thumb|center|800px|'''Figure 12.5''' Reversing the connections between the servers and the client]]<br />
<br />
To establish the connections shown above, start by opening the Configure New Server dialog on the client. Choose '''Client'''|Data Server|Render Server (reverse connection) for the Server Type in the Configure New Server dialog. Next, add both ''--reverse-connection'' (''-rc'') and ''--client-host'' (''-ch'') to the command lines for the data server and render server. The value of the ''--client-host'' parameter is the name or IP address of the machine running the client. You can use the default port numbers for these connections, or you can specify ports in the client dialog by adding the ''--data-server-port'' (''–dsp'') and ''--render-server-port'' (''–rsp'') command-line arguments to the data server and render server command lines. The port numbers for each server must agree with the corresponding Port entries in the dialog, and they must be different from each other.<br />
<br />
For the remainder of this chapter, ''-rc'' will be used instead of ''--reverse-connection'' when the connection between the client and the servers is to be reversed.<br />
<br />
=== Connection 2: Connecting the render and data servers ===<br />
After the connections are made between the client and the two servers, the servers will establish connections with each other. In parallel runs, this server-to-server connection is a set of connections between all N nodes of the render server and the first N nodes of the data server. By default, the data server initiates the connection to the render server, but this can be changed with a configuration file. The format of this file is described below. <br />
<br />
The server that initiates the connection must know the name of the machine running the other server and the port number it is using. In parallel runs, each node of the connecting server must know the name of the machine for the corresponding process in the other server to which it should connect. The port numbers are randomly assigned, but they can be assigned in the configuration file as described below. <br />
<br />
The default set of connections is illustrated in Figure 11.6. To establish these connections, you must give the data server the connection information discussed above, which you specify within a configuration file. Use the ''--machines'' (''–m'') command line argument to tell the data server the name of the configuration file. In practice, the same file should be given to all three ParaView components. This ensures that the client, the render server, and the data server all agree on the network parameters. <br />
<br />
<br />
[[File:ParaView_UsersGuide_RenderDataServerConnectionsStartNormal.png|thumb|center|800px|'''Figure 12.6''' Initializing the connection from the data server to the render server]]<br />
<br />
An example network configuration file, called machines.pvx in this case, is given below: <br />
<br />
<source lang="xml"><br />
<?xml version="1.0" ?><br />
<pvx><br />
<br />
<Process Type="client">><br />
</Process><br />
<br />
<Process Type="render-server"><br />
<Option Name="render-node-port" Value="1357"/><br />
<Machine Name="rs_m1" <br />
Environment="DISPLAY=rs_m1:0"/> <br />
<Machine Name="rs_m2"<br />
Environment="DISPLAY=rs_m2:0"/><br />
</Process><br />
<br />
<Process Host="data-server"><br />
<Machine Name="ds_m1" /><br />
<Machine Name="ds_m2" /><br />
<Machine Name="ds_m3" /><br />
<Machine Name="ds_m4" /><br />
</Process><br />
<br />
</pvx> <br />
<br />
</source><br />
<br />
Sample command-line arguments that use the configuration file above to initiate the network illustrated in Figure 11.6 are given below:<br />
<br />
mpirun –np 2 pvdataserver –m=machines.pvx<br />
<br />
mpirun –np 2 pvrenderserver -m=machines.pvx<br />
<br />
paraview –m=machines.pvx<br />
<br />
It should be noted that the machine configuration file discussed here is a distinct entity and has a different syntax from the server configuration file discussed at the end of the next section. That file is read only by the client; the file discussed here will be given to the client and both servers.<br />
<br />
In the machine file above, the render-node-port entry in the render server’s XML element tells the render server the port number on which it should listen for a connection from the data server, and it tells the data server what port number it should attempt to contact. This entry is optional and if it does not appear in the file, the port number will be chosen automatically. Note that it is not possible to assign port numbers to individual machines within the server; all will be given the same port number or use the automatically-chosen one. Note also that each render server machine is given a display environment variable in this file. This is not required to establish the connections, but it is helpful if you need to assign particular X11 display names to the various render server nodes.<br />
<br />
The initial connection between the nodes of the two servers is made from the data server to the render server. You can reverse this such that the render server nodes connect to the corresponding nodes of the data server instead as shown in Figure 11.7. <br />
<br />
[[File:ParaView_UsersGuide_RenderDataServerConnectionsStartReverse.png|thumb|center|800px|'''Figure 12.7''' Reversing the connection between the servers and client and connecting the render server to the data server]]<br />
<br />
Typically, when the server connection is reversed, the direction of the connection between the client and the servers is also reversed (e.g., if the render server is behind a firewall). In this case, the render server must have the machine names and a connection port number to connect to the data server. The same XML file is used for this arrangement as is with the standard connection. The only difference in this case is that the render-node-port entry, if it is used, must appear in the data server’s XML element instead of the render server’s element. Example command-line arguments to initiate this type of network are given here:<br />
<br />
paraview –m=machines.pvx <br />
<br />
mpirun –np M pvdataserver –m=machines.pvx -rc -ch=''client''<br />
<br />
mpirun –np N pvrenderserver –m=machines.pvx -rc -ch=''client''</div>Katie.osterdahlhttps://public.kitware.com/Wiki/index.php?title=Users_Guide_Client-Server_Visualization&diff=43653Users Guide Client-Server Visualization2011-10-07T12:57:39Z<p>Katie.osterdahl: </p>
<hr />
<div>= Parallel ParaView =<br />
<br />
One of the main purposes of ParaView is to allow users to create visualizations of large data sets that reside on parallel systems without first collecting the data to a single machine. Transferring the data is often slow and wasteful of disk resources, and the visualization of large data sets can easily overwhelm the processing and especially memory resources of even high-performance workstations. This chapter first describes the concepts behind the parallelism in ParaView. We then discuss in detail the process of starting-up ParaView's parallel server components. Lastly, we explain how a parallel visualization session is initiated from within the user interface. Parallel rendering is an essential part of parallel ParaView, so essential that we've given it its own [[ParaView/Users Guide/Parallel Rendering | chapter]] in this version of the book. <br />
<br />
The task of setting up a cluster for visualization is unfortunately outside of the scope of this book. However, there are several online resources that will help to get you started including:<br />
* http://paraview.org/Wiki/Setting_up_a_ParaView_Server,<br />
* http://www.iac.es/sieinvens/siepedia/pmwiki.php?n=HOWTOs.ParaviewInACluster <br />
* http://paraview.org/Wiki/images/a/a1/Cluster09_PV_Tut_Setup.pdf<br />
<br />
== Parallel Structure ==<br />
ParaView has three main logical components: client, data server, and render server. The client is responsible for the GUI and is the interface between you the user and ParaView as a whole. The data server reads in files and processes the data through the pipeline. The render server takes the processed data and renders it to present the results to you. <br />
<br />
[[File:ParaView_UsersGuide_parallel_architecture.png|thumb|center|800px|'''Figure 12.1''' Parallel Architecture]]<br />
<br />
The three logical components can be combined in various different configurations. When ParaView is started, the client is connected to what is called the built-in server; in this case, all three components exist within the same process. Alternatively, you can run the server as an independent program and connect a remote client to it, or run the server as a standalone parallel batch program without a GUI. In this case, the server process contains both the data and render server components. The server can also be started as two separate programs: one for the data server and one for the render server. The server programs are data-parallel programs that can be run as a set of independent processes running on different CPUs. The processes use MPI to coordinate their activities as each works on different pieces of the data.<br />
<br />
[[file:ParaView_UsersGuide_common_configurations.png|thumb|center|800px|'''Figure 12.2''' Common Configurations of the logical components]]<br />
<br />
=== Client ===<br />
The client is responsible for the user interface of the application. ParaView’s general-purpose client was written to make powerful visualization and analysis capabilities available from an easy-to-use interface. The client component is a serial program that controls the server components through the Server Manager API.<br />
<br />
=== Data Server ===<br />
The data server is primarily constructed from VTK readers, sources, and filters. It is responsible for reading and/or generating data, processing it, and producing geometric models that the render server and client will display. The data server exploits data parallelism by partitioning the data, adding ghost levels around the partitions as needed, and running synchronous parallel filters. Each data server process has an identical VTK pipeline, and each process is told which partition of the data it should load and process. By splitting the data, ParaView is able to use the entire aggregate system memory and thus make large data processing possible.<br />
<br />
=== Render Server ===<br />
The render server is responsible for rendering the geometry. Like the data server, the render server can be run in parallel and has identical visualization pipelines (only the rendering portion of the pipeline) in all of its processes. Having the ability to run the render server separately from the data server allows for an optimal division of labor between computing platforms. Most large computing clusters are primarily used for batch simulations and do not have hardware rendering resources. Since it is not desirable to move large data files to a separate visualization system, the data server can run on the same cluster that ran the original simulation. The render server can be run on a separate visualization cluster that has hardware rendering resources.<br />
<br />
It is possible to run the render server with fewer processes than the data server but never more. Visualization clusters typically have fewer nodes than batch simulation clusters, and processed geometry is usually significantly smaller than the original simulation dump. ParaView repartitions the geometric models on the data server before they are sent to the render server.<br />
<br />
== MPI Availability ==<br />
<br />
Until recently, in order to use ParaView's parallel processing features, you needed to build ParaView from the source code as described in the [[ParaView:Build_And_Install | Appendix]]. This was because there are many different versions of MPI, the library ParaView’s servers use internally for parallel communication, and for high-performance computer users it is extremely important to use the version that is delivered with your networking hardware. <br />
<br />
As of ParaView 3.10 however, we have begun to package MPI with our binary releases. If you have a multi-core workstation, you can now simply turn on the Use Multi-Core setting under ParaView's [[ParaView/Users_Guide/Settings | Settings]] to make use of all of them. This option makes Parallel Data Server mode the default configuration, which can be very effective when you are working on computationally bound intensive processing tasks. <br />
<br />
Otherwise, and when you need to run ParaView on an actual distributed memory cluster, you need to start-up the various components and establish connections between them as is described in the next section.</div>Katie.osterdahlhttps://public.kitware.com/Wiki/index.php?title=ParaView/Users_Guide/Annotation&diff=43645ParaView/Users Guide/Annotation2011-10-06T18:06:01Z<p>Katie.osterdahl: </p>
<hr />
<div>= Annotation =<br />
In ParaView, there are several ways to annotate the data to better understand or explain it. Several of the annotations can be interactively placed in the 3D scene. The parameters of the annotations are controlled using traditional user interface elements. Some types of annotation are discussed in other parts of this book. See the section on [[ParaView/Users_Guide/Selection#Label Selected Cell/Points|Selection]] for information about labeling selected points or cells in a data set. <br />
<br />
== Scalar Bar ==<br />
The most straightforward way to display a scalar bar (or color legend) in the active 3D view is to use the Color Legend Visibility button [[File:ParaView_UsersGuide_ColorLegendButton.png||link=]] on the Active Variables Control toolbar. When the data set selected in the Pipeline Browser is being colored by a variable (i.e., something other than Solid Color is selected in the Color by menu on the Display tab), this button is active. Clicking it toggles the visibility (in the selected 3D view) of a scalar bar showing the mapping from data values to colors for that variable. <br />
<br />
[[File:ParaView_UsersGuide_scalarBar.png|thumb|center|800px|'''Figure 9.1''' Scalar Bar displaying X-component of Normals]]<br />
<br />
Clicking the Edit Color Map button to the right of the [[File:ParaView_UsersGuide_ColorLegendButton.png||link=]]Color Legend button brings up the Color Scale Editor dialog. As described in the [http://paraview.org/Wiki/ParaView/Displaying_Data Displaying Data] chapter, you have precise control over the mapping between data values and visible colors on the Color Scale tab of that dialog.<br />
<br />
On the Color Legend tab, there are several different parameters that allow you to control the appearance of the color legend itself. First is the Show Color Legend check box which toggles the visibility of the scalar bar (color legend) in the 3D view. This has the same effect as using the color legend visibility button. Below the Show Color Legend check button are the controls for displaying the title and labels on the scalar bar. In the Title section, the Text entry box specifies the label that appears above the scalar bar. It defaults to the name of the array used for coloring the data set. If the current data set is being colored by a vector array, the value of the second entry box defaults to specifying how the color is determined from the vector (i.e.,X, Y, Z, or Magnitude). The entry box labeled Labels contains formatting text specifying the form of the scalar bar labels (numbers). The format specification used is the same as that used by the print function in C++. <br />
<br />
[[File:ParaView_UsersGuide_colorLegendDialog.png|thumb|center|800px|'''Figure 9.2''' The color legend tab of the Color Scale Editor dialog]]<br />
<br />
Below each of the Title and Labels entry boxes are controls for determining how the title and labels will be drawn in the display area. The leftmost control is a menu for choosing the font; the available fonts are Arial (the default), Courier, and Times. Next are three formatting attribute buttons controlling whether the text is boldfaced, italicized, or shadowed. The next interface control is a spin box for controlling the text’s opacity. It ranges from 0 (transparent) to 1 (opaque).<br />
<br />
At the bottom of this tab is a Number of Labels spin box. This determines how many scalar-value labels will be shown alongside the scalar bar. To the right of that is an Aspect Ratio spin box which allows you to make the scalar bar relatively thinner or thicker.<br />
<br />
When the scalar bar is displayed in the 3D scene, it can be positioned and resized interactively, similar to interacting with [[Users Guide Widgets|3D widgets]]. Clicking and dragging the scalar bar with the left mouse button repositions it in the display area. If the scalar bar begins to move beyond the left-or-right side of the display area, it is reoriented vertically. If it is moving off-screen at the top or bottom of the display area then it is reoriented in a horizontal direction. The scalar bar can be resized by left-clicking and dragging any of its sides or corners.<br />
<br />
<br />
== Orientation Axes ==<br />
When interacting with data in ParaView, it can be difficult to determine how the data set is oriented in 3D. To remedy this problem, a marker showing labeled 3D axes (i.e., orientation axes) can be displayed. The orientation of the axes matches that of the data, and the axes reorient themselves as the camera is rotated about the 3D scene.<br />
<br />
[[File:ParaView_UsersGuide_OrientationAxes.png|thumb|center|800px|'''Figure 9.3''' 3D Orientation Axes]]<br />
<br />
The user interface controls for the orientation axes are located in the Annotation section of the View Settings dialog ('''Edit'''|View Settings) for the 3D view. The check-box beside the Orientation Axes label toggles the visibility of the orientation axes. The Interactive check box controls whether the orientation axes can be repositioned and resized through mouse interaction, similar to interacting with [[Users Guide Widget|3D widgets]]. Left-clicking and dragging the orientation axes repositions them in the 3D view. When the orientation axes are in interactive mode, a bounding rectangle (outline) is displayed around the axes when the mouse moves over them. Left-clicking and dragging on the edges of this outline resizes the orientation axes. <br />
<br />
From the Set Outline Color button (enabled when Interactive is checked), you can change the color used for displaying the bounding rectangle. This is useful for making the outline more visible if its current color is similar to the color of the background or any object behind the outline (if the orientation axes are placed in front of a data set). The orientation axes are always drawn in front of any data set occupying the same portion of the 3D view. The Axis Label Color button allows you to change the color of the labels for the three axes. The reasons for changing the color of the axis labels are similar to those for changing the outline color.<br />
<br />
[[File:ParaView_UsersGuide_OrientationAxesUI.png|thumb|center|800px|'''Figure 9.4''' User interface controls for orientation axes (in 3D view's view settings dialog)]]<br />
<br />
== Center of Rotation ==<br />
<br />
On the same dialog box, you also have control over whether or not the center of rotation should be annotated. This annotation demarcates the location in which the camera rotates. ParaView uses the center of the initial data set loaded into the pipeline as the default value. You can control this placement and display of the center of rotation display via the Center Axes Control toolbar ('''View'''|Toolbars|Center Axes Control). If you need to specify an exact coordinate you may do so via the Adjust Camera dialog exposed by the rightmost button on the left set of buttons above the 3D view.<br />
<br />
== Text Display ==<br />
Often users want to display additional text in the 3D view (e.g., when generating a still image or an animation). In ParaView, there are a variety of ways to do this, all through the use of sources and filters. The Text source displays 2D text in the 3D scene, the 3D Text source does the same for 3D text, and the Annotate Time filter shows the current time using a text annotation in the 3D view.<br />
<br />
=== Text Source ===<br />
The Text source allows you display arbitrary 2D text on top of a 3D view. It is available from the Sources menu. On its Properties tab, enter whatever text you wish to be displayed in the Text entry area, and press the Apply button.<br />
<br />
Once the text has been added to the 3D view, you can reposition it by left-clicking and dragging the text. (A bounding box will be displayed around the text.) By default, the text is displayed in the lower left corner of the 3D view.<br />
<br />
The Display tab in the Object Inspector for the Text source is different than for most other sources and filters displayed in the 3D view. Specific controls are given for positioning the text and setting various font properties.<br />
<br />
[[File:ParaView_UsersGuide_TextDisplayTab.png|thumb|center|800px|'''Figure 9.5''' Display tab for the Text source]]<br />
<br />
The first check box, Show Text, toggles the visibility of the text in the 3D view. This corresponds to the eye icon in the Pipeline Browser for this source. The Interactive check box below it determines whether the text may be interactively repositioned by clicking and dragging in the 3D view.<br />
<br />
The Text Property section of the Display tab allows you to specify various parameters relating to the font used for displaying the text. The Font Size spin box determines how large the letters in the text will be. The Font menu determines which font type will be used: Ariel, Courier, or Times. The three buttons beside this menu indicate whether the text will be drawn boldfaced, italicized, and/or using shadows. The Align menu specifies whether the text will be left, center, or right-aligned within its bounds box. The Opacity spin box determines how opaque the text appears. An opacity value of 0 corresponds to completely transparent text, while an opacity value of 1 means completely opaque text. The Color button beside the Opacity spin box allows you to choose a color for the text.<br />
<br />
The Text Position of the Display tab is used for specifying exactly where in the 3D view the text appears. If Use Window Location is unchecked, then the Lower Left Corner section is active. The two spin boxes provided determine the X and Y coordinates of the lower left corner of the bounding box of the text, specified in normalized coordinates (starting from the lower left corner of the view).<br />
<br />
If Use Window Location is checked, then the six buttons in that section of the interface become available. They allow you to choose various locations within the view for anchoring the text. Using the top row of buttons, you may place the text in the upper left corner, in the top center of the view, or in the upper right corner. The bottom row of button behaves similarly for the bottom portion of the 3D view.<br />
<br />
=== 3D Text Source ===<br />
<br />
Whereas the Text source positions text in 2D, overlaying the 3D scene, the 3D Text source places text in the 3D scene. The text is affected by rotation, panning, and zooming as is any other object in the 3D scene. <br />
<br />
You can control the placement of the 3D text in two ways. First, the Display tab for all sources and filters shown in a 3D view have controls to position, translate, rotate, and scale the object via textual controls. However, it is often easier to use a the Transform filter for the same purpose. The transform filter allows you to drag, rotate and scale the object via either the 3D widget in the scene, or via the text controls on its Properties tab.<br />
<br />
=== Annotate Time ===<br />
<br />
The Annotate Time source and filter are useful for labeling a time-varying data set or animation with ParaView’s current time in a 3D view. The distinction between the two is somewhat abstract. VTK's temporal support works by have the pipeline request data for a particular time; the text source displays exactly this. VTK's sources and filters are allowed to produce data at different times (usually nearby producing data that changes over a step function in time). The annotate time filter shows the data produces by an given filter.<br />
<br />
In either case, the annotated time value is drawn as a 2D label, similar to the output of the Text source. The Properties tab for this filter provides a single text box labeled Format. From this text box, you may specify a format string (print style) indicating how the label will appear in the scene. As with the output of the Text source, this label may be interactively repositioned in the scene. The Display tab for this source is the same as the one for the Text source; it is described earlier in this section.<br />
<br />
[[File:ParaView_UsersGuide_AnnotateTime.png|thumb|center|800px|'''Figure 9.6''' Using the Annotate Time filter to display the current time in a time-varying data set]]<br />
<br />
== Other sources as Annotations ==<br />
<br />
Most of the other items in the Sources menu can also be used for annotation of the 3D scene. Placement of these is similar to placement of the 3D Text source. In particular the 2D Glyph, Ruler, and Outline sources are frequently used for annotation. <br />
<br />
As the name implies, the ruler allows for some quantitative measurement of the data. The ruler produces a Line widget in the 3D scene. It is most effective to use the 'P' key to place the two ends of the line in the 3D scene in turn. When placed the Properties tab, the ruler lists the length of the line you've placed in space. In Figure 9.7, a ruler is being used to measure the distance between the cows horns.<br />
<br />
== Cube Axes ==<br />
<br />
Finally, in the Annotation area of the Display tab of any object shown in a 3D view, you can toggle the display of a Cube Axes Display. Like the ruler source, the cube axes allows you to inspect to world space extent of objects in the scene. When this display is enabled, a gridded, labelled bounding box is drawn around the object that lets you quickly determine the world space extent in each dimension of the object.<br />
<br />
[[File:ParaView_UsersGuide_cubeAxes_and_Ruler.png|thumb|center|800px|'''Figure 9.7''' Cube Axes and Rulers used to measure a cow and its horns]]<br />
<br />
Pressing the Edit button next to the enable check box brings up a dialog that lets you customize the presentation of the axes display. You have one tab on this dialog for each of the three axes. Use the Title entry to specify a label. Use the Show Axes check box to enable or disable the given axes. Show Ticks and Show Minor Ticks let you customize the division markers along the axis. Show Grid Lines extends the major tick marks so that they completely surround the object. The Custom Bounds entry allows you to specify your own extent for that axis label. <br />
<br />
At the bottom of the dialog box are controls over all three axes. The Fly Mode drop-down controls the way the axes are drawn on different axes dependent on the camera orientation. Outer Edges draws opposing edges so as to space the annotation as widely as possible. Closest Triad and Furthest Triad draw the nearest and furthest corners respectively. The two static options lock the choice of edges to draw so that they do not change as the camera moves. Tick Location draws the tick marks inward toward the center of the object, outward away from the center, or in both directions simultaneously. Corner Offset puts some space between the actual bounds and the displayed axes, which is useful for minimizing visual clutter. Finally, you have control over the color of the axes through the Set Axes Color pop-up color selector.<br />
<br />
[[File:ParaView_UsersGuide_cubeAxes_UI.png|thumb|center|800px|'''Figure 9.8''' Edit Cube Axes Dialog]]</div>Katie.osterdahlhttps://public.kitware.com/Wiki/index.php?title=ParaView/Users_Guide/Information_Panel&diff=41732ParaView/Users Guide/Information Panel2011-07-18T22:03:34Z<p>Katie.osterdahl: </p>
<hr />
<div>== Introduction ==<br />
<br />
Clicking on the Information button on the Object Inspector will take you to the Information Panel. The purpose of this panel is to provide you with information about the output of the currently selected source, reader or filter. The information on this panel is presented in several sections. We start by describing the sections that are applicable to all dataset types then we describe data specific sections.<br />
<br />
== File Properties ==<br />
<br />
[[Image:ParaView_UG_Info_Properties.png|thumb|center|400px|'''Figure 3.12''' File properties]]<br />
<br />
If the current pipeline object is a reader, the top section will display the name of the file and its full path, as in Figure 3.12.<br />
<br />
== Data Statistics ==<br />
<br />
[[Image:ParaView_UG_Info_Statistics.png|thumb|center|400px|'''Figure 3.13''' Data statistics]]<br />
<br />
The Statistics section displays high-level information about the dataset including the type, number of points and cells and the total memory used. Note that the memory is for the dataset only and does not include memory used by the representation (for example, the polygonal mesh that may represent the surface). All of this information is for the current time step.<br />
<br />
== Array Information ==<br />
<br />
[[Image:ParaView_UG_Info_Arrays.png|thumb|center|400px|'''Figure 3.14''' Array information]]<br />
<br />
The data shown in Figure 3.14 shows the association (point, cell or global), name, type and range of each array in the dataset. In the example, the top three attributes are point arrays, the middle three are cell arrays and the bottom three are global (field) arrays. Note that for vectors, the range of each component is shown separately. In case, the range information does not fit the frame, the tooltip will display all of the values.<br />
<br />
== Bounds == <br />
<br />
[[Image:ParaView_UG_InfoBounds.png|thumb|center|400px|'''Figure 3.15''' Bounds information]]<br />
<br />
The Bounds section will display the spatial bounds of the dataset. These are the coordinates of the smallest axis-aligned hexahedron that contains the dataset as well as its dimensions, as in Figure 3.15.<br />
<br />
== Timesteps ==<br />
<br />
[[Image:ParaView_UG_Info_Temporal.png|thumb|center|400px|'''Figure 3.16''' Time section showing timesteps]]<br />
<br />
The Time section (see Figure 3.16) shows the index and value of all time steps available in a file or produceable by a source. Note that this section display values only when a reader or source is selected even though filters downstream of such sources also have time varying outputs. Also note that usually only one time step is loaded at a time.<br />
<br />
== Extents ==<br />
<br />
[[Image:ParaView_UG_Info_Extents.png|thumb|center|400px|'''Figure 3.17''' Extents]]<br />
<br />
The Extents section, seen in Figure 3.17, is available only for structured datasets (uniform rectilinear grid, rectilinear grid and curvilinear grid). It displays the extent of all three indices that define a structured datasets. It also displays the dimensions (the number of points) in each direction. Note that these refer to logical extents and the labels X Extent, Y Extent and Z Extent can be somehow misleading for curvilinear grids.<br />
<br />
== Data Hierarchy (AMR) == <br />
<br />
[[Image:ParaVIew_UG_Info_Amr.png|thumb|center|400px|'''Figure 3.18''' Data hierarchy for AMR]]<br />
<br />
For AMR datasets, the Data Hierarchy section, Figure 3.18, shows the various refinement levels available in the dataset. Note that you can drill down to each level by clicking on it. All of the other sections will immediately update for the selected level. For information on the whole dataset, select the top parent called "AMR Dataset."<br />
<br />
== Data Hierarchy (Multi-Block Dataset) ==<br />
<br />
[[Image:ParaView_UG_Info_Multiblock.png|thumb|center|400px|'''Figure 3.19''' Data hierarchy for multi-block datasets]]<br />
<br />
For multi-block datasets, the Data Hierarchy section shows the tree that forms the multi-block dataset. By default, only the first level children are shown. You can drill down further by clicking on the small triangle to the left of each node. Note that you can drill down to each block by clicking on it. All of the other sections will immediately update for the selected block. For information on the whole dataset, select the top parent called "Multi-Block Dataset".</div>Katie.osterdahlhttps://public.kitware.com/Wiki/index.php?title=ParaView/Users_Guide/VTK_Data_Model&diff=41730ParaView/Users Guide/VTK Data Model2011-07-18T21:58:55Z<p>Katie.osterdahl: </p>
<hr />
<div>== Introduction == <br />
To use ParaView effectively, you need to understand the ParaView data model. This chapter briefly introduces the VTK data model used by ParaView. For more details, refer to one of the VTK books.<br />
<br />
The most fundamental data structure in VTK is a data object. Data objects can either be scientific datasets such rectilinear grids or finite elements meshes (see below) or more abstract data structures such as graphs or trees. These datasets are formed of smaller building blocks: mesh (topology and geometry) and attributes.<br />
<br />
== Mesh ==<br />
<br />
Even though the actual data structure used to store the mesh in memory depends on the type of the dataset, some abstractions are common to all types. In general, a mesh consists of vertices (points) and cells (elements, zones). Cells are used to discretize a region and can have various types such a tetrahedra, hexahedra etc. Each cell contains a set of vertices. The mapping from cells to vertices is called the connectivity. Note that even though it is possible to define data elements such as faces and edges, VTK does not represent these explicitly. Rather, they are implied by a cell's type and its connectivity. One exception to this rule is the arbitrary polyhedron which explicitly stores its faces. Figure 3.1 is an example mesh that consists of 2 cells. The first cell is defined by vertices (0, 1, 3, 4) and the second cell is defined by vertices (1, 2, 4, 5). These cells are neighbors because they share the edge defined by the points (1, 4).<br />
<br />
[[Image:ParaView_UG_Cells.png|thumb|center|400px|'''Figure 3.1''' Example of a mesh]]<br />
<br />
A mesh is fully defined by its topology and the spatial coordinates of its vertices. In VTK, the point coordinates may be implicit or explicitly defined by a data array of dimensions (number_of_points x 3).<br />
<br />
== Attributes (fields, arrays) ==<br />
<br />
An attribute (or a data array or field) defines the discrete values of a field over the mesh. Examples of attributes include pressure, temperature, velocity and stress tensor. Note that VTK does not specifically define different types of attributes. All attributes are stored as data arrays which can have an arbitrary number of components. ParaView makes some assumptions in regards to the number of components. For example, a 3-component array is assumed to be an array of vectors. Attributes can be associated with points or cells. It is also possible to have attributes that are not associated with either. Figure 3.2 demonstrates the use of a point-centered attribute. Note that the attribute is only defined on the vertices. Interpolation is used to obtain the values everywhere else. The interpolation functions used depend on the cell type. See VTK documentation for details.<br />
<br />
[[Image:ParaView_UG_Cells_with_values.png|thumb|center|500px|'''Figure 3.2''' Point-centered attribute in a data array or field]]<br />
<br />
Figure 3.3 demonstrates the use of a cell-centered attribute. Note that cell-centered attributes are assumed to be constant over each cell. Due to this property, many filters in VTK cannot be directly applied to cell-centered attributes. It is normally required to apply a Cell Data to Point Data filter. In ParaView, this filter is applied automatically when necessary.<br />
<br />
[[Image:ParaView_UG_Cells_with_cvalues.png|thumb|center|500px|'''Figure 3.3''' Cell-centered attribute]]<br />
<br />
== Uniform Rectilinear Grid (Image Data) ==<br />
<br />
[[Image:ParaView_UG_Image.png|thumb|center|400px|'''Figure 3.4''' Sample uniform rectilinear grid]]<br />
<br />
A uniform rectilinear grid, or image data, defines its topology and point coordinates implicitly. To fully define the mesh for an image data, VTK uses the following:<br />
<br />
* Extents - these define the minimum and maximum indices in each direction. For example, an image data of extents (0, 9), (0, 19), (0, 29) has 10 points in the x-direction, 20 points in the y-direction and 30 points in the z-direction. The total number of points is 10*20*30.<br />
* Origin - this is the position of a point defined with indices (0, 0, 0)<br />
* Spacing - this is the distance between each point. Spacing for each direction can defined independently<br />
<br />
The coordinate of each point is defined as follows: ''coordinate = origin + index*spacing'' where coordinate, origin, index and spacing are vectors of length 3.<br />
<br />
Note that the generic VTK interface for all datasets uses a flat index. The (i,j,k) index can be converted to this flat index as follows: idx_flat = k*(npts_x*npts_y) + j*nptr_x + i.<br />
<br />
A uniform rectilinear grid consists of cells of the same type. This type is determined by the dimensionality of the dataset (based on the extents) and can either be vertex (0D), line (1D), pixel (2D) or voxel (3D).<br />
<br />
Due to its regular nature, image data requires less storage than other datasets. Furthermore, many algorithms in VTK have been optimized to take advantage of this property and are more efficient for image data.<br />
<br />
== Rectilinear Grid ==<br />
<br />
[[Image:ParaView_UG_Rectilinear.png|thumb|center|400px|'''Figure 3.5''' Rectilinear grid]]<br />
<br />
A rectilinear grid such as Figure 3.5 defines its topology implicitly and point coordinates semi-implicitly. To fully define the mesh for a rectilinear grid, VTK uses the following:<br />
<br />
* Extents - these define the minimum and maximum indices in each direction. For example, a rectilinear grid of extents (0, 9), (0, 19), (0, 29) has 10 points in the x-direction, 20 points in the y-direction and 30 points in the z-direction. The total number of points is 10*20*30.<br />
* Three arrays defining coordinates in the x-, y- and z-directions. These arrays are of length npts_x, npts_y and npts_z. This is a significant savings in memory as total memory used by these arrays is npts_x+npts_y+npts_z rather than npts_x*npts_y*npts_z.<br />
<br />
The coordinate of each point is defined as follows: ''coordinate = (coordinate_array_x(i), coordinate_array_y(j), coordinate_array_z(k))".<br />
<br />
Note that the generic VTK interface for all datasets uses a flat index. The (i,j,k) index can be converted to this flat index as follows: idx_flat = k*(npts_x*npts_y) + j*nptr_x + i.<br />
<br />
A rectilinear grid consists of cells of the same type. This type is determined by the dimensionality of the dataset (based on the extents) and can either be vertex (0D), line (1D), pixel (2D) or voxel (3D).<br />
<br />
== Curvilinear Grid (Structured Grid) ==<br />
<br />
[[Image:ParaView_UG_Curvilinear.png|thumb|center|400px|'''Figure 3.6''' Curvilinear or structured grid]]<br />
<br />
A curvilinear grid, such as Figure 3.6, defines its topology implicitly and point coordinates explicitly. To fully define the mesh for a curvilinear grid, VTK uses the following:<br />
<br />
* Extents - these define the minimum and maximum indices in each direction. For example, a curvilinear grid of extents (0, 9), (0, 19), (0, 29) has 10*20*30 points regularly defined over a curvilinear mesh.<br />
* An array of point coordinates. This arrays stores the position of each vertex explicitly.<br />
<br />
The coordinate of each point is defined as follows: ''coordinate = coordinate_array(idx_flat)"''. The (i,j,k) index can be converted to this flat index as follows: idx_flat = k*(npts_x*npts_y) + j*nptr_x + i.<br />
<br />
A curvilinear grid consists of cells of the same type. This type is determined by the dimensionality of the dataset (based on the extents) and can either be vertex (0D), line (1D), quad (2D) or hexahedron (3D).<br />
<br />
== AMR Dataset ==<br />
<br />
[[Image:ParaView_UG_AMR.png|thumb|center|400px| '''Figure 3.7''' AMR dataset]]<br />
<br />
VTK natively support Berger-Oliger type AMR (Adaptive Mesh Refinement) datasets, as shown in Figure 3.7. An AMR dataset is essentially a collection of uniform rectilinear grids grouped under increasing refinement ratios (decreasing spacing). VTK's AMR dataset does not force any constraint on whether and how these grids should overlap. However, it provides support for masking (blanking) sub-regions of the rectilinear grids using an array of bytes. This allows VTK to process overlapping grids with minimal artifacts. VTK can automatically generate the masking arrays for Berger-Oliger compliant meshes.<br />
<br />
== Unstructured Grid ==<br />
<br />
[[Image:ParaView_UG_Unstructured.png|thumb|center|400px|'''Figure 3.8''' Unstructured grid]]<br />
<br />
An unstructured grid such as Figure 3.8 is the most general primitive dataset type. It stores topology and point coordinates explicitly. Even though VTK uses a memory-efficient data structure to store the topology, an unstructured grid uses significantly more memory to represent its mesh. Therefore, use an unstructured grid only when you cannot represent your dataset as one of the above datasets. VTK supports a large number of cell types, all of which can exist (heterogeneously) within one unstructured grid. The full list of all cell types supported by VTK can be found in the file vtkCellType.h in the VTK source code. Here is the list as of when this document was written:<br />
<br />
{| width = 650px; <br />
|-<br />
|VTK_EMPTY_CELL<br />
|VTK_VERTEX<br />
|-<br />
|VTK_POLY_VERTEX<br />
|VTK_LINE<br />
|-<br />
|VTK_POLY_LINE<br />
|VTK_TRIANGLE<br />
|-<br />
|VTK_TRIANGLE_STRIP<br />
|VTK_POLYGON<br />
|-<br />
|VTK_PIXEL<br />
|VTK_QUAD<br />
|-<br />
|VTK_TETRA<br />
|VTK_VOXEL<br />
|-<br />
|VTK_HEXAHEDRON<br />
|VTK_WEDGE<br />
|-<br />
|VTK_PYRAMID<br />
|VTK_PENTAGONAL_PRISM<br />
|-<br />
|VTK_HEXAGONAL_PRISM<br />
|VTK_QUADRATIC_EDGE<br />
|-<br />
|VTK_QUADRATIC_TRIANGLE<br />
|VTK_QUADRATIC_QUAD<br />
|-<br />
|VTK_QUADRATIC_TETRA<br />
|VTK_QUADRATIC_HEXAHEDRON<br />
|-<br />
|VTK_QUADRATIC_WEDGE<br />
|VTK_QUADRATIC_PYRAMID<br />
|-<br />
|VTK_BIQUADRATIC_QUAD<br />
|VTK_TRIQUADRATIC_HEXAHEDRON<br />
|-<br />
|VTK_QUADRATIC_LINEAR_QUAD<br />
|VTK_QUADRATIC_LINEAR_WEDGE<br />
|-<br />
|VTK_BIQUADRATIC_QUADRATIC_WEDGE<br />
|VTK_BIQUADRATIC_QUADRATIC_HEXAHEDRON<br />
|-<br />
|VTK_BIQUADRATIC_TRIANGLE<br />
|VTK_CUBIC_LINE<br />
|-<br />
|VTK_CONVEX_POINT_SET<br />
|VTK_POLYHEDRON<br />
|-<br />
|VTK_PARAMETRIC_CURVE<br />
|VTK_PARAMETRIC_SURFACE<br />
|-<br />
|VTK_PARAMETRIC_TRI_SURFACE<br />
|VTK_PARAMETRIC_QUAD_SURFACE<br />
|-<br />
|VTK_PARAMETRIC_TETRA_REGION<br />
|VTK_PARAMETRIC_HEX_REGION<br />
|}<br />
<br />
Many of these cell types are straightforward. For details, see VTK documentation.<br />
<br />
== Polygonal Grid (Polydata) ==<br />
<br />
[[Image:ParaView_UG_Polydata.png|thumb|center|400px|'''Figure 3.9''' Polygonal grid]]<br />
<br />
A polydata such as Figure 3.9 is a specialized version of an unstructured grid designed for efficient rendering. It consists of 0D cells (vertices and polyvertices), 1D cells (lines and polylines) and 2D cells (polygons and triangle strips). Certain filters that generate only these cell types will generate a polydata. Examples include the Contour and Slice filters. An unstructured grid, as long as it has only 2D cells supported by polydata, can be converted to a polydata using the Extract Surface filter. A polydata can be converted to an unstructured grid using Clean to Grid.<br />
<br />
== Table ==<br />
<br />
[[Image:ParaView_UG_Table.png|thumb|center|700px|'''Table 3.1''']]<br />
<br />
A table like Table 3.1 is a tabular dataset that consists of rows and columns. All chart views have been designed to work with tables. Therefore, all filters that can be shown within the chart views generate tables. Also, tables can be directly loaded using various file formats such as the comma separated values format. Tables can be converted to other datasets as long as they are of the right format. Filters that convert tables include Table to Points and Table to Structured Grid.<br />
<br />
== Multiblock Dataset ==<br />
<br />
[[Image:ParaView_UG_Multiblock.png|thumb|center|400px|'''Figure 3.10''' Multiblock dataset]]<br />
<br />
You can think of a multi-block dataset as a tree of datasets where the leaf nodes are "simple" datasets. All of the data types described above, except AMR, are "simple" datasets. Multi-block datasets are used to group together datasets that are related. The relation between these datasets is not necessarily defined by ParaView. A multi-block dataset can represent an assembly of parts or a collection of meshes of different types from a coupled simulation. Multi-block datasets can be loaded or created within ParaView using the Group filter. Note that the leaf nodes of a multi-block dataset do not all have to have the same attributes. If you apply a filter that requires an attribute, it will be applied only to blocks that have that attribute.<br />
<br />
== Multipiece Dataset ==<br />
<br />
[[Image:ParaView_UG_Multipiece.png|thumb|center|400px|'''Figure 3.11''' Multipiece dataset]]<br />
<br />
Multi-piece datasets such as Figure 3.11 are similar to multi-block datasets in that they group together simple datasets with one key difference. Multi-piece datasets group together datasets that are part of a whole mesh - datasets of the same type and with same attributes. This data structure is used collect datasets produced by a parallel simulation without having to append the meshes together. Note that there is no way to create a multi-piece dataset within ParaView, but only by using certain readers. Furthermore, multi-piece datasets act, for the most part, as simple datasets. For example, it is not possible to extract individual pieces or obtain information about them.</div>Katie.osterdahlhttps://public.kitware.com/Wiki/index.php?title=ParaView/Users_Guide/Loading_Data&diff=41723ParaView/Users Guide/Loading Data2011-07-18T21:50:59Z<p>Katie.osterdahl: </p>
<hr />
<div>== Introduction ==<br />
<br />
Loading data is a fundamental operation in using ParaView for visualization. <br />
As you would expect, the Open option from the File menu and the Open Button from the toolbar both allow you to load data into ParaView. ParaView understands many scientific data file formats. The most comprehensive list is given in the [http://paraview.org/Wiki/ParaViewUsersGuide/List_of_readers List of Readers] appendix. Because of ParaView's modular design it is easy to integrate new readers. If the formats you need are not listed, ask the mailing list first to see if anyone has a reader for the format or, if you want to create your own readers for ParaView see the [http://www.paraview.org/Wiki/ParaView/Plugin_HowTo#Adding_a_Reader Plugin HowTo] section and <br />
the [http://paraview.org/Wiki/Writing_ParaView_Readers Writing Readers] appendix of this book.<br />
<br />
==Opening File / Time Series==<br />
ParaView recognizes file series by using certain patterns in the name of files including:<br />
*fooN.vtk<br />
*foo_N.vtk<br />
*foo-N.vtk<br />
*foo.N.vtk<br />
*Nfoo.vtk<br />
*N.foo.vtk<br />
*foo.vtk.N<br />
*foo.vtk-sN<br />
<br />
In the above file name examples, N is an integer (with any number of leading zeros). To load a file series, first make sure that the file names match one of the patterns described above. Next, navigate to the directory where the file series is. The file browser should look like Figure 2.1:<br />
<br />
[[Image:ParaView_UG_FileSeries.png|thumb|center|500px|'''Figure 2.1''' Sample browser when opening files]]<br />
<br />
You can expand the file series by clicking on the triangle, as shown in the above diagram. Simply select the group (in the picture named blow..vtk) and click OK. The reader will store all the filenames and treat each file as a time step. You can now animate, use the annotate time filter, or do anything you can do with readers that natively support time. If you want to load a single step of a file series just expand the triangle and select the file you are interested in.<br />
<br />
==Opening Multiple Files==<br />
<br />
ParaView supports loading multiple files as long as they exist in the same directory. Just hold the Ctrl key down while selecting each file (Figure 2.2), or hold shift to select all files in a range.<br />
[[Image:ParaView_UG_MultipleFileOpen.png|thumb|center|500px|'''Figure 2.2''' Opening multiple files]]<br />
<br />
== State Files ==<br />
Another option is to load a previously saved state file ('''File'''|Load State). This will return ParaView to its state at the time the file was saved by loading data files, applying filters. <br />
<br />
== Advanced Data Loading ==<br />
If you commonly load the same data into ParaView each time, you can streamline the process by launching ParaView with the data command-line argument (<code>--data=data_file</code>). <br />
<br />
<br />
== Object Inspector ==<br />
<br />
Note that opening a file is a two step process, and so you do not see any data after opening a data file. Instead, you see that the Object Inspector is populated with several options about how you may want to read the data.<br />
<br />
[[Image:ParaView_UG_FileLoadObjectInspector.png|thumb|center|500px|'''Figure 2.3''' Using the object inspector]]<br />
<br />
Once you have enabled all the options on the data that you are interested in click the <font color=green>Apply</font> button to finish loading the data. For a more detailed explanation of the object inspector read the [[ParaView/UsersGuide/Filtering_Data#Properties | Properties Section ]].</div>Katie.osterdahlhttps://public.kitware.com/Wiki/index.php?title=ParaView/Users_Guide/Introduction&diff=41720ParaView/Users Guide/Introduction2011-07-18T21:48:32Z<p>Katie.osterdahl: </p>
<hr />
<div>[[File:ParaView_UsersGuide_ParaViewLogo.png|500px]]<br />
<br />
== What is ParaView? ==<br />
<br />
ParaView is an open-source, multi-platform application for the visualization and analysis of scientific datasets, primarily those that are defined natively in a two- or three-dimensional space including those that extend into the temporal dimension.<br />
<br />
The front end graphical user interface (GUI) has an open, flexible and intuitive user interface that still gives you fine-grained and open-ended control of the data manipulation and display processing needed to explore and present complex data as you see fit. <br />
<br />
ParaView has extensive scripting and batch processing capabilities. The standard scripting interface uses the widely used python programming language for scripted control. As with the GUI, the python scripted control is easy to learn, including the ability to record actions in the GUI and save them out as succinct human readable python programs. It is also powerful, with the ability to write scripted filters that run on the server that have access to every bit of your data on a large parallel machine. <br />
<br />
ParaView's data processing and rendering components are built upon a modular and scalable distributed-memory parallel architecture in which many processors operate synchronously on different portions of the data. ParaView's scalable architecture allows you to run ParaView directly on anything from a small netbook class machine up to the world's largest supercomputer. However, the size of the datasets ParaView can handle in practice varies widely depending on the size of the machine that ParaView's server components are run on. Thus people frequently do both, taking advantage of ParaView's client/server architecture to connect to and control the supercomputer from the netbook.<br />
<br />
ParaView is meant to be easily extended and customized into new applications and be used by or make use of other tools. Correspondingly there are a number of different interfaces to ParaView's data processing and visualization engine, for example the web-based [http://www.paraview.org/Wiki/ParaViewWeb ParaViewWeb]. This book does not focus on these nor does it describe in great detail the programmers' interface to the ParaView engine. The book instead focuses on understanding the standard ParaView GUI based application.<br />
<br />
== User Interface ==<br />
The different sections of ParaView's Graphical User Interface (GUI) are shown below. Of particular importance in the following discussion are the:<br />
*File and Filter menus which allow you to open files and manipulate data<br />
*Pipeline Browser which displays the visualization pipeline<br />
*Object Inspector with its Properties, Display and Information tabs where you can control any given module within the pipeline<br />
*View area where data is displayed in one or more windows<br />
<br />
[[Image:ParaView_UsersGuide_ParaViewGUIOverview.png|thumb|center|800px|link=|'''Figure 1.1''' ParaView GUI Overview]]<br />
<br />
=== Modality ===<br />
One very important thing to keep in mind when using ParaView is that the GUI is very modal. At any given time you will have one "active" module within the visualization pipeline, one "active" view, and one "active" selection. For example, when you click on the name of a reader or source within the Pipeline Browser, it becomes the active module and the properties of that filter are displayed in the Object Inspector. Likewise when you click within a different view, that view becomes the active view and the visibility "eye" icons in the Pipeline Browser are changed to show what filters are displayed within this View. These concepts will be described in detail in later chapters <br />
([http://paraview.org/Wiki/ParaView/Displaying_Data#Multiple_Views Multiple Views],[http://paraview.org/Wiki/ParaView/UsersGuide/Filtering_Data#Pipeline_Basics Pipeline Basics],[http://paraview.org/Wiki/ParaView/Users_Guide/Selection Selection]). For now you should be aware that the information displayed in the GUI always pertains to these active entities.<br />
<br />
== Basics of Visualization ==<br />
Put simply, the process of visualization is taking raw data and converting it to a form that is viewable and understandable to humans. This enables a better cognitive understanding of our data. Scientific visualization is specifically concerned with the type of data that has a well-defined representation in 2D or 3D space. Data that comes from simulation meshes and scanner data is well suited for this type of analysis.<br />
<br />
There are three basic steps to visualizing your data: reading, filtering, and rendering. First, your data must be read into ParaView. Next, you may apply any number of filters that process the data to generate, extract, or derive features from the data. Finally, a viewable image is rendered from the data and you can then change the viewing parameters or rendering modality for best the visual effect.<br />
<br />
== The Pipeline Concept ==<br />
In ParaView, these steps are made manifest in a visualization pipeline. That is, you visualize data by building up a set of modules, each of which takes in some data, operates on it, and presents the result as a new dataset. This begins with a reader module that ingests data off of files on disk. <br />
<br />
Reading data into ParaView is often as simple as selecting Open from the File menu, and then clicking the glowing Accept button on the reader's Object Inspector tab. ParaView comes with support for a large number of file formats [http://paraview.org/Wiki/ParaViewUsersGuide/List_of_readers], and its modular architecture makes it possible to add new file readers [http://paraview.org/Wiki/Writing_ParaView_Readers].<br />
<br />
Once a file is read, ParaView automatically renders it in a view. In ParaView, a view is simply a window that shows data. There are different types of views, ranging from qualitative computer graphics rendering of the data to quantitative spreadsheet presentations of the data values as text. ParaView picks a suitable view type for your data automatically, but you are free to change the view type, modify the rendering parameters of the data in the view, and even create new views simultaneously as you see fit to better understand what you have read in. Additionally, high-level meta information about the data including names, types and ranges of arrays, temporal ranges, memory size and geometric extent can be found in the Information tab.<br />
<br />
You can learn a great deal about a given dataset with a one element visualization pipeline consisting of just a reader module. In ParaView, you can create arbitrarily complex visualization pipelines, including ones with multiple readers, merging and branching pipelines. You build up a pipeline by choosing the next filter in the sequence from the Filters menu. Once you click Accept, this new filter will read in the data produced by the formerly active filter and perform some processing on that data. The new filter then becomes the active one. Filters then are created differently from but operate in the same manner as readers. At all points you use the Pipeline Inspector to choose the active filter and then the Object Inspector to configure it.<br />
<br />
The Pipeline Browser is where the overall visualization pipeline is displayed and controlled from. The Object Inspector is where the specific parameters of one particular module within the pipeline are displayed and controlled from. The Object Inspector has three tabs; one presents the parameters of the processing done within that module, another presents the parameters of how the output of that module will be displayed in a view, and the last presents the meta information about the data produced by the module as described above.<br />
<br />
Figure 1.2 demonstrates a three-element visualization pipeline, where the output of each module in the the pipeline is displayed in its own view. A reader takes in a vector field, defined on a curvilinear grid, which comes from a simulation study of a wind turbine. Next a slice filter produces slices of the field on five equally spaced planes along the X-axis. Finally, a warp filter warps those planes along the direction of the vector field, which primarily moves the planes downwind but also shows some complexity at the location of the wind turbine.<br />
<br />
[[Image:ParaView_UsersGuide_PipelineExample.png|thumb|700px|center|'''Figure 1.2''' A three-element visualization pipeline]]<br />
<br />
There are more than one hundred filters available to choose from, all of which manipulate the data in different ways. The full list of filters is available in the [http://paraview.org/Wiki/ParaViewUsersGuide/List_of_readers Appendix] and within the application under the Help menu. Note that many of the filters in the menu will be grayed out and not selectable at any given time. That is because any given filter may only operate on particular types of data. For example, the Extract Subset filter will only operate on structured data sets so it is only enabled when the module you are building on top of produces image data, rectilinear grid data, or structured grid data. (These input restrictions are also listed in the [http://paraview.org/Wiki/ParaViewUsersGuide/List_of_filters Appendix] and help menu). In this situation you can often find a similar filter which does accept your data, or apply a filter which transforms your data into the required format. In ParaView 3.10, you can ask ParaView to try to do the conversion for you automatically, by clicking "Auto convert properties" in the application [http://paraview.org/Wiki/ParaView/Users_Guide/Settings settings]. The mechanics of applying filters are described fully in the [http://paraview.org/Wiki/ParaView/UsersGuide/Filtering_Data Manipulating Data] chapter.<br />
<br />
== Making Mistakes ==<br />
Frequently, new users of ParaView falter when they open their data, or apply a filter, and do not see it immediately because they have not pressed the Apply button. ParaView was designed to operate on large datasets, for which any given operation could take a long time to finish. In this situation you need the Apply button so that you have a chance to be confident of your change before it takes effect. The highlighted Apply button is a reminder that the parameters of one or more filters are out of sync with the data that you are viewing. Hitting the Apply button accepts your change (or changes) whereas hitting the Reset button reverts the options back to the last time you hit Apply. If you are working with small datasets, you may want to turn off this behavior with the Auto Accept setting under the Application [http://paraview.org/Wiki/ParaView/Users_Guide/Settings Settings]. <br />
<br />
The Apply behavior circumvents a great number of mistakes but not all of them. If you make some change to a filter or to the pipeline itself and later find that you are not satisfied with the result, hit the Undo button. You can undo all the way back to the start of your ParaView session and redo all the way forward if you like. You can also undo and redo camera motion by using the camera undo and redo buttons located above each view window.<br />
<br />
== Persistent Sessions ==<br />
<br />
If on the other hand you are satisfied with your visualization results, you may want to save your work so that you can return to it at some future time. You can do so by using ParaView's Save State ('''File'''|Save State) and Save Trace ('''Tools''' | Save Trace) features. In either case, ParaView produces human readable text files (XML files for State and Python script for Trace) that can be restored or modified and restored later. This is very useful for batch processing, which is discussed in the [http://paraview.org/Wiki/ParaView/Python_Scripting Python Scripting] chapter.<br />
<br />
To save state means to save enough information about the ParaView session to restore it later and thus show exactly the same result. ParaView does so by saving the current visualization pipeline and parameters of the filters within it. <br />
<br />
If you turn on a trace recording when you first start using ParaView, saving a trace can be used for the same purpose as saving state. However, a trace records all of your actions, including the ones that you later undo, as you do them. It is a more exact recording of not only what you did, but how you did it. Traces are saved as python scripts, which ParaView can play back in either batch mode or within an interactive GUI session. You can therefore use traces then to automate repetitive tasks by recording just that action. It is also an ideal tool to learn ParaView's python scripting API.<br />
<br />
== Client/Server Visualization ==<br />
With small datasets it is usually sufficient to run ParaView as a single process on a small laptop or desktop class machine. For large datasets, a single machine is not likely to have enough processing power and, much more importantly, memory to process the data. In this situation you run an MPI parallel ParaView Server process on a large machine to do computationally and memory expensive data processing and/or rendering tasks and then connect to that server within the familiar GUI application. <br />
<br />
When connected to a remote server the only difference you will see will be that the visualization pipeline displayed in the Pipeline Browser will begin with the name of the server you are connected to rather than the word 'builtin' which indicates that you are connected to a virtual server residing in the same process as the GUI. When connected to a remote server, the File Open dialog presents the list of files that live on the remote machine's file system rather than the client's. Depending on the server's capabilities, the data size and your application settings ('''Edit'''|Settings|Render View|Server) the data will either be rendered remotely and pixels will be sent to the client or the geometry will be delivered and rendered locally. Large data visualization is described fully in the [http://paraview.org/Wiki/Users_Guide_Client-Server_Visualization Client Server Visualization] Chapter.</div>Katie.osterdahlhttps://public.kitware.com/Wiki/index.php?title=ParaView/Users_Guide/Introduction&diff=41719ParaView/Users Guide/Introduction2011-07-18T21:47:28Z<p>Katie.osterdahl: </p>
<hr />
<div>[[File:ParaView_UsersGuide_ParaViewLogo.png|500px]]<br />
<br />
== What is ParaView? ==<br />
<br />
ParaView is an open-source, multi-platform application for the visualization and analysis of scientific datasets, primarily those that are defined natively in a two- or three-dimensional space including those that extend into the temporal dimension.<br />
<br />
The front end graphical user interface (GUI) has an open, flexible and intuitive user interface that still gives you fine-grained and open-ended control of the data manipulation and display processing needed to explore and present complex data as you see fit. <br />
<br />
ParaView has extensive scripting and batch processing capabilities. The standard scripting interface uses the widely used python programming language for scripted control. As with the GUI, the python scripted control is easy to learn, including the ability to record actions in the GUI and save them out as succinct human readable python programs. It is also powerful, with the ability to write scripted filters that run on the server that have access to every bit of your data on a large parallel machine. <br />
<br />
ParaView's data processing and rendering components are built upon a modular and scalable distributed-memory parallel architecture in which many processors operate synchronously on different portions of the data. ParaView's scalable architecture allows you to run ParaView directly on anything from a small netbook class machine up to the world's largest supercomputer. However, the size of the datasets ParaView can handle in practice varies widely depending on the size of the machine that ParaView's server components are run on. Thus people frequently do both, taking advantage of ParaView's client/server architecture to connect to and control the supercomputer from the netbook.<br />
<br />
ParaView is meant to be easily extended and customized into new applications and be used by or make use of other tools. Correspondingly there are a number of different interfaces to ParaView's data processing and visualization engine, for example the web-based [http://www.paraview.org/Wiki/ParaViewWeb ParaViewWeb]. This book does not focus on these nor does it describe in great detail the programmers' interface to the ParaView engine. The book instead focuses on understanding the standard ParaView GUI based application.<br />
<br />
== User Interface ==<br />
The different sections of ParaView's Graphical User Interface (GUI) are shown below. Of particular importance in the following discussion are the:<br />
*File and Filter menus which allow you to open files and manipulate data<br />
*Pipeline Browser which displays the visualization pipeline<br />
*Object Inspector with its Properties, Display and Information tabs where you can control any given module within the pipeline<br />
*View area where data is displayed in one or more windows<br />
<br />
[[Image:ParaView_UsersGuide_ParaViewGUIOverview.png|thumb|center|800px|link=|Figure 1.1]]<br />
<br />
=== Modality ===<br />
One very important thing to keep in mind when using ParaView is that the GUI is very modal. At any given time you will have one "active" module within the visualization pipeline, one "active" view, and one "active" selection. For example, when you click on the name of a reader or source within the Pipeline Browser, it becomes the active module and the properties of that filter are displayed in the Object Inspector. Likewise when you click within a different view, that view becomes the active view and the visibility "eye" icons in the Pipeline Browser are changed to show what filters are displayed within this View. These concepts will be described in detail in later chapters <br />
([http://paraview.org/Wiki/ParaView/Displaying_Data#Multiple_Views Multiple Views],[http://paraview.org/Wiki/ParaView/UsersGuide/Filtering_Data#Pipeline_Basics Pipeline Basics],[http://paraview.org/Wiki/ParaView/Users_Guide/Selection Selection]). For now you should be aware that the information displayed in the GUI always pertains to these active entities.<br />
<br />
== Basics of Visualization ==<br />
Put simply, the process of visualization is taking raw data and converting it to a form that is viewable and understandable to humans. This enables a better cognitive understanding of our data. Scientific visualization is specifically concerned with the type of data that has a well-defined representation in 2D or 3D space. Data that comes from simulation meshes and scanner data is well suited for this type of analysis.<br />
<br />
There are three basic steps to visualizing your data: reading, filtering, and rendering. First, your data must be read into ParaView. Next, you may apply any number of filters that process the data to generate, extract, or derive features from the data. Finally, a viewable image is rendered from the data and you can then change the viewing parameters or rendering modality for best the visual effect.<br />
<br />
== The Pipeline Concept ==<br />
In ParaView, these steps are made manifest in a visualization pipeline. That is, you visualize data by building up a set of modules, each of which takes in some data, operates on it, and presents the result as a new dataset. This begins with a reader module that ingests data off of files on disk. <br />
<br />
Reading data into ParaView is often as simple as selecting Open from the File menu, and then clicking the glowing Accept button on the reader's Object Inspector tab. ParaView comes with support for a large number of file formats [http://paraview.org/Wiki/ParaViewUsersGuide/List_of_readers], and its modular architecture makes it possible to add new file readers [http://paraview.org/Wiki/Writing_ParaView_Readers].<br />
<br />
Once a file is read, ParaView automatically renders it in a view. In ParaView, a view is simply a window that shows data. There are different types of views, ranging from qualitative computer graphics rendering of the data to quantitative spreadsheet presentations of the data values as text. ParaView picks a suitable view type for your data automatically, but you are free to change the view type, modify the rendering parameters of the data in the view, and even create new views simultaneously as you see fit to better understand what you have read in. Additionally, high-level meta information about the data including names, types and ranges of arrays, temporal ranges, memory size and geometric extent can be found in the Information tab.<br />
<br />
You can learn a great deal about a given dataset with a one element visualization pipeline consisting of just a reader module. In ParaView, you can create arbitrarily complex visualization pipelines, including ones with multiple readers, merging and branching pipelines. You build up a pipeline by choosing the next filter in the sequence from the Filters menu. Once you click Accept, this new filter will read in the data produced by the formerly active filter and perform some processing on that data. The new filter then becomes the active one. Filters then are created differently from but operate in the same manner as readers. At all points you use the Pipeline Inspector to choose the active filter and then the Object Inspector to configure it.<br />
<br />
The Pipeline Browser is where the overall visualization pipeline is displayed and controlled from. The Object Inspector is where the specific parameters of one particular module within the pipeline are displayed and controlled from. The Object Inspector has three tabs; one presents the parameters of the processing done within that module, another presents the parameters of how the output of that module will be displayed in a view, and the last presents the meta information about the data produced by the module as described above.<br />
<br />
Figure 1.2 demonstrates a three-element visualization pipeline, where the output of each module in the the pipeline is displayed in its own view. A reader takes in a vector field, defined on a curvilinear grid, which comes from a simulation study of a wind turbine. Next a slice filter produces slices of the field on five equally spaced planes along the X-axis. Finally, a warp filter warps those planes along the direction of the vector field, which primarily moves the planes downwind but also shows some complexity at the location of the wind turbine.<br />
<br />
[[Image:ParaView_UsersGuide_PipelineExample.png|thumb|700px|center|Figure 1.2]]<br />
<br />
There are more than one hundred filters available to choose from, all of which manipulate the data in different ways. The full list of filters is available in the [http://paraview.org/Wiki/ParaViewUsersGuide/List_of_readers Appendix] and within the application under the Help menu. Note that many of the filters in the menu will be grayed out and not selectable at any given time. That is because any given filter may only operate on particular types of data. For example, the Extract Subset filter will only operate on structured data sets so it is only enabled when the module you are building on top of produces image data, rectilinear grid data, or structured grid data. (These input restrictions are also listed in the [http://paraview.org/Wiki/ParaViewUsersGuide/List_of_filters Appendix] and help menu). In this situation you can often find a similar filter which does accept your data, or apply a filter which transforms your data into the required format. In ParaView 3.10, you can ask ParaView to try to do the conversion for you automatically, by clicking "Auto convert properties" in the application [http://paraview.org/Wiki/ParaView/Users_Guide/Settings settings]. The mechanics of applying filters are described fully in the [http://paraview.org/Wiki/ParaView/UsersGuide/Filtering_Data Manipulating Data] chapter.<br />
<br />
== Making Mistakes ==<br />
Frequently, new users of ParaView falter when they open their data, or apply a filter, and do not see it immediately because they have not pressed the Apply button. ParaView was designed to operate on large datasets, for which any given operation could take a long time to finish. In this situation you need the Apply button so that you have a chance to be confident of your change before it takes effect. The highlighted Apply button is a reminder that the parameters of one or more filters are out of sync with the data that you are viewing. Hitting the Apply button accepts your change (or changes) whereas hitting the Reset button reverts the options back to the last time you hit Apply. If you are working with small datasets, you may want to turn off this behavior with the Auto Accept setting under the Application [http://paraview.org/Wiki/ParaView/Users_Guide/Settings Settings]. <br />
<br />
The Apply behavior circumvents a great number of mistakes but not all of them. If you make some change to a filter or to the pipeline itself and later find that you are not satisfied with the result, hit the Undo button. You can undo all the way back to the start of your ParaView session and redo all the way forward if you like. You can also undo and redo camera motion by using the camera undo and redo buttons located above each view window.<br />
<br />
== Persistent Sessions ==<br />
<br />
If on the other hand you are satisfied with your visualization results, you may want to save your work so that you can return to it at some future time. You can do so by using ParaView's Save State ('''File'''|Save State) and Save Trace ('''Tools''' | Save Trace) features. In either case, ParaView produces human readable text files (XML files for State and Python script for Trace) that can be restored or modified and restored later. This is very useful for batch processing, which is discussed in the [http://paraview.org/Wiki/ParaView/Python_Scripting Python Scripting] chapter.<br />
<br />
To save state means to save enough information about the ParaView session to restore it later and thus show exactly the same result. ParaView does so by saving the current visualization pipeline and parameters of the filters within it. <br />
<br />
If you turn on a trace recording when you first start using ParaView, saving a trace can be used for the same purpose as saving state. However, a trace records all of your actions, including the ones that you later undo, as you do them. It is a more exact recording of not only what you did, but how you did it. Traces are saved as python scripts, which ParaView can play back in either batch mode or within an interactive GUI session. You can therefore use traces then to automate repetitive tasks by recording just that action. It is also an ideal tool to learn ParaView's python scripting API.<br />
<br />
== Client/Server Visualization ==<br />
With small datasets it is usually sufficient to run ParaView as a single process on a small laptop or desktop class machine. For large datasets, a single machine is not likely to have enough processing power and, much more importantly, memory to process the data. In this situation you run an MPI parallel ParaView Server process on a large machine to do computationally and memory expensive data processing and/or rendering tasks and then connect to that server within the familiar GUI application. <br />
<br />
When connected to a remote server the only difference you will see will be that the visualization pipeline displayed in the Pipeline Browser will begin with the name of the server you are connected to rather than the word 'builtin' which indicates that you are connected to a virtual server residing in the same process as the GUI. When connected to a remote server, the File Open dialog presents the list of files that live on the remote machine's file system rather than the client's. Depending on the server's capabilities, the data size and your application settings ('''Edit'''|Settings|Render View|Server) the data will either be rendered remotely and pixels will be sent to the client or the geometry will be delivered and rendered locally. Large data visualization is described fully in the [http://paraview.org/Wiki/Users_Guide_Client-Server_Visualization Client Server Visualization] Chapter.</div>Katie.osterdahlhttps://public.kitware.com/Wiki/index.php?title=ParaView/Users_Guide/Widgets&diff=41718ParaView/Users Guide/Widgets2011-07-18T21:46:28Z<p>Katie.osterdahl: </p>
<hr />
<div>== 3D Widgets ==<br />
In addition to being controlled manually through entry boxes, sliders, etc., parameters of some of the filters and sources in ParaView can be changed interactively by manipulating 3D widgets in a 3D view. Often the 3D widgets are used to set the parameters approximately, and then the manual controls are used for fine-tuning these values. In the manual controls for each 3D widget, there is a check box for toggling whether the 3D widget is drawn in the scene. The label for the check box depends on the type of 3D widget being used. The following 3D widgets are supported in ParaView.<br />
<br />
=== Line Widget ===<br />
[[File:Paraview_UsersGuide_PVLineWidget.png|thumb|left|300px|'''Figure 8.1''' Line Widget Results]]The line widget is used to set the orientation and the position of a line. It is used in both the stream tracer and elevation filters. The position of the line can be changed by clicking on any point on the line, except the endpoints, and dragging. To position the widget accurately, the user may need to change the camera position as well. Holding ''Shift'' while interacting will restrict the motion of the line widget to one of the X, Y, or Z planes. (The plane chosen is the one most closely aligned with the direction of the initial mouse movement.) To move one of the endpoints, simply use one of the point widgets on each end of the line. These are marked by spheres that become red when clicked. You can also reposition the endpoints by pressing the “P” key; the endpoint nearest to the mouse cursor will be placed at the position on the dataset surface beneath the mouse position. Left-clicking while the cursor is over the line and dragging will reposition the entire line. Doing the same with the right mouse button causes the line to resize. Upward mouse motion increases the length of the line; downward motion decreases it.<br />
<br />
[[File:ParaView_UsersGuide_LineWidgetUI.png|thumb|center|400px|'''Figure 8.2''' Line Widget User Interface]]<br />
<br />
The show line check box toggles the visibility of the line in the 3D view.<br />
<br />
The controls shown in Figure 8.2 can be used to precisely set the endpoint coordinates and resolution of the line. The X Axis, Y Axis, and Z Axis buttons cause the line to be along the selected axis and pass through the center of the bounds of the dataset.<br />
<br />
Depending on the source or filter using this widget, the resolution spin box may not be displayed. The value of the resolution spin box determines the number of segments composing the line.<br />
<br />
=== Plane Widget ===<br />
[[File:ParaView_UsersGuide_planeWidget.png|thumb|left|400px|'''Figure 8.3''' The Plane Widget]]The plane widget is used for clipping and cutting. The plane can be moved parallel to its normal by left-clicking on any point on the plane except the line center and dragging. Right-clicking on the plane, except on the normal line center, and dragging scales the plane widget. Upward mouse motion increases the size of the plane; downward motion decreases it. The plane normal can be changed by manipulating one of the point widgets (displayed as cones that become red when clicked) at each end of the normal vector.<br />
<br />
Shown in Figure 8.4, the standard user interface for this widget provides entry boxes for setting the center position (Origin) and the normal direction of the plane as well as toggling the plane widget’s visibility (using the show plane check box). Buttons are provided for positioning the plane at the center of the bounding box of the dataset (Center on Bounds) and for aligning the plane’s normal with the normal of the camera (Camera Normal), the X axis, the Y axis, or the Z axis (X Normal, Y Normal, and Z Normal, respectively). If the bounds of the dataset being operated on change, then you can use the Reset Bounds button to cause the bounding box for the plane widget to match the new bounds of the dataset and reposition the origin of the plane at the center of the new bounds. Using only the Center on Bounds button in this case would move the origin to the center of the new bounds, but the bounds of the widget would not be updated.<br />
<br />
[[File:ParaView_UsersGuide_planeWidgetUI.png|thumb|center|400px|'''Figure 8.4''' Plane widget user interface]]<br />
<br />
=== Box Widget ===<br />
[[File:ParaView_UsersGuide_boxWidget.png|thumb|left|400px|'''Figure 8.5''' Box Widget]]<br />
<br />
The box widget is used for clipping and transforming datasets. Each face of the box can be positioned by moving the handle (sphere) on that face. Moving the handle at the center of the box causes the whole box to be moved. This can also be achieved by holding ''Shift'' while interacting. The box can be rotated by clicking and dragging with the left mouse button on a face (not at the handle) of the box. Clicking and dragging inside the box with the right mouse button uniformly scales the box. Dragging upward increases the box’s size; downward motion decreases it.<br />
<br />
Traditional user interface controls, shown in Figure 8.6, are also provided if more precise control over the parameters of the box is needed. These controls provide the user with entry boxes and thumb wheels or sliders to specify translation, scaling, and orientation in three dimensions.<br />
<br />
[[File:ParaView_UsersGuide_boxWidgetUI.png|thumb|center|400px|'''Figure 8.6 Box widget user interface]]<br />
<br />
=== Sphere Widget ===<br />
[[File:ParaView_UsersGuide_sphereWidget.png|thumb|left|400px|'''Figure 8.7''' Sphere Widget]]The sphere widget is used in clipping and cutting. The sphere can be moved by left-clicking on any point on the sphere and dragging. The radius of the sphere is manipulated by right-clicking on any point on the sphere and dragging. Upward mouse motion increases the sphere’s radius; downward motion decreases it.<br />
<br />
As shown in Figure 8.8, the center and radius can also be set manually from the entry boxes on the user interface. There is also a button to position the sphere at the center of the bounding box of the current dataset.<br />
<br />
[[File:ParaView_UsersGuide_sphereWidgetUI.png|thumb|center|400px|'''Figure 8.8''' Sphere widget user interface]]<br />
<br />
<br />
=== Point Widget ===<br />
<br />
[[File:ParaView_UsersGuide_pointWidget.png|thumb|left|400px|'''Figure 8.9''' Point Widget]]The point widget is used to set the position of a point or the center of a point cloud. It is used by the Stream Tracer, Probe Location and Probe Location over Time filters. The position of the point can be changed by left-clicking anywhere on it and dragging. Right-clicking and dragging anywhere on the widget changes the size of the point widget in the scene. To position the widget accurately, the user may need to change the camera position as well. Holding ''Shift'' while interacting will restrict the motion of the point to one of the X, Y or Z planes. The plane chosen is the one that is most closely aligned with the direction of the initial mouse movement.<br />
<br />
As shown in Figure 8.10, entry boxes allow the user to specify the coordinates of the point, and a button is provided to position the point at the center of the bounds of the current dataset. If the point widget is being used to position a point cloud instead of a single point, entry boxes are also provided to specify the radius of the point cloud and the number of points the cloud contains.<br />
<br />
[[File:ParaView_UsersGuide_pointWidgetUI.png|thumb|center|400px|'''Figure 8.10''' Point widget user interface]]<br />
<br />
=== Spline Widget ===<br />
<br />
[[File:ParaView_UsersGuide_splineWidget.png|thumb|left|300px|'''Figure 8.11''' Spline Widget]]The spline widget is used to define a path through 3D space. It is used by the Spline Source source and in the Camera animation dialog. The widget consists of a set of control points, shown as spheres in the 3D scene that can be clicked on with the mouse and dragged perpendicular to the viewing direction. The points are ordered and the path through them defines a smoothly varying path through 3D space. <br />
<br />
As shown in Figure 8.12, the text control box for the spline widget allows you to add or delete control points and specify their locations exactly. You can hide or show the widget and can choose to close the spline to create a loop, which adds a path segment from the last control point back to the first.<br />
<br />
[[File:ParaView_UsersGuide_splineWidgetUI.png|thumb|center|400px|'''Figure 8.12''' Spline widget user interface]]</div>Katie.osterdahlhttps://public.kitware.com/Wiki/index.php?title=ParaView/Users_Guide/Widgets&diff=41717ParaView/Users Guide/Widgets2011-07-18T21:37:06Z<p>Katie.osterdahl: </p>
<hr />
<div>== 3D Widgets ==<br />
In addition to being controlled manually through entry boxes, sliders, etc., parameters of some of the filters and sources in ParaView can be changed interactively by manipulating 3D widgets in a 3D view. Often the 3D widgets are used to set the parameters approximately, and then the manual controls are used for fine-tuning these values. In the manual controls for each 3D widget, there is a check box for toggling whether the 3D widget is drawn in the scene. The label for the check box depends on the type of 3D widget being used. The following 3D widgets are supported in ParaView.<br />
<br />
=== Line Widget ===<br />
[[File:Paraview_UsersGuide_PVLineWidget.png|thumb|left|300px|'''Figure 8.1''' Line Widget Results]]The line widget is used to set the orientation and the position of a line. It is used in both the stream tracer and elevation filters. The position of the line can be changed by clicking on any point on the line, except the endpoints, and dragging. To position the widget accurately, the user may need to change the camera position as well. Holding ''Shift'' while interacting will restrict the motion of the line widget to one of the X, Y, or Z planes. (The plane chosen is the one most closely aligned with the direction of the initial mouse movement.) To move one of the endpoints, simply use one of the point widgets on each end of the line. These are marked by spheres that become red when clicked. You can also reposition the endpoints by pressing the “P” key; the endpoint nearest to the mouse cursor will be placed at the position on the dataset surface beneath the mouse position. Left-clicking while the cursor is over the line and dragging will reposition the entire line. Doing the same with the right mouse button causes the line to resize. Upward mouse motion increases the length of the line; downward motion decreases it.<br />
<br />
[[File:ParaView_UsersGuide_LineWidgetUI.png|thumb|center|400px|'''Figure 8.2''' Line Widget User Interface]]<br />
<br />
The show line check box toggles the visibility of the line in the 3D view.<br />
<br />
The controls shown in Figure 8.2 can be used to precisely set the endpoint coordinates and resolution of the line. The X Axis, Y Axis, and Z Axis buttons cause the line to be along the selected axis and pass through the center of the bounds of the dataset.<br />
<br />
Depending on the source or filter using this widget, the resolution spin box may not be displayed. The value of the resolution spin box determines the number of segments composing the line.<br />
<br />
=== Plane Widget ===<br />
[[File:ParaView_UsersGuide_planeWidget.png|thumb|center|400px|'''Figure 8.3''' The Plane Widget]]The plane widget is used for clipping and cutting. The plane can be moved parallel to its normal by left-clicking on any point on the plane except the line center and dragging. Right-clicking on the plane, except on the normal line center, and dragging scales the plane widget. Upward mouse motion increases the size of the plane; downward motion decreases it. The plane normal can be changed by manipulating one of the point widgets (displayed as cones that become red when clicked) at each end of the normal vector.<br />
<br />
Shown in Figure 8.4, the standard user interface for this widget provides entry boxes for setting the center position (Origin) and the normal direction of the plane as well as toggling the plane widget’s visibility (using the show plane check box). Buttons are provided for positioning the plane at the center of the bounding box of the dataset (Center on Bounds) and for aligning the plane’s normal with the normal of the camera (Camera Normal), the X axis, the Y axis, or the Z axis (X Normal, Y Normal, and Z Normal, respectively). If the bounds of the dataset being operated on change, then you can use the Reset Bounds button to cause the bounding box for the plane widget to match the new bounds of the dataset and reposition the origin of the plane at the center of the new bounds. Using only the Center on Bounds button in this case would move the origin to the center of the new bounds, but the bounds of the widget would not be updated.<br />
<br />
[[File:ParaView_UsersGuide_planeWidgetUI.png|thumb|center|400px|'''Figure 8.4''' Plane widget user interface]]<br />
<br />
=== Box Widget ===<br />
[[File:ParaView_UsersGuide_boxWidget.png|left|link=]]<br />
<br />
The box widget is used for clipping and transforming datasets. Each face of the box can be positioned by moving the handle (sphere) on that face. Moving the handle at the center of the box causes the whole box to be moved. (This can also be achieved by holding the Shift key while interacting.) The box can be rotated by clicking and dragging with the left mouse button on a face (not at the handle) of the box. Clicking and dragging inside the box with the right mouse button uniformly scales the box. Dragging upward increases the box’s size; downward motion decreases it.<br />
<br />
Traditional user interface controls, shown below, are also provided if more precise control over the parameters of the box is needed. These controls provide the user with entry boxes and thumb wheels or sliders to specify translation, scaling, and orientation in three dimensions.<br />
<br />
<center>[[File:ParaView_UsersGuide_boxWidgetUI.png]]</center><br />
<br />
<center>'''Figure 12. Box widget user interface'''</center><br />
<br />
=== Sphere Widget ===<br />
[[File:ParaView_UsersGuide_sphereWidget.png|left|link=]]The sphere widget is used in clipping and cutting. The sphere can be moved by left-clicking on any point on the sphere and dragging. The radius of the sphere is manipulated by right-clicking on any point on the sphere and dragging. Upward mouse motion increases the sphere’s radius; downward motion decreases it.<br />
<br />
As shown below, the center and radius can also be set manually from the entry boxes on the user interface. There is also a button to position the sphere at the center of the bounding box of the current dataset.<br />
<br />
<center>[[File:ParaView_UsersGuide_sphereWidgetUI.png]]</center><br />
<br />
<center>'''Figure 13. Sphere widget user interface'''</center><br />
<br />
<br />
=== Point Widget ===<br />
<br />
[[File:ParaView_UsersGuide_pointWidget.png|left|link=]]The point widget is used to set the position of a point or the center of a point cloud. It is used by both the '''Stream Tracer''', '''Probe Location''' and '''Probe Location over Time''' filters. The position of the point can be changed by left-clicking anywhere on it and dragging. Right-clicking and dragging anywhere on the widget changes the size of the point widget in the scene. To position the widget accurately, the user may need to change the camera position as well. Holding the Shift key while interacting will restrict the motion of the point to one of the x, y or z planes. (The plane chosen is the one that is most closely aligned with the direction of the initial mouse movement.)<br />
<br />
As shown below, entry boxes allow the user to exactly specify the coordinates of the point, and a button is provided to position the point at the center of the bounds of the current dataset. If the point widget is being used to position a point cloud instead of a single point, entry boxes are also provided to specify the radius of the point cloud and the number of points the cloud contains.<br />
<br />
<center>[[File:ParaView_UsersGuide_pointWidgetUI.png]]</center><br />
<br />
<center>'''Figure 14. Point widget user interface'''</center><br />
<br />
=== Spline Widget ===<br />
<br />
[[File:ParaView_UsersGuide_splineWidget.png|left|300px|link=]]The spline widget is used to define a path through 3D space. It is used by the '''Spline Source''' source and in the Camera animation dialog. The widget consists of a set of control points, shown as spheres in the 3D scene that can clicked on with the mouse and dragged perpendicular to the viewing direction. The points are ordered and the path through them defines a smoothly varying path through 3D space. <br />
<br />
As shown below, the text control box for the spline widget allows you to add or delete control points and specify their locations exactly. You can hide or show the widget and can choose to close the spline to create a loop, which adds a path segment from the last control point back to the first.<br />
<br />
<center>[[File:ParaView_UsersGuide_splineWidgetUI.png]]</center><br />
<br />
<center>'''Figure 15. Spline widget user interface'''</center></div>Katie.osterdahlhttps://public.kitware.com/Wiki/index.php?title=ParaView/Users_Guide/Widgets&diff=40750ParaView/Users Guide/Widgets2011-06-14T16:03:23Z<p>Katie.osterdahl: </p>
<hr />
<div>== 3D Widgets ==<br />
In addition to being controlled manually through entry boxes, sliders, etc., parameters of some of the filters and sources in ParaView can be changed interactively by manipulating 3D widgets in a 3D view. Often the 3D widgets are used to set the parameters approximately, and then the manual controls are used for fine-tuning these values. In the manual controls for each 3D widget, there is a check box for toggling whether the 3D widget is drawn in the scene. The label for the check box depends on the type of 3D widget being used. The following 3D widgets are supported in ParaView.<br />
<br />
=== Line Widget ===<br />
[[File:Paraview_UsersGuide_PVLineWidget.png|thumb|left|300px|'''Figure 7.5''' Line Widget Results]]The line widget is used to set the orientation and the position of a line. It is used in both the Stream Tracer and Elevation filters. The position of the line can be changed by clicking on any point on the line except the endpoints and dragging. To position the widget accurately, the user may need to change the camera position as well. Holding ''Shift'' while interacting will restrict the motion of the line widget to one of the X, Y, or Z planes. (The plane chosen is the one most closely aligned with the direction of the initial mouse movement.) To move one of the endpoints, simply use one of the point widgets on each end of the line. These are marked by spheres that become red when clicked. You can also reposition the endpoints by pressing the “P” key; the endpoint nearest to the mouse cursor will be placed at the position on the dataset surface beneath the mouse position. Left-clicking while the cursor is over the line and dragging will reposition the entire line. Doing the same with the right mouse button causes the line to resize. Upward mouse motion increases the length of the line; downward motion decreases it.<br />
<br />
[[File:ParaView_UsersGuide_LineWidgetUI.png|thumb|center|400px|'''Figure 7.6''' Line Widget User Interface]]<br />
<br />
<br />
<br />
The '''Show Line''' check box toggles the visibility of the line in the 3D view.<br />
<br />
The controls shown above can be used to precisely set the endpoint coordinates and resolution of the line. The '''X Axis''', '''Y Axis''', and '''Z Axis''' buttons cause the line to be along the selected axis and pass through the center of the bounds of the dataset.<br />
<br />
Depending on the source or filter using this widget, the '''Resolution''' spin box may not be displayed. The value of the '''Resolution''' spin box determines the number of segments composing the line.<br />
<br />
=== Plane Widget ===<br />
[[File:ParaView_UsersGuide_planeWidget.png|left|link=]]The plane widget is used in clipping and cutting. The plane can be moved parallel to its normal by left-clicking on any point on the plane except the line center and dragging. Right-clicking on the plane (except on the normal line center) and dragging scales the plane widget. Upward mouse motion increases the size of the plane; downward motion decreases it. The plane normal can be changed by manipulating one of the point widgets (displayed as cones that become red when clicked) at each end of the normal vector.<br />
<br />
Shown below, the standard user interface for this widget provides entry boxes for setting the center position ('''Origin''') and normal direction of the plane as well as toggling the plane widget’s visibility (using the '''Show Plane''' check box). Buttons are provided for positioning the plane at the center of the bounding box of the dataset ('''Center on Bounds''') and for aligning the plane’s normal with the normal of the camera ('''Camera Normal'''), the X axis, the Y axis, or the Z axis ('''X Normal''', '''Y Normal''', and '''Z Normal''', respectively). If the bounds of the dataset being operated on change, then you can use the '''Reset Bounds''' button to cause the bounding box for the plane widget to match the new bounds of the dataset and reposition the origin of the plane at the center of the new bounds. (Using only the '''Center on Bounds''' button in this case would move the origin to the center of the new bounds, but the bounds of the widget would not be updated.)<br />
<br />
<center>[[File:ParaView_UsersGuide_planeWidgetUI.png]]</center><br />
<br />
<center>'''Figure 11. Plane widget user interface'''</center><br />
<br />
=== Box Widget ===<br />
[[File:ParaView_UsersGuide_boxWidget.png|left|link=]]<br />
<br />
The box widget is used for clipping and transforming datasets. Each face of the box can be positioned by moving the handle (sphere) on that face. Moving the handle at the center of the box causes the whole box to be moved. (This can also be achieved by holding the Shift key while interacting.) The box can be rotated by clicking and dragging with the left mouse button on a face (not at the handle) of the box. Clicking and dragging inside the box with the right mouse button uniformly scales the box. Dragging upward increases the box’s size; downward motion decreases it.<br />
<br />
Traditional user interface controls, shown below, are also provided if more precise control over the parameters of the box is needed. These controls provide the user with entry boxes and thumb wheels or sliders to specify translation, scaling, and orientation in three dimensions.<br />
<br />
<center>[[File:ParaView_UsersGuide_boxWidgetUI.png]]</center><br />
<br />
<center>'''Figure 12. Box widget user interface'''</center><br />
<br />
=== Sphere Widget ===<br />
[[File:ParaView_UsersGuide_sphereWidget.png|left|link=]]The sphere widget is used in clipping and cutting. The sphere can be moved by left-clicking on any point on the sphere and dragging. The radius of the sphere is manipulated by right-clicking on any point on the sphere and dragging. Upward mouse motion increases the sphere’s radius; downward motion decreases it.<br />
<br />
As shown below, the center and radius can also be set manually from the entry boxes on the user interface. There is also a button to position the sphere at the center of the bounding box of the current dataset.<br />
<br />
<center>[[File:ParaView_UsersGuide_sphereWidgetUI.png]]</center><br />
<br />
<center>'''Figure 13. Sphere widget user interface'''</center><br />
<br />
<br />
=== Point Widget ===<br />
<br />
[[File:ParaView_UsersGuide_pointWidget.png|left|link=]]The point widget is used to set the position of a point or the center of a point cloud. It is used by both the '''Stream Tracer''', '''Probe Location''' and '''Probe Location over Time''' filters. The position of the point can be changed by left-clicking anywhere on it and dragging. Right-clicking and dragging anywhere on the widget changes the size of the point widget in the scene. To position the widget accurately, the user may need to change the camera position as well. Holding the Shift key while interacting will restrict the motion of the point to one of the x, y or z planes. (The plane chosen is the one that is most closely aligned with the direction of the initial mouse movement.)<br />
<br />
As shown below, entry boxes allow the user to exactly specify the coordinates of the point, and a button is provided to position the point at the center of the bounds of the current dataset. If the point widget is being used to position a point cloud instead of a single point, entry boxes are also provided to specify the radius of the point cloud and the number of points the cloud contains.<br />
<br />
<center>[[File:ParaView_UsersGuide_pointWidgetUI.png]]</center><br />
<br />
<center>'''Figure 14. Point widget user interface'''</center><br />
<br />
=== Spline Widget ===<br />
<br />
[[File:ParaView_UsersGuide_splineWidget.png|left|300px|link=]]The spline widget is used to define a path through 3D space. It is used by the '''Spline Source''' source and in the Camera animation dialog. The widget consists of a set of control points, shown as spheres in the 3D scene that can clicked on with the mouse and dragged perpendicular to the viewing direction. The points are ordered and the path through them defines a smoothly varying path through 3D space. <br />
<br />
As shown below, the text control box for the spline widget allows you to add or delete control points and specify their locations exactly. You can hide or show the widget and can choose to close the spline to create a loop, which adds a path segment from the last control point back to the first.<br />
<br />
<center>[[File:ParaView_UsersGuide_splineWidgetUI.png]]</center><br />
<br />
<center>'''Figure 15. Spline widget user interface'''</center></div>Katie.osterdahlhttps://public.kitware.com/Wiki/index.php?title=Exporting_Scenes&diff=40749Exporting Scenes2011-06-14T15:57:34Z<p>Katie.osterdahl: </p>
<hr />
<div>ParaView provides functionality to export any scene set up with polygonal data (i.e without volume rendering). Currently [http://www.web3d.org/x3d/ X3D] (ASCII as well as binary), [http://www.web3d.org/x3d/vrml VRML (Virtual Reality Modeling Language)], and [http://www.povray.org/ POV-Ray] are supported. To export a scene, set up the scene in a 3D view. Only one view can be exported at a time. With the view to be exported active, choose '''File '''| Export. <br />
<br />
[[Image:Export.png|200px|thumb|right|'''Figure 7.4''' Export option in the File menu can be used to export the scene set up in a 3D view]]<br />
<br />
The file-open dialog will list the available types. The type is determined based on the extensions of the file written out:<br />
* *.vrml -- [http://www.vtk.org/doc/nightly/html/classvtkVRMLExporter.html VRML]<br />
* *.x3d -- [http://www.vtk.org/doc/nightly/html/classvtkX3DExporter.html X3D ASCII]<br />
* *.x3db -- [http://www.vtk.org/doc/nightly/html/classvtkX3DExporter.html X3D Binary]<br />
* *.pov -- [http://www.vtk.org/doc/nightly/html/classvtkPOVExporter.html POV-Ray]<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
{{ParaView/Template/Footer}}</div>Katie.osterdahlhttps://public.kitware.com/Wiki/index.php?title=ParaView/Users_Guide/Saving_Data&diff=40748ParaView/Users Guide/Saving Data2011-06-14T15:55:13Z<p>Katie.osterdahl: </p>
<hr />
<div>== Saving Data ==<br />
Once you have created a visualization of your data in ParaView, you can save the resulting work as raw data, or an image, movie, or geometry.<br />
<br />
=== Save raw data ===<br />
Any object in the ParaView pipeline browser can be saved to a data file by selecting Save Data from the File menu. The available file types will change based on the dataset type of the current dataset. The file formats in which ParaView can save data are listed on [[ParaView/Users Guide/List_of_writers|List of Writers]] <br />
<br />
[[Image:ParaView_UsersGuide_SaveParaViewWindowDialog.png|thumb|center|500px|'''Figure 7.1''' Saving Files in ParaView]]<br />
<br />
=== Save screenshots ===<br />
<br />
ParaView allows the user to save either the [[Users_Guide_Introduction#Modality|active view]] or all the views. The resulting image will be saved on the client machine, even when running with a remote server. The dialog allows you to control the following:<br />
<br />
* Image size<br />
* Aspect ratio of the image<br />
* Image quality<br />
* [[Color_Palettes|Color palette]] <br />
* Stereo mode<br />
<br />
[[Image:ParaView_UG_ScreenshotDialog.png|thumb|center|400px|'''Figure 7.2''' Save Snapshot Resolution Dialog Box]]<br />
<br />
=== Save Animation ===<br />
Once you have created an animation of your data, you can save the animation to disk either as a series of images (one per animation frame) or as a movie file. The animation will contain all the visible views. <br />
<br />
To do this, select Save Animation from the File menu. The Animation Settings Dialog then appears, which lets you set properties for the recorded animation.<br />
<br />
[[Image:ParaView_UG_SaveAnimation.png|thumb|center|600px|'''Figure 7.3''' Animation Settings Dialog Box]]<br />
<br />
Once you press the Save Animation button, a save file dialog box will allow you to choose where to save your image or movie file(s). Enter a file name then select an image file type (.jpg, .tif, or .png) or a movie file type (.avi). <br />
<br />
Once you choose a file name, the animation will play from beginning to end, and the animation frames generated will be used to create the selected type of image or movie file(s). While the image is playing the render window in ParaView will not update with the correct frame.<br />
<br />
If you are connected to a remote server then the Disconnect Before Saving Animation checkbox will be enabled. If you select this before saving the animation, then the ParaView client will disconnect from the server immediately, and the server will continue generating and saving images until the animation completes. When it is finished recording the animation, the server will shut down.<br />
<br />
=== Save geometries ===<br />
<br />
In addition to saving images of each time step in your animation, you may also wish to save the geometry itself. Select Save Geometry from the File menu to do this. This will cause a file navigation dialog box to be displayed. Navigate to the location where you wish to save the geometry, and enter a file name. You must save your data using ParaView’s .pvd file format. <br />
<br />
Unlike an animation, save geometry will only save the visible geometry of the active view for each time step. The resulting .pvd file will contain a pointer to each of these files, which are saved in a folder with the same as the .pvd file. <br />
<br />
You can later reload the .pvd file into ParaView as a time varying dataset. If multiple datasets were displayed while the animation was running, they will be grouped together as a multi-block dataset for each time step. If you then want to operate on the parts individually, run the Extract Blocks filter to select the appropriate block(s).</div>Katie.osterdahlhttps://public.kitware.com/Wiki/index.php?title=ParaView/Users_Guide/Plotting_and_Probing_Data&diff=40747ParaView/Users Guide/Plotting and Probing Data2011-06-14T15:47:08Z<p>Katie.osterdahl: </p>
<hr />
<div>There are multiple ways of probing a dataset for point or cell values. The simplest<br />
is the Probe Location filter. Additionally, there are a variety of filters<br />
to plot data with respect to time, location, or grid object ID.<br />
<br />
== Probe Filter ==<br />
The probe filter can be used to query a dataset for point or cell data.<br />
<br />
Options for the probe filter are:<br />
* Show Point button is used to show where the center of the sphere is for generating the probe points.<br />
* Center on bounds will place the sphere center at the center of the dataset's bounds.<br />
* The sphere center can either be set in the properties tab of the object inspector or in the 3D view with the mouse cursor. To choose a new point in the 3D view window, press P and then click on the desired point. Note that the Show Point option must be selected in order to activate the point widget.<br />
<br />
The output for this filter is a single cell comprised of a set of points in a vtkPolyData.<br />
<br />
== Line Plots ==<br />
The line plots have similar control functionality for displaying the results.<br />
These options are in the Display tab of the Object Inspector and include selecting<br />
which point and/or cell data to include in the plot, what should be used as the<br />
x axis values (e.g. point/cell index or a specified point or cell data array),<br />
and plot preferences such as line thickness and marker style. See the <br />
[[ParaView/Displaying Data#Line_Chart_View|line chart view section]] for more information on<br />
setting the display properties for these filters. An example line plot<br />
is shown in Figure 6.18..<br />
<br />
[[Image:ParaViewUsersGuideLineChartView.png|thumb|center|600px|'''Figure 6.18''' A Line Plot]]<br />
<br />
=== Plot Data / Scatter Plot ===<br />
The Plot Data filter and Scatter Plot filter are very similar in functionality,<br />
with the Scatter Plot filter being a deprecated version of the Plot Data filter.<br />
The main difference is that the Scatter Plot filter's output is a 1D rectilinear<br />
grid while the Plot Data filter's output is the same type as the input.<br />
<br />
The Plot Data filter plots point or cell data over the entire data set. By default,<br />
the X axis values are determined with respect to their point or cell index.<br />
<br />
=== Plot Over Line ===<br />
The Plot Over Line filter is used to plot point data over a specified straight line.<br />
The Plot Over Line filter will not display cell data over the line so the user can use the<br />
Cell Data to Point Data filter to convert cell data to point data in order to use this filter<br />
for viewing desired cell data.<br />
<br />
The line geometry can specified either by setting the points in the Properties tab<br />
of the Object Inspector or by pressing P and selecting the beginning and ending points<br />
of the line. Note that the Show Line option must be selected to activate the line widget.<br />
The resolution option is used to specify at how many evenly spaced points on the line to query<br />
the dataset for information on the point data.<br />
<br />
=== Plot on Sorted Lines ===<br />
<br />
The Plot on Sorted Lines filter is used when polydata with line cell types have been extracted from <br />
a dataset and the user wants to see how point data varies over the line. This filter orders the<br />
lines by their connectivity instead of their point index. The output of the filter is a multiblock<br />
with a block for each contiguous line.<br />
<br />
=== Plot on Intersection Curves ===<br />
The Plot on Intersection Curves filter is used to plot point data where the data set intersects the given polygonal slice object. The results is a multiblock of polydatas where each block represents a contiguous set of cells. Note that the polydatas will only have 1D cell types. Thus if the slice type object intersection with the data set has 2D geometry the filter will take the boundary of the slice type object in order to reduce down to 1D geometry. If the slice type is a sphere that is wholly contained in a volumetric dataset then the filter parameters are invalid and no lines will be output.<br />
<br />
=== Plot Selection Over Time ===<br />
<br />
The Plot Selection Over Time filter can be used to visualize the variation of<br />
point or cell data from a selection with respect to time. <br />
The selection should be made on the dataset of the filter that<br />
precedes the Plot Selection Over Time filter in the pipeline in order<br />
to ensure that the proper points or cells are selected.<br />
Note that information for only a single point or cell can be plotted at a time.<br />
<br />
=== Plot Global Variables Over Time ===<br />
The Plot Global Variables Over Time filter plots field data that<br />
is defined over time. Filters must be set up explicitly to<br />
provide the proper information as this will not work for field data in<br />
general. As an example, see the Exodus reader in ParaView.</div>Katie.osterdahlhttps://public.kitware.com/Wiki/index.php?title=ParaView/Users_Guide/Histogram&diff=40669ParaView/Users Guide/Histogram2011-06-13T11:04:13Z<p>Katie.osterdahl: </p>
<hr />
<div>The Histogram filter produces output indicating the number of occurrences of each value from a<br />
chosen data array. It takes in a vtkDataObject but the object must have either point or cell data<br />
to operate on. The filter cannot be directly used with a table but the Table to Points filter<br />
can be used to convert the table to a polydata for input into the Histogram filter.<br />
The bar chart is the default view for the output of the Histogram filter. Other views that can be used are the line chart view,<br />
parallel coordinate view, and spreadsheet view. The chart views are useful for observing trends in the data<br />
while the spreadsheet view is useful for seeing exact numbers. An example Histogram filter output<br />
in a bar chart view is shown in Figure 6.17. <br />
<br />
[[Image:ParaViewUsersGuideBarChartView.png|thumb|center|600px|'''Figure 6.17''' Histogram filter output in bar chart view]]<br />
<br />
Options for the Histogram filter are:<br />
* Which array to process. This can be either a point data array or a cell data array. For arrays with more than one component, the user can specify which component to compute with respect to. The default is the first component.<br />
* The number of bins to put the results in as well as the range the bins should be divided from.<br />
* An option to average other field information of the same type for each of the bins.<br />
*Which variables are to be displayed in the view. This is under the Display tab of the Object Inspector.</div>Katie.osterdahlhttps://public.kitware.com/Wiki/index.php?title=ParaView/Users_Guide/Query_Data&diff=40668ParaView/Users Guide/Query Data2011-06-13T11:02:43Z<p>Katie.osterdahl: </p>
<hr />
<div>As previously described, Selection is a mechanism in ParaView for sub-setting and focusing on a particular elements in the dataset. Different views provides different mechanisms for selecting elements, for example, you can select visible cells or points using the 3D View. Another mechanism for creating selections is by specifying a selection criteria. For example, suppose you want to select all cells where the pressure value is between a certain threshold. In such cases, you can use the Find Data dialog. The Find Data dialog performs a dual role: not only does it enable specifying the selection criteria but also show details of the selected elements in a spreadsheet. This makes it easier to inspect the selected elements.<br />
<br />
To open the Find Data dialog, go to '''Edit'''|Find Data.<br />
<br />
[[Image:ParaViewUsersGuideFindDataDialog.png|thumb|center|400px|'''Figure 6.13''']]<br />
<br />
=When to use '''Find Data'''=<br />
This feature is useful when you run into situations where you want to know the cell or the point at which a certain condition happens For example:<br />
* What are the cells at which PRESSURE >= 12?<br />
* What are the points with TEMP values in the range (12, 133)?<br />
* Locate the cell at ID 122, in Block 2.<br />
<br />
This feature provides a convenient way of creating selections based on certain criteria that can then be extracted from the data if needed.<br />
<br />
=Using the '''Find Data''' dialog=<br />
<br />
The dialog is designed to be used in two distinct operations:<br />
* Define the selection criteria or query<br />
* Process the selected cells/points e.g. show labels in active 3D view, extract selection etc.<br />
<br />
You must define the selection query and then execute the query, using the Run Query button before being able to inspect or process the selected elements.<br />
<br />
=Defining the Query=<br />
<br />
First, decide what type of elements you are interested in selecting, that is cells or points and from what data source. This can be done using the following combo boxes. Note that as you change these, any previous selections/queries will be cleared.<br />
<br />
[[Image:ParaViewUsersGuideFindDataHeader.png|thumb|center|400px|'''Figure 6.14''' Find Data options]]<br />
<br />
Next, you must define the selection criteria. For defining the criteria, you first choose the term, for example IDs, Global IDs, attribute array names, etc., available for the chosen element type. Next you select the operator, and finally the value or values. Based on the operator one or more values may be entered in the value entry box using comma (,) as the separator.<br />
<br />
In addition, based on the data type and the nature of the current session, there may be additional rows that allow users to qualify the selection using optional parameters such as process number (when running in parallel), or block number (for composite datasets).<br />
<br />
Once you have defined your query, hit Run Query button to execute the query. If any elements get selected, then they will be shown in the spreadsheet in this dialog. Also, if any of the views are showing in the dataset that is selected, then they will be highlighted the selected elements as well, just like regular view-based selection.<br />
<br />
=Displaying the Selection=<br />
<br />
Once a query is executed, the selected elements will be highlighted in all views where the selected data is visible. If the active view is a 3D view, you can choose whether the show labels for selected elements as well as the color to use for showing the selected elements using the controls on the Find Data dialog itself.<br />
<br />
[[Image:ParaViewUsersGuideFindDataSelectionControls.png|thumb|center|400px|'''Figure 6.15''']]<br />
<br />
=Extracting the Selection=<br />
<br />
The results of a query are temporary. They get replaced when a new query is executed or when the user creates a selection using any of the selection mechanisms. Sometimes, however, users may want to further analyze the selected elements such as apply more filters to only the selected elements, or plot the change in attributes on the selected elements over time. In that case, you should extract the selection. That creates a new filter that is setup to run the query on its input and produce a dataset matching the selection criteria. Both Extract Selection and Plot Selection Over Time are filters available through the Filters menu. The Find Data dialog provides shortcut buttons to quickly create those filters and set then up with the selection criteria chosen.<br />
<br />
[[Image:ParaViewUsersGuideFindDataFooter.png|thumb|center|400px|'''Figure 6.16''']]</div>Katie.osterdahlhttps://public.kitware.com/Wiki/index.php?title=ParaView/Users_Guide/Query_Data&diff=40667ParaView/Users Guide/Query Data2011-06-13T11:02:24Z<p>Katie.osterdahl: </p>
<hr />
<div>As previously described, Selection is a mechanism in ParaView for sub-setting and focusing on a particular elements in the dataset. Different views provides different mechanisms for selecting elements, for example, you can select visible cells or points using the 3D View. Another mechanism for creating selections is by specifying a selection criteria. For example, suppose you want to select all cells where the pressure value is between a certain threshold. In such cases, you can use the Find Data dialog. The Find Data dialog performs a dual role: not only does it enable specifying the selection criteria but also show details of the selected elements in a spreadsheet. This makes it easier to inspect the selected elements.<br />
<br />
To open the Find Data dialog, go to '''Edit'''|Find Data.<br />
<br />
[[Image:ParaViewUsersGuideFindDataDialog.png|thumb|center|400px\'''Figure 6.13''']]<br />
<br />
=When to use '''Find Data'''=<br />
This feature is useful when you run into situations where you want to know the cell or the point at which a certain condition happens For example:<br />
* What are the cells at which PRESSURE >= 12?<br />
* What are the points with TEMP values in the range (12, 133)?<br />
* Locate the cell at ID 122, in Block 2.<br />
<br />
This feature provides a convenient way of creating selections based on certain criteria that can then be extracted from the data if needed.<br />
<br />
=Using the '''Find Data''' dialog=<br />
<br />
The dialog is designed to be used in two distinct operations:<br />
* Define the selection criteria or query<br />
* Process the selected cells/points e.g. show labels in active 3D view, extract selection etc.<br />
<br />
You must define the selection query and then execute the query, using the Run Query button before being able to inspect or process the selected elements.<br />
<br />
=Defining the Query=<br />
<br />
First, decide what type of elements you are interested in selecting, that is cells or points and from what data source. This can be done using the following combo boxes. Note that as you change these, any previous selections/queries will be cleared.<br />
<br />
[[Image:ParaViewUsersGuideFindDataHeader.png|thumb|center|400px|'''Figure 6.14''' Find Data options]]<br />
<br />
Next, you must define the selection criteria. For defining the criteria, you first choose the term, for example IDs, Global IDs, attribute array names, etc., available for the chosen element type. Next you select the operator, and finally the value or values. Based on the operator one or more values may be entered in the value entry box using comma (,) as the separator.<br />
<br />
In addition, based on the data type and the nature of the current session, there may be additional rows that allow users to qualify the selection using optional parameters such as process number (when running in parallel), or block number (for composite datasets).<br />
<br />
Once you have defined your query, hit Run Query button to execute the query. If any elements get selected, then they will be shown in the spreadsheet in this dialog. Also, if any of the views are showing in the dataset that is selected, then they will be highlighted the selected elements as well, just like regular view-based selection.<br />
<br />
=Displaying the Selection=<br />
<br />
Once a query is executed, the selected elements will be highlighted in all views where the selected data is visible. If the active view is a 3D view, you can choose whether the show labels for selected elements as well as the color to use for showing the selected elements using the controls on the Find Data dialog itself.<br />
<br />
[[Image:ParaViewUsersGuideFindDataSelectionControls.png|thumb|center|400px|'''Figure 6.15''']]<br />
<br />
=Extracting the Selection=<br />
<br />
The results of a query are temporary. They get replaced when a new query is executed or when the user creates a selection using any of the selection mechanisms. Sometimes, however, users may want to further analyze the selected elements such as apply more filters to only the selected elements, or plot the change in attributes on the selected elements over time. In that case, you should extract the selection. That creates a new filter that is setup to run the query on its input and produce a dataset matching the selection criteria. Both Extract Selection and Plot Selection Over Time are filters available through the Filters menu. The Find Data dialog provides shortcut buttons to quickly create those filters and set then up with the selection criteria chosen.<br />
<br />
[[Image:ParaViewUsersGuideFindDataFooter.png|thumb|center|400px|'''Figure 6.16''']]</div>Katie.osterdahlhttps://public.kitware.com/Wiki/index.php?title=ParaView/Users_Guide/Selection&diff=40666ParaView/Users Guide/Selection2011-06-13T10:54:01Z<p>Katie.osterdahl: </p>
<hr />
<div>Selection is the mechanism for identifying a subset of a dataset by using user-specified criteria. This subset can be a set of points, cells or a block of composite dataset. This functionality allows users to focus on a smaller subset that is important. For example, the elements of a finite-element mesh that have pressure above a certain threshold can be identified very easily using the threshold selection. Furthermore, this selection can be converted to a set of global element IDs in order to plot the attribute values of those elements over time.<br />
<br />
This section discusses the mechanism for creating selections using Views and Selection Inspector. The following section details another powerful and flexible mechanism of creating selection using queries.<br />
<br />
ParaView supports a single active selection. This selection is associated with a data source (here data source refers to any reader, source or filter) and is shown in every view that displays the data source’s output. This article uses a use-case driven approach to demonstrate how this selection can be described and used. The next section introduces the main GUI components that are used in the article and subsequent sections address different use cases.<br />
<br />
=Selection Inspector=<br />
ParaView provides a selection inspector (referred to simply as the inspector in this article) to inspect and edit the details about the active selection. You can toggle the inspector visibility from the View menu. The inspector can be used to create a new active selection, view/edit the properties of the active selection as well as change the way the selection is displayed in the 3D window e.g. change the color, show labels etc.<br />
<br />
<br />
=Spreadsheet View=<br />
<br />
[[Image:Selection1.png|thumb|center|650px|'''Figure 6.6''' Spreadsheet View in ParaView showing the display tab for a source producing a multi-block dataset. The selected cells are highlighted in the 3D view as well as the spreadsheet view. The active selection can be inspected using the selection inspector.]]<br />
<br />
[[ParaView/Users Guide/Spreadsheet View|Spreadsheet View]] provides data exploration capabilities. One of the common complaints many users have is not being able to look at the raw data directly. Spreadsheet view provides exactly that. It allows the user to look at the raw cell data, point data or field data associated with a dataset. For more details on how to use the Spreadsheet View, please refer to [[ParaView/Users Guide/Spreadsheet View|Spreadsheet View Chapter]].<br />
<br />
=Create a Selection=<br />
<br />
This section covers different ways of creating a selection. <br />
<br />
==Select cells/points on the Surface==<br />
<br />
One of the simplest use-cases is to select cells or points on the surface of the dataset. It is possible to select surface cells by drawing a rubber-band on the 3D view. With the 3D view showing the dataset active, click on Select Cells (or Points) On in the Selection Controls toolbar or under the Edit menu (you can also use the ‘S’ key a shortcut for ‘Select Cells On’). This will put ParaView into a selection mode. In this mode, click and drag over the surface of the dataset in the active view to select the cells (or points) on the surface. If anything was selected, it will be highlighted in all the views showing the data and the source producing the selected dataset will become active in the Pipeline Browser. ParaView supports selecting only one source at a time. Hence, even if you draw the rubber band such that it covers data from multiple sources, only one of them will be selected (the one that has the largest number of selected cells or points).<br />
<br />
As mentioned earlier, when data from a source is selected, all the views displaying the data show the selection. This includes spreadsheet view as well. If the spreadsheet view will show cell or point attributes of the selected data, then it will highlight the corresponding rows. When selecting points, the spreadsheet view will show the selection only if point attributes are being displayed. When selecting cells, it will highlight the cells in the cell attribute mode, and highlight the points forming the cells in the point attribute mode. For any decent sized dataset, it can be a bit tricky to locate the selected rows. In that case, the Show only selected elements on the display tab can be used to hide all the rows that were not selected.<br />
<br />
When selecting cells (or points) on the surface, ParaView determines the cell (or point) IDs for each of the cell (or point) rendered within the selection box. The selection is simply the IDs for cells (or points) thus determined.<br />
<br />
==Select cells/points using a Frustum==<br />
<br />
[[Image:Selection2.png|thumb|center|600px|'''Figure 6.7''': Selection using a Frustum. Note that all cells that lie within the specified frustum are selected. The selection inspector shows the details of the selection.]]<br />
<br />
This is similar to selecting on the surface except that instead of selecting the cells (or points) on the surface of the dataset, it selects all cells (or points) that lie within the frustum formed by extruding the rectangular rubber band drawn on the view into 3D space. To perform a frustum selection, use Select Cells (or Points) Through in the Selection Controls toolbar or under the Edit menu. As with surface selection, the selected cells/points are shown in all the views in which the data is shown including the spreadsheet view. Unlike surface selection, the indices of the cells or points are not computed after a frustum selection. Instead ParaView performs intersections to identify the cells (or points) that lie within the frustum. Note that this selection can produce a very large selection and thus may be time consuming and can increase the memory usage significantly.<br />
<br />
==Select Blocks in a Composite Dataset==<br />
[[Image:Selection3.png|thumb|center|600px|'''Figure 6.8''': Selecting a block in multi-block dataset. All the cells in the selected block are highlighted. The selection inspector shows the selected block.]]<br />
<br />
Composite datasets are multi-block or AMR (adaptive mesh refinement) datasets. In the case of multi-block datasets, each block may represent different components of a large assembly e.g. tires, chassis, etc. for a car dataset. Just like selecting cells or points, it is possible to select entire blocks. To enter the block selection mode use Select Block in the Selection Controls toolbar or under the Edit menu (you can also use the ‘B’ key as a shortcut for Select Block). Once in block selection mode, you can simply click on the block in the 3D view to select a single block or click and drag to select multiple blocks. When a block is selected, its surface cells will be highlighted.<br />
<br />
==Select using the Spreadsheet View==<br />
<br />
Thus far the examples have looked at defining the selection on the 3D view. This section focuses on how to create selections using the spreadsheet view. As discussed earlier, the spreadsheet view simply shows the raw cell (point or field) data in a table. Each row represents a unique cell (or point) from the dataset. Like with any other spreadsheet application, you can select a cell (or a point) by simply clicking on the row to select. You can expand the selection using ''Ctrl'', ''Shift'' keys while clicking. If the spreadsheet view is currently showing point attributes, then selecting it will create a point based selection. Similarly, if it is showing cell attributes then it will create a cell based selection. Selection cannot be created when showing field attributes which are not associated with any cell or point.<br />
<br />
All views showing a selected dataset show the selection. The spreadsheet view showing the data from a source selected in the 3D view highlights the corresponding cells/points. Conversely, when creating a selection in the spreadsheet view, the corresponding cell (or point) gets highlighted in all the 3D views showing the source. <br />
<br />
==Select using the Selection Inspector==<br />
[[Image:Selection4.png|thumb|center|600px|'''Figure 6.9''': Location based selection showing the cross hairs used to specify the locations.]]<br />
<br />
Sometimes you may want to tweak the selection or create a new selection with a known set of cell (or point) IDs or create selections based of value of any array or location etc. This is possible using the Selection Inspector.<br />
<br />
Whenever a selection is created in any of the views, it becomes the active selection. The active selection is always shown in the Selection Inspector. For example, if you select cells on the surface of a dataset, then as shown in Figure 6.8, the selection inspector will show indices for the cells selected. <br />
<br />
The selection inspector has three sections: the topmost Current Object and Create Selection are used to choose the source whose output you want to create a selection on. The Active Selection group shows the details of the active selection, if any. The Display Style group makes it possible to change the way the selection in shown in the active 3D view.<br />
<br />
To create a new selection, choose the source whose output needs to be selected in the Current Object combo-box and then hit Create Selection. An empty selection will be created and its properties will be shown in the active selection group. Alternatively, you can use any of the methods described earlier to create a selection; it will still be shown in the selection inspector.<br />
<br />
When you select cells (or points) on the surface or using the spreadsheet view, the selection type is set to IDs. Creating a frustum selection results in a selection with the selection type set to Frustum, while selecting a block in a composite dataset creates a Block selection. Field Type indicates whether cells or points are to be selected. <br />
<br />
In the active selection group, Selection Type indicates the type of the active selection. You can change the type by choosing one of the available options.<br />
<br />
As shown in Figure 6.8 for IDs selection, the inspector lists all the selected cell or point indices. You can edit the list of ids to add or remove values. When connected to a parallel server, cell or point ids are not unique. Hence, you have to additionally specify the process number for each cell or point ID. Process number -1 implies that the cell (or point) at the given index is selected on all processes. For multi-block datasets, you also need to indicate the block to which the cell or point belongs. For AMR datasets, you need to specify the (AMR level, index) pair.<br />
<br />
As shown in Figure 6.6, for Frustum selection, currently only the Show Frustum option is available. When this option is turned on, ParaView shows the selection frustum in the 3D view. In the future, we will implement a 3D widget to modify the frustum.<br />
<br />
As shown in Figure 6.8, for Block selection, the full composite tree is shown in the inspector with the selected blocks checked. <br />
Using the selection inspector you can create a selection based on thresholds for scalars in the dataset. Choose the scalar array and then add value ranges for the selected cells (or points).<br />
<br />
The Selection Inspector can be used to create location-based selection. When field type is CELL, cells at the indicated 3D locations will be selected. When field type is POINT, the point closest to the location within a certain threshold is selected. If Select cells that include the selected points is checked, then all the cells that contain the selected point are selected. It is possible to specify more than one location. To aid in choosing positions, you can turn the Show location widgets option on. As a result, ParaView will show cross hairs in the active 3D view, which can be moved interactively, as shown in Figure 6.6.<br />
<br />
The Selection Inspector also provides a means to create global ID-based selection. These are similar to index based selection however since global IDs are unique across all processes and blocks, you do not need to specify any additional as needed by the ID-based selection.<br />
<br />
=Convert Selections=<br />
<br />
The Selection Inspector can also be used to convert a selection of one type to another. With some valid active selection present, if you change the selection type then ParaView will try to convert the current selection to the new type, still preserving the cells (or points) that were selected, if possible. For example, if you create a frustum-based selection and then change the selection type to IDs, ParaView will determine the indices for all the cells (or points) that lie with the frustum and initialize the new index-based selection with those indices. Note that the number of cells or points that get selected in frustum selection mode can potentially be very large; hence this conversion can be slow and memory expensive. Similarly, if the dataset provides global IDs, then it is possible to convert between IDs selection and global ID-based selection. <br />
i<br />
It is not possible to convert between all types of selections due to obvious reasons. Conversions between ID-based and global ID-based selections, conversions from frustum to ID-based selections, and conversions from frustum to global ID-based selections are supported by the Selection Inspector.<br />
<br />
=Label Selected Cell/Points=<br />
Once an active selection is created, you can label the cells or points or their associated values in a 3D view. This can be done using the Selection Inspector. At the bottom of the selection inspector panel, there are two tabs, Cell Label and Point Label, which can be used to change the cell or point label visibility and other label attributes such color, font etc. These tabs are enabled only if the active view is a 3D view. Any changes made in the Display Style group (including the labels) only affect the active 3D view.<br />
<br />
[[File:ParaView_UsersGuide_LabeledSelection.png|thmub|center|800px|'''Figure 6.10''']]<br />
<br />
=Extract Selection=<br />
[[Image:Selection5.png|thumb|center|600px|'''Figure 6.11''': Extract selection using a frustum selection]]<br />
<br />
Selection makes it possible to highlight and observe regions of interest. Often, once a region of interest has been identified, users would like to apply additional operations on it, such as apply filters to only the selected section of the data. This can be achieved using the Extract Selection filter. To set the selection to extract, create a selection using any of the methods already described. Then apply the extract selection filter to the source producing the selected data. To copy the active selection to the filter, use the Copy Active Selection button. You can change the active selection at any time and update the filter to use it by using this button. Figure 6.7 shows the extract selection filter applied after a frustum selection operation. Now, you can treat this as any other data source and apply filters to it, save state, save data etc.<br />
<br />
=Plot Selection over Time=<br />
[[Image:Selection6.png|thumb|center|600px|'''Figure 6.12''': Plot selection over time.]]<br />
<br />
For time varying datasets, you may want to analyze how the data variables change over time for a particular cell or a point. This can be done using the Plot Selection Over Time filter. This filter is similar to the Extract Selection filter, except that it extracts the selection for all time-steps provided by the data source (typically a reader) and accumulates the values for all the cell (or point) attributes over time. Since the selection can comprise of multiple cells or points, the display tab provides the Select Block widget which can be used to select the cell or point to plot, as shown in Figure [6]. Currently only one cell (or point) can be plotted at once in the same xy-plot view. You can create multiple plot views to show multiple plots simultaneously.</div>Katie.osterdahlhttps://public.kitware.com/Wiki/index.php?title=ParaView/Users_Guide/Selection&diff=40665ParaView/Users Guide/Selection2011-06-13T10:51:14Z<p>Katie.osterdahl: </p>
<hr />
<div>Selection is the mechanism for identifying a subset of a dataset by using user-specified criteria. This subset can be a set of points, cells or a block of composite dataset. This functionality allows users to focus on a smaller subset that is important. For example, the elements of a finite-element mesh that have pressure above a certain threshold can be identified very easily using the threshold selection. Furthermore, this selection can be converted to a set of global element IDs in order to plot the attribute values of those elements over time.<br />
<br />
This section discusses the mechanism for creating selections using Views and Selection Inspector. The following section details another powerful and flexible mechanism of creating selection using queries.<br />
<br />
ParaView supports a single active selection. This selection is associated with a data source (here data source refers to any reader, source or filter) and is shown in every view that displays the data source’s output. This article uses a use-case driven approach to demonstrate how this selection can be described and used. The next section introduces the main GUI components that are used in the article and subsequent sections address different use cases.<br />
<br />
=Selection Inspector=<br />
ParaView provides a selection inspector (referred to simply as the inspector in this article) to inspect and edit the details about the active selection. You can toggle the inspector visibility from the View menu. The inspector can be used to create a new active selection, view/edit the properties of the active selection as well as change the way the selection is displayed in the 3D window e.g. change the color, show labels etc.<br />
<br />
<br />
=Spreadsheet View=<br />
<br />
[[Image:Selection1.png|thumb|center|650px|'''Figure 6.6''' Spreadsheet View in ParaView showing the display tab for a source producing a multi-block dataset. The selected cells are highlighted in the 3D view as well as the spreadsheet view. The active selection can be inspected using the selection inspector.]]<br />
<br />
[[ParaView/Users Guide/Spreadsheet View|Spreadsheet View]] provides data exploration capabilities. One of the common complaints many users have is not being able to look at the raw data directly. Spreadsheet view provides exactly that. It allows the user to look at the raw cell data, point data or field data associated with a dataset. For more details on how to use the Spreadsheet View, please refer to [[ParaView/Users Guide/Spreadsheet View|Spreadsheet View Chapter]].<br />
<br />
=Create a Selection=<br />
<br />
This section covers different ways of creating a selection. <br />
<br />
==Select cells/points on the Surface==<br />
<br />
One of the simplest use-cases is to select cells or points on the surface of the dataset. It is possible to select surface cells by drawing a rubber-band on the 3D view. With the 3D view showing the dataset active, click on Select Cells (or Points) On in the Selection Controls toolbar or under the Edit menu (you can also use the ‘S’ key a shortcut for ‘Select Cells On’). This will put ParaView into a selection mode. In this mode, click and drag over the surface of the dataset in the active view to select the cells (or points) on the surface. If anything was selected, it will be highlighted in all the views showing the data and the source producing the selected dataset will become active in the Pipeline Browser. ParaView supports selecting only one source at a time. Hence, even if you draw the rubber band such that it covers data from multiple sources, only one of them will be selected (the one that has the largest number of selected cells or points).<br />
<br />
As mentioned earlier, when data from a source is selected, all the views displaying the data show the selection. This includes spreadsheet view as well. If the spreadsheet view will show cell or point attributes of the selected data, then it will highlight the corresponding rows. When selecting points, the spreadsheet view will show the selection only if point attributes are being displayed. When selecting cells, it will highlight the cells in the cell attribute mode, and highlight the points forming the cells in the point attribute mode. For any decent sized dataset, it can be a bit tricky to locate the selected rows. In that case, the Show only selected elements on the display tab can be used to hide all the rows that were not selected.<br />
<br />
When selecting cells (or points) on the surface, ParaView determines the cell (or point) IDs for each of the cell (or point) rendered within the selection box. The selection is simply the IDs for cells (or points) thus determined.<br />
<br />
==Select cells/points using a Frustum==<br />
<br />
[[Image:Selection2.png|thumb|center|600px|'''Figure 6.7''': Selection using a Frustum. Note that all cells that lie within the specified frustum are selected. The selection inspector shows the details of the selection.]]<br />
<br />
This is similar to selecting on the surface except that instead of selecting the cells (or points) on the surface of the dataset, it selects all cells (or points) that lie within the frustum formed by extruding the rectangular rubber band drawn on the view into 3D space. To perform a frustum selection, use Select Cells (or Points) Through in the Selection Controls toolbar or under the Edit menu. As with surface selection, the selected cells/points are shown in all the views in which the data is shown including the spreadsheet view. Unlike surface selection, the indices of the cells or points are not computed after a frustum selection. Instead ParaView performs intersections to identify the cells (or points) that lie within the frustum. Note that this selection can produce a very large selection and thus may be time consuming and can increase the memory usage significantly.<br />
<br />
==Select Blocks in a Composite Dataset==<br />
[[Image:Selection3.png|thumb|center|600px|'''Figure 6.7''': Selecting a block in multi-block dataset. All the cells in the selected block are highlighted. The selection inspector shows the selected block.]]<br />
<br />
Composite datasets are multi-block or AMR (adaptive mesh refinement) datasets. In the case of multi-block datasets, each block may represent different components of a large assembly e.g. tires, chassis, etc. for a car dataset. Just like selecting cells or points, it is possible to select entire blocks. To enter the block selection mode use Select Block in the Selection Controls toolbar or under the Edit menu (you can also use the ‘B’ key as a shortcut for Select Block). Once in block selection mode, you can simply click on the block in the 3D view to select a single block or click and drag to select multiple blocks. When a block is selected, its surface cells will be highlighted.<br />
<br />
==Select using the Spreadsheet View==<br />
<br />
Thus far the examples have looked at defining the selection on the 3D view. This section focuses on how to create selections using the spreadsheet view. As discussed earlier, the spreadsheet view simply shows the raw cell (point or field) data in a table. Each row represents a unique cell (or point) from the dataset. Like with any other spreadsheet application, you can select a cell (or a point) by simply clicking on the row to select. You can expand the selection using ''Ctrl'', ''Shift'' keys while clicking. If the spreadsheet view is currently showing point attributes, then selecting it will create a point based selection. Similarly, if it is showing cell attributes then it will create a cell based selection. Selection cannot be created when showing field attributes which are not associated with any cell or point.<br />
<br />
All views showing a selected dataset show the selection. The spreadsheet view showing the data from a source selected in the 3D view highlights the corresponding cells/points. Conversely, when creating a selection in the spreadsheet view, the corresponding cell (or point) gets highlighted in all the 3D views showing the source. <br />
<br />
==Select using the Selection Inspector==<br />
[[Image:Selection4.png|thumb|center|600px|'''Figure 6.8''': Location based selection showing the cross hairs used to specify the locations.]]<br />
<br />
Sometimes you may want to tweak the selection or create a new selection with a known set of cell (or point) IDs or create selections based of value of any array or location etc. This is possible using the Selection Inspector.<br />
<br />
Whenever a selection is created in any of the views, it becomes the active selection. The active selection is always shown in the Selection Inspector. For example, if you select cells on the surface of a dataset, then as shown in Figure 6.8, the selection inspector will show indices for the cells selected. <br />
<br />
The selection inspector has three sections: the topmost Current Object and Create Selection are used to choose the source whose output you want to create a selection on. The Active Selection group shows the details of the active selection, if any. The Display Style group makes it possible to change the way the selection in shown in the active 3D view.<br />
<br />
To create a new selection, choose the source whose output needs to be selected in the Current Object combo-box and then hit Create Selection. An empty selection will be created and its properties will be shown in the active selection group. Alternatively, you can use any of the methods described earlier to create a selection; it will still be shown in the selection inspector.<br />
<br />
When you select cells (or points) on the surface or using the spreadsheet view, the selection type is set to IDs. Creating a frustum selection results in a selection with the selection type set to Frustum, while selecting a block in a composite dataset creates a Block selection. Field Type indicates whether cells or points are to be selected. <br />
<br />
In the active selection group, Selection Type indicates the type of the active selection. You can change the type by choosing one of the available options.<br />
<br />
As shown in Figure 6.8 for IDs selection, the inspector lists all the selected cell or point indices. You can edit the list of ids to add or remove values. When connected to a parallel server, cell or point ids are not unique. Hence, you have to additionally specify the process number for each cell or point ID. Process number -1 implies that the cell (or point) at the given index is selected on all processes. For multi-block datasets, you also need to indicate the block to which the cell or point belongs. For AMR datasets, you need to specify the (AMR level, index) pair.<br />
<br />
As shown in Figure 6.6, for Frustum selection, currently only the Show Frustum option is available. When this option is turned on, ParaView shows the selection frustum in the 3D view. In the future, we will implement a 3D widget to modify the frustum.<br />
<br />
As shown in Figure 6.7, for Block selection, the full composite tree is shown in the inspector with the selected blocks checked. <br />
Using the selection inspector you can create a selection based on thresholds for scalars in the dataset. Choose the scalar array and then add value ranges for the selected cells (or points).<br />
<br />
The Selection Inspector can be used to create location-based selection. When field type is CELL, cells at the indicated 3D locations will be selected. When field type is POINT, the point closest to the location within a certain threshold is selected. If Select cells that include the selected points is checked, then all the cells that contain the selected point are selected. It is possible to specify more than one location. To aid in choosing positions, you can turn the Show location widgets option on. As a result, ParaView will show cross hairs in the active 3D view, which can be moved interactively, as shown in Figure 6.6.<br />
<br />
The Selection Inspector also provides a means to create global ID-based selection. These are similar to index based selection however since global IDs are unique across all processes and blocks, you do not need to specify any additional as needed by the ID-based selection.<br />
<br />
=Convert Selections=<br />
<br />
The Selection Inspector can also be used to convert a selection of one type to another. With some valid active selection present, if you change the selection type then ParaView will try to convert the current selection to the new type, still preserving the cells (or points) that were selected, if possible. For example, if you create a frustum-based selection and then change the selection type to IDs, ParaView will determine the indices for all the cells (or points) that lie with the frustum and initialize the new index-based selection with those indices. Note that the number of cells or points that get selected in frustum selection mode can potentially be very large; hence this conversion can be slow and memory expensive. Similarly, if the dataset provides global IDs, then it is possible to convert between IDs selection and global ID-based selection. <br />
i<br />
It is not possible to convert between all types of selections due to obvious reasons. Conversions between ID-based and global ID-based selections, conversions from frustum to ID-based selections, and conversions from frustum to global ID-based selections are supported by the Selection Inspector.<br />
<br />
=Label Selected Cell/Points=<br />
Once an active selection is created, you can label the cells or points or their associated values in a 3D view. This can be done using the Selection Inspector. At the bottom of the selection inspector panel, there are two tabs, Cell Label and Point Label, which can be used to change the cell or point label visibility and other label attributes such color, font etc. These tabs are enabled only if the active view is a 3D view. Any changes made in the Display Style group (including the labels) only affect the active 3D view.<br />
<br />
[[File:ParaView_UsersGuide_LabeledSelection.png|800px]]<br />
<br />
=Extract Selection=<br />
[[Image:Selection5.png|'''Figure 5''': Extract selection using a frustum selection]]<br />
<br />
Selection makes it possible to highlight and observe regions of interest. Oftentimes once a region of interest has been identified, one would like to apply additional operations on it, such as apply filters to only the selected section of the data. This can be achieved using the Extract Selection filter. To set the selection to extract, create a selection using any of the methods already described. Then apply the extract selection filter to the source producing the selected data. To copy the active selection to the filter, use the Copy Active Selection button. One can change the active selection at any time and update the filter to use it by using this button. Figure [5] shows the extract selection filter applied after a frustum selection operation. Now, one can treat this as any other data source and apply filters to it, save state, save data etc.<br />
<br />
=Plot Selection over Time=<br />
[[Image:Selection6.png|thumb|center|600px|'''Figure 6.8''': Plot selection over time.]]<br />
<br />
For time varying datasets, you may want to analyze how the data variables change over time for a particular cell or a point. This can be done using the Plot Selection Over Time filter. This filter is similar to the Extract Selection filter, except that it extracts the selection for all time-steps provided by the data source (typically a reader) and accumulates the values for all the cell (or point) attributes over time. Since the selection can comprise of multiple cells or points, the display tab provides the Select Block widget which can be used to select the cell or point to plot, as shown in Figure [6]. Currently only one cell (or point) can be plotted at once in the same xy-plot view. One can create multiple plot views to show multiple plots simultaneously.</div>Katie.osterdahlhttps://public.kitware.com/Wiki/index.php?title=ParaView/Users_Guide/Selection&diff=40553ParaView/Users Guide/Selection2011-06-10T14:30:57Z<p>Katie.osterdahl: </p>
<hr />
<div>Selection is the mechanism for identifying a subset of a dataset by using user-specified criteria. This subset can be a set of points, cells or a block of composite dataset. This functionality allows users to focus on a smaller subset that is important. For example, the elements of a finite-element mesh that have pressure above a certain threshold can be identified very easily using the threshold selection. Furthermore, this selection can be converted to a set of global element IDs in order to plot the attribute values of those elements over time.<br />
<br />
This section discusses the mechanism for creating selections using Views and Selection Inspector. The following section details another powerful and flexible mechanism of creating selection using queries.<br />
<br />
ParaView supports a single active selection. This selection is associated with a data source (here data source refers to any reader, source or filter) and is shown in every view that displays the data source’s output. This article uses a use-case driven approach to demonstrate how this selection can be described and used. The next section introduces the main GUI components that are used in the article and subsequent sections address different use cases.<br />
<br />
=Selection Inspector=<br />
ParaView provides a selection inspector (referred to simply as the inspector in this article) to inspect and edit the details about the active selection. You can toggle the inspector visibility from the View menu. The inspector can be used to create a new active selection, view/edit the properties of the active selection as well as change the way the selection is displayed in the 3D window e.g. change the color, show labels etc.<br />
<br />
<br />
=Spreadsheet View=<br />
<br />
[[Image:Selection1.png|thumb|center|650px|'''Figure 6.6''' Spreadsheet View in ParaView showing the display tab for a source producing a multi-block dataset. The selected cells are highlighted in the 3D view as well as the spreadsheet view. The active selection can be inspected using the selection inspector.]]<br />
<br />
[[ParaView/Users Guide/Spreadsheet View|Spreadsheet View]] provides data exploration capabilities. One of the common complaints many users have is not being able to look at the raw data directly. Spreadsheet view provides exactly that. It allows the user to look at the raw cell data, point data or field data associated with a dataset. For more details on how to use the Spreadsheet View, please refer to [[ParaView/Users Guide/Spreadsheet View|Spreadsheet View Chapter]].<br />
<br />
=Create a Selection=<br />
<br />
This section covers different ways of creating a selection. <br />
<br />
==Select cells/points on the Surface==<br />
<br />
One of the simplest use-cases is to select cells or points on the surface of the dataset. It is possible to select surface cells by drawing a rubber-band on the 3D view. With the 3D view showing the dataset active, click on Select Cells (or Points) On in the Selection Controls toolbar or under the Edit menu (you can also use the ‘S’ key a shortcut for ‘Select Cells On’). This will put ParaView into a selection mode. In this mode, click and drag over the surface of the dataset in the active view to select the cells (or points) on the surface. If anything was selected, it will be highlighted in all the views showing the data and the source producing the selected dataset will become active in the Pipeline Browser. ParaView supports selecting only one source at a time. Hence, even if you draw the rubber band such that it covers data from multiple sources, only one of them will be selected (the one that has the largest number of selected cells or points).<br />
<br />
As mentioned earlier, when data from a source is selected, all the views displaying the data show the selection. This includes spreadsheet view as well. If the spreadsheet view will show cell or point attributes of the selected data, then it will highlight the corresponding rows. When selecting points, the spreadsheet view will show the selection only if point attributes are being displayed. When selecting cells, it will highlight the cells in the cell attribute mode, and highlight the points forming the cells in the point attribute mode. For any decent sized dataset, it can be a bit tricky to locate the selected rows. In that case, the Show only selected elements on the display tab can be used to hide all the rows that were not selected.<br />
<br />
When selecting cells (or points) on the surface, ParaView determines the cell (or point) IDs for each of the cell (or point) rendered within the selection box. The selection is simply the IDs for cells (or points) thus determined.<br />
<br />
==Select cells/points using a Frustum==<br />
<br />
[[Image:Selection2.png|'''Figure 2''': Selection using a Frustum. Note that all cells that lie within the specified frustum are selected. The selection inspector shows the details of the selection.]]<br />
<br />
This is similar to selecting on the surface except that instead of selecting the cells (or points) on the surface of the dataset, it selects all cells (or points) that lie within the frustum formed by extruding the rectangular rubber band drawn on the view into 3D space. To perform a frustum selection, we use Select Cells (or Points) Through in the Selection Controls toolbar or under the Edit menu. As with surface selection, the selected cells/points are shown in all the views in which the data is shown including the spreadsheet view. Unlike surface selection, the indices of the cells or points are not computed after a frustum selection. Instead ParaView performs intersections to identify the cells (or points) that lie within the frustum. Note that this selection can produce a very large selection. This may be time consuming and can increase the memory usage significantly.<br />
<br />
==Select Blocks in a Composite Dataset==<br />
[[Image:Selection3.png|'''Figure 3''': Selecting a block in multi-block dataset. All the cells in the selected block are highlighted. The selection inspector shows the selected block.]]<br />
<br />
Composite datasets are multi-block or AMR (adaptive mesh refinement) datasets. In case of multi-block datasets, each block may represent different components of a large assembly e.g. tires, chassis etc. for a car dataset. Just like selecting cells or points, it is possible to select entire blocks. To enter the block selection mode use Select Block in the Selection Controls toolbar or under the Edit menu (you can also use the ‘B’ key as a shortcut for Select Block). Once in block selection mode, you can simply click on the block in the 3D view to select a single block or click and drag to select multiple blocks. When a block is selected, its surface cells will be highlighted.<br />
<br />
==Select using the Spreadsheet View==<br />
<br />
Until now we have been looking at defining the selection on the 3D view. Now we will see how to create selections using the spreadsheet view. As we discussed earlier, the spreadsheet view simply shows the raw cell (point or field) data in a table. Each row represents a unique cell (or point) from the dataset. Like with any other spreadsheet application, one can select a cell (or a point) by simply clicking on the row to select. One can expand the selection using Ctrl, Shift keys while clicking. If the spreadsheet view is currently showing point attributes, then selecting on it will create a point based selection. Similarly, if it’s showing cell attributes then it will create a cell based selection. Selection cannot be created when showing field attributes which are not associated with any cell or point.<br />
<br />
We know that all views showing a selected dataset show the selection. The spreadsheet view showing the data from a source selected in the 3D view highlights the corresponding cells/points. Conversely, when we create a selection in the spreadsheet view, the corresponding cell (or point) gets highlighted in all the 3D views showing the source. <br />
<br />
==Select using the Selection Inspector==<br />
[[Image:Selection4.png|'''Figure 4''': Location based selection showing the cross hairs used to specify the locations.]]<br />
<br />
We have seen how to use the different views for creating different types of selections. However, sometimes you may want to tweak the selection or create a new selection with a known set of cell (or point) ids or create selections based of value of any array or location etc. This is possible using the selection inspector.<br />
<br />
Whenever a selection is created in any of the views, it becomes the active selection. The active selection is always shown in the selection inspector. For example, if you select cells on the surface of a dataset, then as shown in Figure [1], the selection inspector will show indices for the cells selected. <br />
<br />
The selection inspector has three sections: the topmost Current Object and Create Selection are used to choose the source whose output you want to create a selection on. The Active Selection group shows the details of the active selection, if any. The Display Style group makes it possible to change the way the selection in shown in the active 3D view.<br />
<br />
To create a new selection, choose the source whose output needs to be selected in the Current Object combo-box and then hit Create Selection. An empty selection will be created and its properties will be shown in the active selection group. Alternatively you can use any of the methods described earlier to create a selection. It will still be shown in the selection inspector.<br />
<br />
When you select cells (or points) on the surface or using the spreadsheet view, the selection type is set to IDs. Creating a frustum selection results in a selection with the selection type set to Frustum, while selecting a block in a composite dataset creates a Block selection. Field Type indicates whether cells or points are to be selected. <br />
<br />
In the active selection group, Selection Type indicates the type of the active selection. One can change the type by choosing one of the available options.<br />
<br />
As shown in Figure [1], for IDs selection, the inspector lists all the selected cell or point indices. You can edit the list of ids to add or remove values. When connected to a parallel server, cell or point ids are not unique. Hence, one has to additionally specify the process number for each cell or point id. Process number -1 implies that the cell (or point) at the given index is selected on all processes. For multi-block datasets, we also need to indicate the block to which the cell or point belongs; while for AMR datasets, we need to specify the (AMR level, index) pair.<br />
<br />
As shown in Figure [2], for Frustum selection, currently only the Show Frustum option is available. When this option is turned on, ParaView shows the selection frustum in the 3D view. In the future, we will implement a 3D widget to modify the frustum.<br />
<br />
As shown in Figure [3], for Block selection, the full composite tree is shown in the inspector with the selected blocks checked. <br />
Using the selection inspector one can create a selection based on thresholds for scalars in the dataset. Choose the scalar array and then add value ranges for the selected cells (or points).<br />
<br />
Selection inspector can be used to create location based selection. When field type is CELL, cells at the indicated 3D locations will be selected. When field type is POINT, the point closest to the location within a certain threshold is selected. If Select cells that include the selected points is checked, then all the cells that contain the selected point are selected. It is possible to specify more than one location. To aid in choosing positions, one can turn the Show location widgets option on. As a result ParaView will show cross hairs in the active 3D view which can be moved interactively, as shown in Figure [4].<br />
<br />
Selection inspector also provides a means to create global id based selection. These are similar to index based selection however since global ids are unique across all processes and blocks, one does not need to specify any additional as needed by the id based selection.<br />
<br />
=Convert Selections=<br />
<br />
Selection inspector can also be used to convert a selection of one type to another. With some valid active selection present, if one changes the selection type then ParaView will try to convert the current selection to the new type, still preserving the cells (or points) that were selected, if possible. For example, if one create a frustum based selection and then changes the selection type to IDs, ParaView will determine the indices for all the cells (or points) that lie with the frustum and initialize the new index based selection with those indices. Note that the number of cells or points that get selected in frustum selection mode can potentially be very large; hence this conversion can be slow and memory expensive. Similarly, if the dataset provides global ids, then it is possible to convert between IDs selection and global id based selection. <br />
<br />
It is not possible to convert between all types of selections due to obvious reasons. Conversions between id based and global id based selections, conversions from frustum to id based selections, and conversions from frustum to global id based selections are supported by the selection inspector.<br />
<br />
=Label Selected Cell/Points=<br />
Once an active selection is created, we can label the cells or points or their associated values in a 3D view. This can be done using the selection inspector. At the bottom of the selection inspector panel, there are two tabs Cell Label and Point Label which can be used to change the cell or point label visibility and other label attributes such color, font etc. These tabs are enabled only if the active view is a 3D view. Any changes done in the Display Style group (including the labels) only affect the active 3D view.<br />
<br />
[[File:ParaView_UsersGuide_LabeledSelection.png|800px]]<br />
<br />
=Extract Selection=<br />
[[Image:Selection5.png|'''Figure 5''': Extract selection using a frustum selection]]<br />
<br />
Selection makes it possible to highlight and observe regions of interest. Oftentimes once a region of interest has been identified, one would like to apply additional operations on it, such as apply filters to only the selected section of the data. This can be achieved using the Extract Selection filter. To set the selection to extract, create a selection using any of the methods already described. Then apply the extract selection filter to the source producing the selected data. To copy the active selection to the filter, use the Copy Active Selection button. One can change the active selection at any time and update the filter to use it by using this button. Figure [5] shows the extract selection filter applied after a frustum selection operation. Now, one can treat this as any other data source and apply filters to it, save state, save data etc.<br />
<br />
=Plot Selection over Time=<br />
[[Image:Selection6.png|'''Figure 6''': Plot selection over time.]]<br />
<br />
For time varying datasets, you may want to analyze how the data variables change over time for a particular cell or a point. This can be done using the Plot Selection Over Time filter. This filter is similar to the Extract Selection filter, except that it extracts the selection for all time-steps provided by the data source (typically a reader) and accumulates the values for all the cell (or point) attributes over time. Since the selection can comprise of multiple cells or points, the display tab provides the Select Block widget which can be used to select the cell or point to plot, as shown in Figure [6]. Currently only one cell (or point) can be plotted at once in the same xy-plot view. One can create multiple plot views to show multiple plots simultaneously.</div>Katie.osterdahlhttps://public.kitware.com/Wiki/index.php?title=ParaView/Users_Guide/Spreadsheet_View&diff=40552ParaView/Users Guide/Spreadsheet View2011-06-10T14:19:01Z<p>Katie.osterdahl: </p>
<hr />
<div>In several cases it is very useful to look at the raw dataset. This is where the Spreadsheet view is particularly useful.<br />
<br />
Spreadsheet View allows users to explore the raw data in a spreadsheet-like display. Users can inspect cells and points and data values associated with these using this view. This makes it a very useful for drilling down into the data.<br />
<br />
Spreadsheet View, as the name suggests, is a view that users can create by splitting the main view frame in the application client-area. Refer to the chapter on Views for details on views. Spreadsheet View can only show one dataset at a time. However, users can use ParaView’s multi-view capabilities to create multiple spreadsheet views for inspecting different datasets.<br />
<br />
[[File:ParaViewUsersGuideSpreadsheetView.png|thumb|center|500px|'''Figure 6.4''' Spreadsheet View]]<br />
=Inspecting Large Datasets=<br />
<br />
Spreadsheet View is a client-only view i.e. it delivers the necessary data to the client when running in client-server mode. Additionally, it is not available through Python scripting (except when running through the Pyhton shell provided by the ParaView application) or batch scripting. Furthermore, when running on a tile-display, the area covered by the spreadsheet on the client simply shows up as a blank region on the tiles.<br />
<br />
Unlike complex views like the 3D render view that can generate the renderings on the server and simply deliver images to the client, the spreadsheet view requires that the data is available on the client. This can be impractical when inspecting large datasets since the client may not even have enough memory, even if infinite bandwidth is assumed. To address such issues, the Spreadsheet View streams the data to the client, only fetching the data for the row currently visible in the viewport.<br />
<br />
=Double Precision=<br />
<br />
Using the precision spin-box in the view header, users can control the precision for floating point numbers. The value determines the number of significant digits after the decimal point.<br />
<br />
=Selection with Spreadsheet View=<br />
<br />
Spreadsheet view, in many ways, behaves like typical spreadsheet applications. You can scroll, select rows using mouse clicks, arrow keys and modifiers like Shift and Ctrl keys, or sort columns by clicking on the header. Additionally, you can double-click on a column header to toggle the maximization of a column for better readability.<br />
<br />
On selecting rows the corresponding cells or points will get selected and ParaView will highlight those in other views, such as the 3D view. Conversely, when you make a selection in the 3D View or the chart views, one of the rows corresponding to the selected cells/points will be highlighted in the spreadsheet view. Of course, for the view to highlight the selection, the selected dataset must be the one that is being shown in the spreadsheet view. To make it easier to inspect just the selected elements, you check the “Show only selected” button on the view header.<br />
<br />
When in “Show only Selected” mode, you can no longer create selections on the spreadsheet view. You have to use the other views to make the selection and the spreadsheet view will automatically update to show the details for the items that got selected.<br />
<br />
Spreadsheet view can show data associated with cells, points or even field data. To choose what attribute the view shows, you can use the attribute-type combo-box. The selection created by the view depends on the attribute-type, i.e. if a user selects in the view when attribute type is “Points”, points in the dataset will be selected. The spreadsheet view also performs selection conversions if possible, i.e. if you select a cell in the 3D view, but spreadsheet view is setup to show points, then the view will highlight the points that form the selected cell.<br />
<br />
The spreadsheet view may add several additional data columns that may not be present in the actual data. These data columns are either derived information such as the (i, j, k) coordinates for structured data or provide additional information about the data, e.g. block index for composite datasets, or provide additional information about the data distribution such as process-id when connected to a parallel server (pvserver or pvdataserver).<br />
<br />
=Working with Composite Datasets=<br />
<br />
[[Image:ParaViewUsersGuideSpreadsheetView2.png|thumb|left|200px|'''Figure 6.5''' Display tab showing widget to select the block to display]]<br />
<br />
Spreadsheet view works seamlessly with different kinds of dataset types including composite datasets such as multi-block datasets or AMR datasets. When dealing with composite datasets, the view shows one block at a time. Users can choose the block to inspect by using the display tab.</div>Katie.osterdahlhttps://public.kitware.com/Wiki/index.php?title=ParaView/Users_Guide/Python_Calculator&diff=40550ParaView/Users Guide/Python Calculator2011-06-10T14:10:51Z<p>Katie.osterdahl: </p>
<hr />
<div>== Introduction ==<br />
<br />
[[Image:ParaView_UG_Python_calculator.png|thumb|left|400px|'''Figure 6.3''']]<br />
<br />
The Python Calculator is a ParaView filter that processes one or more input arrays based on an expression provided by the user to produce a new output array. The parameters of the filter include the expression, the association of the output array (Point or Cell Data), the name of output array and a toggle that controls whether the input arrays are copied to the output. This section introduces the use of the Python Calculator and provides a list of functions available to the user.<br />
<br />
Note that the Python Calculator depends on Python and NumPy. All ParaView binaries distributed by Kitware are built with these to enable the calculator. If you have built ParaView yourself, you have to make sure that NumPy is installed and that PARAVIEW_ENABLE_PYTHON is turned on when configuring the ParaView build.<br />
<br />
== Basic Tutorial ==<br />
<br />
Start by creating a Sphere source and applying the Python Calculator to it. As the first expression, use the following and apply:<br />
<br />
<source lang="python"><br />
5<br />
</source><br />
<br />
This should create an array name "result" in the output point data. Note that this is an array that has a value of 5 for each point. When the expression results in a single value, the calculator will automatically make a constant array. Next, try the following:<br />
<br />
<source lang="python"><br />
Normals<br />
</source><br />
<br />
Now the "result" array should be the same as the input array Normals. As described in detail later, various functions are available through the calculator. For example, the following is a valid expression.<br />
<br />
<source lang="python"><br />
sin(Normals) + 5<br />
</source><br />
<br />
It is very important to note that the Python Calculator has to produce one value per point or cell depending on the Array Association parameter. Most of the functions described here apply individually to all point or cell values and produce an array the same dimensions as the input. However, some of them (such as min() and max()) produce single values.<br />
<br />
== Accessing Data ==<br />
<br />
There are several ways of accessing input arrays within expressions. The simplest way is to access it by name:<br />
<br />
<source lang="python"><br />
sin(Normals) + 5<br />
</source><br />
<br />
This is equivalent to:<br />
<br />
<source lang="python"><br />
sin(inputs[0].PointData['Normals']) + 5<br />
</source><br />
<br />
The example above requires some explanation. Here inputs[0] refer to the first input (dataset) to the filter. Python Calculator can accept multiple inputs. Each input can be accessed as inputs[0], inputs[1], ... You can access the point or cell data of an input using the .PointData or .CellData qualifiers. You can then access individual arrays within the point or cell data containers using the [] operator. Make sure to use quotes or double-quotes around the array name. Arrays that have names with certain characters (such as space, +, -, *, /) in their name can only be accessed using this method.<br />
<br />
Certain functions apply directly on the input mesh. These filters expect an input dataset as argument. For example, <br />
<br />
<source lang="python"><br />
area(inputs[0])<br />
</source><br />
<br />
For data types that explicitly define the point coordinates, you can access the coordinates array using the .Points qualifier. The following extracts the first component of the coordinates array:<br />
<br />
<source lang="python"><br />
inputs[0].Points[:,0]<br />
</source><br />
<br />
Note that certain data types, mainly image data (uniform rectilinear grid) and rectilinear grid, point coordinates are defined implicitly and cannot be accessed as an array.<br />
<br />
== Comparing Multiple Datasets ==<br />
<br />
As described previously, the Python Calculator can accept multiple inputs. Using this functionality, you can compare multiple datasets. There are a few things to note:<br />
<br />
* Python Calculator will always copy the mesh from the first input to its output.<br />
* All operations are applied point by point. In most cases, this requires that the input meshes (topology and geometry) are the same. At the least, it requires the the inputs have the same number of points or cells.<br />
* In parallel execution mode, the inputs have to be distributed exactly the same way across processes.<br />
<br />
For example, to compare the temperature of two datasets, you can select both inputs, apply the Python Calculator and then use the following expression.<br />
<br />
<source lang="python"><br />
inputs[0].PointData['temperature'] - inputs[1].PointData['temperature']<br />
</source><br />
<br />
== Basic Operations ==<br />
<br />
The Python calculator supports all of the basic arithmetic operations using the +, -, * and / operators. These are always applied element-by-element to point and cell data including scalars, vectors and tensors. These operations also work with single values. For example, the following adds 5 to all components of all Normals.<br />
<br />
<source lang="python"><br />
Normals + 5<br />
</source><br />
<br />
The following adds 1 to the first component, 2 to the second component and 3 to the third component:<br />
<br />
<source lang="python"><br />
Normals + [1,2,3]<br />
</source><br />
<br />
This is specially useful when mixing functions that return single values. For example, the following normalizes the Normals array:<br />
<br />
<source lang="python"><br />
(Normals - min(Normals))/(max(Normals) - min(Normals))<br />
</source><br />
<br />
A common use case in a calculator is to work on one component of an array. This can be accomplished with the following:<br />
<br />
<source lang="python"><br />
Normals[:, 0]<br />
</source><br />
<br />
The expression above extracts the first component of the Normals vector. Here, : is a placeholder for "all elements". One element can be extracted by replacing : with an index. For example, the following creates a constant array from the first component of the normal of the first point:<br />
<br />
<source lang="python"><br />
Normals[0, 0]<br />
</source><br />
<br />
Whereas the following assigns the normal of the first point to all points:<br />
<br />
<source lang="python"><br />
Normals[0, :]<br />
</source><br />
<br />
It is also possible to merge multiple scalars into an array using the hstack() function:<br />
<br />
<source lang="python"><br />
hstack([velocity_x, velocity_y, velocity_z])<br />
</source><br />
<br />
Note the use of square brackets ([]).<br />
<br />
Under the cover, the Python Calculator uses NumPy. All arrays in the expression are compatible with NumPy arrays and can be used where NumPy arrays can be used. For more information on what you can do with these arrays, consult with the NumPy book, which can be downloaded [http://www.tramy.us/guidetoscipy.html here].<br />
<br />
== Functions ==<br />
<br />
The following is a list of functions available in the Python Calculator. Note that this list is partial since most of the NumPy and SciPy functions can be used in the Python Calculator. Many of these functions can take single values or arrays as argument.<br />
<br />
'''abs (x) :''' Returns the absolute value(s) of x.<br />
<br />
'''add (x, y):''' Returns the sum of two values. x and y can be single values or arrays. Same as x+y.<br />
<br />
'''area (dataset) :''' Returns the surface area of each cell in a mesh.<br />
<br />
'''aspect (dataset) :''' Returns the aspect ratio of each cell in a mesh.<br />
<br />
'''aspect_gamma (dataset) :''' Returns the aspect ratio gamma of each cell in a mesh.<br />
<br />
'''condition (dataset) :''' Returns the condition number of each cell in a mesh.<br />
<br />
'''cross (x, y) :''' Returns the cross product for two 3D vectors from two arrays of 3D vectors.<br />
<br />
'''curl (array):''' Returns the curl of an array of 3D vectors.<br />
<br />
'''divergence (array):''' Returns the divergence of an array of 3D vectors.<br />
<br />
'''divide (x, y):''' Element by element division. x and y can be single values or arrays. Same as x/y.<br />
<br />
'''det (array) :''' Returns the determinant of an array of 2D square matrices.<br />
<br />
'''determinant (array) :''' Returns the determinant of an array of 2D square matrices.<br />
<br />
'''diagonal (dataset) :''' Returns the diagonal length of each cell in a dataset.<br />
<br />
'''dot (a1, a2):''' Returns the dot product of two scalars/vectors of two array of scalars/vectors.<br />
<br />
'''eigenvalue (array) :''' Returns the eigenvalue of an array of 2D square matrices.<br />
<br />
'''eigenvector (array) :''' Returns the eigenvector of an array of 2D square matrices.<br />
<br />
'''exp (x):''' Returns power(e, x).<br />
<br />
'''global_max(array):''' Returns the maximum value of an array of scalars/vectors/tensors among all process. Not yet supported for multi-block and AMR datasets.<br />
<br />
'''global_mean (array) :''' Returns the mean value of an array of scalars/vectors/tensors among all process. Not yet supported for multi-block and AMR datasets.<br />
<br />
'''global_min(array):''' Returns the minimum value of an array of scalars/vectors/tensors among all process. Not yet supported for multi-block and AMR datasets.<br />
<br />
'''gradient(array):''' Returns the gradient of an array of scalars/vectors.<br />
<br />
'''inv (array) :''' Returns the inverse an array of 2D square matrices.<br />
<br />
'''inverse (array) :''' Returns the inverse of an array of 2D square matrices.<br />
<br />
'''jacobian (dataset) :''' Returns the jacobian of an array of 2D square matrices.<br />
<br />
'''laplacian (array) :''' Returns the jacobian of an array of scalars.<br />
<br />
'''ln (array) :''' Returns the natural logarithm of an array of scalars/vectors/tensors.<br />
<br />
'''log (array) :''' Returns the natural logarithm of an array of scalars/vectors/tensors.<br />
<br />
'''log10 (array) :''' Returns the base 10 logarithm of an array of scalars/vectors/tensors.<br />
<br />
'''max (array):''' Returns the maximum value of the array as a single value. Note that this function returns the maximum within a block for AMR and multi-block datasets, not across blocks/grids. Also, this returns the maximum within each process when running in parallel.<br />
<br />
'''max_angle (dataset) :''' Returns the maximum angle of each cell in a dataset.<br />
<br />
'''mag (a) :''' Returns the magnigude of an array of scalars/vectors.<br />
<br />
'''mean (array) :''' Returns the mean value of an array of scalars/vectors/tensors.<br />
<br />
'''min (array) :''' Returns the minimum value of the array as a single value. Note that this function returns the minimum within a block for AMR and multi-block datasets, not across blocks/grids. Also, this returns the minimum within each process when running in parallel.<br />
<br />
'''min_angle (dataset) :''' Returns the minimum angle of each cell in a dataset.<br />
<br />
'''mod (x, y):''' Same as remainder (x, y).<br />
<br />
'''multiply (x, y):''' Returns the product of x and y. x and y can be single values or arrays. Note that this is an element by element operation when x and y are both arrays. Same as x * y.<br />
<br />
'''negative (x):''' Same as -x.<br />
<br />
'''norm (a) :''' Returns the normalized values of an array of scalars/vectors.<br />
<br />
'''power (x, a):''' Exponentiation of x with a. Here both x and a can either be a single value or an array. If x and y are both arrays, a one-by-one mapping is used between two arrays.<br />
<br />
'''reciprocal (x):''' Returns 1/x.<br />
<br />
'''remainder (x, y):''' Returns x − y*floor(x/y). x and y can be single values or arrays.<br />
<br />
'''rint (x):''' Rounds x to the nearest integer(s).<br />
<br />
'''shear (dataset) :''' Returns the shear of each cell in a dataset.<br />
<br />
'''skew (dataset) :''' Returns the skew of each cell in a dataset.<br />
<br />
'''square (x):''' Returns x*x.<br />
<br />
'''sqrt (x):''' Returns square root of x.<br />
<br />
'''strain (array) :''' Returns the strain of an array of 3D vectors.<br />
<br />
'''subtract (x, y):''' Returns the difference between two values. x and y can be single values or arrays. Same as x - y.<br />
<br />
'''surface_normal (dataset) :''' Returns the surface normal of each cell in a dataset.<br />
<br />
'''trace (array) :''' Returns the trace of an array of 2D square matrices.<br />
<br />
'''volume (dataset) :''' Returns the volume normal of each cell in a dataset.<br />
<br />
'''vorticity(array):''' Returns the vorticity/curl of an array of 3D vectors.<br />
<br />
'''vertex_normal (dataset) :''' Returns the vertex normal of each point in a dataset.<br />
<br />
== Trigonometric Functions ==<br />
<br />
Below is a list of supported triginometric functions.<br />
<br />
'''sin (x)'''<br />
<br />
'''cos (x)'''<br />
<br />
'''tan (x)'''<br />
<br />
'''arcsin (x)'''<br />
<br />
'''arccos (x)'''<br />
<br />
'''arctan (x)'''<br />
<br />
'''hypot (x1, x2)'''<br />
<br />
'''sinh(x)'''<br />
<br />
'''cosh (x)'''<br />
<br />
'''tanh (x)'''<br />
<br />
'''arcsinh (x)'''<br />
<br />
'''arccosh (x)'''<br />
<br />
'''arctanh (x)'''</div>Katie.osterdahlhttps://public.kitware.com/Wiki/index.php?title=ParaView/Users_Guide/Calculator&diff=40549ParaView/Users Guide/Calculator2011-06-10T14:01:07Z<p>Katie.osterdahl: </p>
<hr />
<div>[[Image:ParaView_UG_Calculator.png|thumb|300px|'''Figure 6.2''' ]]<br />
<br />
== Basics == <br />
<br />
The Calculator Filter can be use to calculate derived quantities from existing attributes. The main parameter of the Calculator is an expression that describes how to calculate the derived quantity. You can enter this expression as free-form text or using some of the shortcuts (buttons and menus provided). There are some "hidden" expressions for which there are no buttons. Operands that are accessible only by typing in the function name include:<br />
*min(expr1, expr2) Returns the lesser of the two scalar expressions<br />
*max(expr1, expr2) Returns the greater of the two scalar expressions<br />
*cross(expr1, expr2) Returns the vector cross product of the two vector expressions<br />
* sign(expr) Returns -1, 0 or 1 depending if the scalar expression is less than, equal to or greater than zero respectively<br />
* if(condition,true_expression,false_expression) Evaluates the conditional expression and then evaluates and returns one of the two expressions<br />
* '''>''' Numerical "greater than" conditional test<br />
* '''<''' Numerical "less than" conditional test<br />
* '''=''' Numerical "equal to" conditional test<br />
* '''&''' Boolean "and" test conjunction<br />
* '''|''' Boolean "or" test conjunction<br />
<br />
<br />
'''Note:''' It is recommended that you use the Python Calculator instead of Calculator if possible. The Python Calculator is more flexible, has more functions and is more efficient. However, it requires that ParaView is compiled with Python support and that NumPy is installed.<br />
<br />
Create a Wavelet source and then apply the Calculator using "1" as the expression. '''Note:''' You can enter an expression by clicking in the expression entry box and typing. This should create a point array called "Result" in the output. A few things to note:<br />
<br />
* The Calculator copies the input mesh to the output. It is possible to have the calculator change the point coordinates, which is discussed.<br />
* The expression is calculated for each element in the output point or cell data (depending on the Attribute Mode).<br />
<br />
Next, change the expression to be "5 * RTData" and the Result Array Name to be "5 times rtdata" (without the quotes). If you change to surface representation and color by the new array, you will notice that the filter calculated "5 * RTData" at each point. <br />
<br />
The main use case for the Calculator is to utilize one or more input arrays to calculate derived quantities. The Calculator can either work on point centered attributes or cell centered attributes (but not both). In order to help enter the names of the input arrays, the Calculator provides two menus accessible through the "Scalars" and "Vectors" buttons. If you select an array name from either menus, it will be inserted to the expression entry box at the cursor location. You can also use the other buttons to enter any of the functions available to the Calculator. <br />
<br />
== Working with Vectors ==<br />
<br />
To start with an example, create a Wavelet source then apply the Random Vectors filter. Next, apply the Calculator. Now look at the Scalars and Vectors menus on the Object Inspector panel. You will notice that BrownianVectors shows up under Vectors, whereas BrownianVectors_X, _Y and _Z show up under scalars. The Calculator allows access to individual components of vectors using this naming convention. So if you use BrownianVectors_X as the expression, the Calculator will extract the first component of the BrownianVectors attribute. All of the Calculator's functions are applicable to vectors. Most of these functions treat the vector attributes the same as scalars, mainly applying the same functions to all components of all elements. However, the following functions work only on vectors:<br />
<br />
* '''v1 . v2''' : Dot product of two vectors. Returns a scalar.<br />
* '''norm''' : Creates a new array that contains normalized versions of the input vectors.<br />
* '''mag''' : Returns the magnitude of input vectors.<br />
<br />
You may have noticed that four calculator buttons on the Object Inspector are not actually functions. Clear is straightforward. It cleans the expression entry box. iHat, jHat and kHat on the other hand are not as clear. These represent unit vectors in X, Y and Z directions. They can be used to construct vectors from scalars. Take for example the case where you want to set the Z component of BrownianVectors from the previous example to 0. The expression to do that is "BrownianVectors_X *iHat+BrownianVectors_Y*jHat+0*kHat". This expression multiplies the X unit vector with the X component of the input vector, the Y unit vector with the Y component, and the Z unit vector with 0 and add them together. You can use this sort of expression to create vectors from individual components of a vector if the reader loaded them separately, for example. '''Note:''' You did not really need the 0*kHat bit, which was for demonstration.<br />
<br />
== Working with Point Coordinates ==<br />
<br />
You may have noticed that one point-centered vector and its three components are always available in the Calculator. This vector is called "coords" and represents the point coordinates. You can use this array in your expression like any other array. For instance, in the previous example you could use "mag(coords)*RTData" to scale RTData with the distance of the point to the origin.<br />
<br />
It is also possible to change the coordinates of the mesh by checking the "Coordinate Results" box. Note that this does not work for rectilinear grids (uniform and non-uniform) since their point coordinates cannot be adjusted one-by-one. Since the previous examples used a uniform rectilinear grid, you cannot use them. Instead, start with the Sphere source, then use this expression: "coords+2*iHat". Make sure to check he "Coordinate Results" box. The output of the Calculator should be a shifted version of the input sphere.<br />
<br />
== Dealing with Invalid Results ==<br />
<br />
Certain functions are not applicable to certain arguments. For example, sqrt() works only on positive numbers since the calculator does not support complex numbers. Unless the "Replace invalid results" option is turned on, an expression that tries to evaluate the square root of a negative number will return an error such as this:<br />
<br />
ERROR: In /Users/berk/Work/ParaView/git/VTK/Common/vtkFunctionParser.cxx, line 697<br />
vtkFunctionParser (0x128d97730): Trying to take a square root of a negative value<br />
<br />
However, if you turn on the "Replace invalid results" option, the calculator will silently replace the result of the invalid expression with the value specified in "Replacement value". Note that this will happen only when the expression result is an invalid result so some of the output points (or cells) may have the Replacement Value whereas others may have valid results.</div>Katie.osterdahlhttps://public.kitware.com/Wiki/index.php?title=ParaView/Users_Guide/Python_Programmable_Filter&diff=40533ParaView/Users Guide/Python Programmable Filter2011-06-09T17:54:13Z<p>Katie.osterdahl: </p>
<hr />
<div>== Introduction ==<br />
<br />
[[Image:ParaView_UG_ProgrammableFilter.png|thumb|400px|left|'''Figure 6.1''']]<br />
<br />
The Programmable Filter is a ParaView filter that processes one or more input datasets based on a Python script provided by the user. The parameters of the filter include the output data type, the script and a toggle that controls whether the input arrays are copied to the output. This chapter introduces the use of the Programmable Filter and gives a summary of the API available to the user. <br />
<br />
Note that the Programmable Filter depends on Python. All ParaView binaries distributed by Kitware are built with Python enabled. If you have built ParaView yourself, you have to make sure that PARAVIEW_ENABLE_PYTHON is turned on when configuring the ParaView build.<br />
<br />
Since the entire VTK API as well as any module that can be imported through Python is available through this filter, we can only skim the surface of what can be accomplished with this filter here. If you are not familiar with Python, we recommend first taking a look at one of the introductory guides such as the [http://docs.python.org/tutorial/ official Python Tutorial]. If you are going to do any programming beyond the very basics, we recommend reading up on the VTK API. [http://www.vtk.org The VTK website] has links to VTK books and online documentation. For reference, you may need to look at the [http://www.vtk.org/doc/release/5.6/html/ VTK class documentation]. There is also more information about the Programmable Filter and some good recipes on the ParaView Wiki ([[Python_Programmable_Filter]]).<br />
<br />
== Basic Use ==<br />
<br />
Requirements: <br />
# You are applying Programmable Filter to a "simple" dataset and not a composite dataset such as multi-block or AMR.<br />
# You have NumPy installed.<br />
<br />
The most basic reason to use the Programmable Filter is to add a new array by deriving it from arrays in the input, which can also be achieved by using the Python Calculator. One reason to use the Programmable Filter instead may be that the calculation is more involved and trying to do it in one expression may be difficult. Another reason may be that you need access to a program flow construct such as if or for. The Programmable Filter can be used to do everything the Calculator does and more.<br />
<br />
'''Note:''' Since what is described here builds on some of the concepts introduced in the [[ParaView/Users_Guide/Python_Calculator | Python Calculator section]], please read it first if you are not familiar with the Calculator.<br />
<br />
If you leave the "Output Dataset Type" parameter in the default setting of "Same as Input," the Programmable Filter will copy the topology and geometry of the input to the output before calling your Python script. Therefore, if you Apply the filter without filling the script, you should see a copy of the input without any of its arrays in the output. If you also check the Copy Arrays option, the output will have all of the input arrays. This behavior allows you to focus on creating new arrays without worrying about the mesh.<br />
<br />
Create a Sphere source and then apply the Programmable Filter and use the following script.<br />
<br />
<source lang="python"><br />
normals = inputs[0].PointData['Normals']<br />
output.PointData.append(normals[:,0], "Normals_x")<br />
</source><br />
<br />
This should create a sphere with an array called "Normals_x". There a few things to note here:<br />
<br />
* You cannot refer to arrays directly by name as in the Python Calculator. You need to access arrays using the .PointData and .CellData qualifiers.<br />
* Unlike the Python Calculator, you have to explicitly add an array to the output using the append function. Note that this function takes the name of the array as the second argument.<br />
<br />
You can use any of the functions available in the Calculator in the Programmable Filter. For example, the following code creates two new arrays and adds them to the output.<br />
<br />
<source lang="python"><br />
normals = inputs[0].PointData['Normals']<br />
output.PointData.append(sin(normals[:,0]), "sin of Normals_x")<br />
output.PointData.append(normals[:,1] + 1, "Normals_y + 1")<br />
</source><br />
<br />
== Intermediate Use ==<br />
<br />
=== Mixing VTK and NumPy APIs ===<br />
<br />
The previous examples demonstrate how the Programmable Filter can be used as an advanced Python Calculator. However, the full power of the Programmable Filter can only be harnessed by using the VTK API. The following is a simple example. Create a Sphere source and apply the Programmable Filter with the following script.<br />
<br />
<source lang="python"><br />
input = inputs[0]<br />
<br />
newPoints = vtk.vtkPoints()<br />
numPoints = input.GetNumberOfPoints()<br />
for i in range(numPoints):<br />
x, y, z = input.GetPoint(i)<br />
newPoints.InsertPoint(i, x, y, 1 + z*0.3)<br />
<br />
output.SetPoints(newPoints)<br />
</source><br />
<br />
Start with creating a new instance of vtkPoints:<br />
<br />
<source lang="python"><br />
newPoints = vtk.vtkPoints()<br />
</source><br />
<br />
vtkPoints is a data structure that VTK uses to store the coordinates of points. Next, loop over all points of the input and insert a new point in the output with coordinates (x, y, 1+z*0.3)<br />
<br />
<source lang="python"><br />
for i in range(numPoints):<br />
x, y, z = input.GetPoint(i)<br />
newPoints.InsertPoint(i, x, y, 1 + z*0.3)<br />
</source><br />
<br />
Finally, replace the output points with the new points we created using the following:<br />
<br />
<source lang="python"><br />
output.SetPoints(newPoints)<br />
</source><br />
<br />
'''Note:''' Python is an interpreted language and Python scripts do not execute as efficiently as compiled C++ code. Therefore, using a for loop that iterates over all points or cells may be a significant bottleneck when processing large datasets.<br />
<br />
The NumPy and VTK APIs can be mixed to achieve good performance. Even though this may seem a bit complicated at first, it can be used with great effect. For instance, the example above can be rewritten as follows.<br />
<br />
<source lang="python"><br />
from paraview.vtk.dataset_adapter import numpyTovtkDataArray<br />
<br />
input = inputs[0]<br />
<br />
newPoints = vtk.vtkPoints()<br />
<br />
zs = 1 + input.Points[:,2]*0.3<br />
coords = hstack([input.Points[:,0:2],zs])<br />
<br />
newPoints.SetData(numpyTovtkDataArray(coords))<br />
<br />
output.SetPoints(newPoints)<br />
</source><br />
<br />
Even though this produces exactly the same result, it is much more efficient because the for loop was moved it from Python to C. Under the hood, NumPy uses C and Fortran for tight loops.<br />
<br />
If you read the Python Calculator documentation, this example is straightforward except the use of numpyTovtkDataArray(). First, note that you are mixing two APIs here: the VTK API and NumPy. VTK and NumPy uses different types of objects to represents arrays. The basic examples previously used carefully hide this from you. However, once you start manipulating VTK objects using NumPy, you have to start converting objects between two APIs. Note that for the most part this conversion happens without "deep copying" arrays, for example copying the raw contents from one memory location to another. Rather, pointers are passed between VTK and NumPy whenever possible.<br />
<br />
The dataset_adapter provides two methods to do the conversions described above:<br />
<br />
* vtkDataArrayToVTKArray: This function creates a NumPy compatible array from a vtkDataArray. Note that VTKArray is actually a subclass of numpy.matrix and can be used anywhere matrix can be used. This function always copies the pointer and not the contents. '''Important:''' You should not directly change the values of the resulting array if the argument is an array from the input.<br />
* numpyTovtkDataArray: Converts a NumPy array (or a VTKArray) to a vtkDataArray. This function copies the pointer if the argument is a contiguous array. There are various ways of creating discontinuous arrays with NumPy including using hstack and striding. See NumPy documentation for details.<br />
<br />
=== Multiple Inputs ===<br />
<br />
Like the Python Calculator, the Programmable Filter can accept multiple inputs. First, select two or more pipeline objects in the pipeline browser and then apply the Programmable Filter. Then each input can be accessed using the inputs[] variable. Note that if the Output Dataset Type is set to Same as Input, the filter will copy the mesh from the first input to the output. If Copy Arrays is on, it will also copy arrays from the first input. As an example, the following script compares the Pressure attribute from two inputs using the difference operator.<br />
<br />
<source lang="python"><br />
output.append(inputs[1].PointData['Pressure'] - inputs[0].PointData['Pressure'], "difference")<br />
</source><br />
<br />
=== Dealing with Composite Datasets ===<br />
<br />
Thus far, none of the examples used apply to multi-block or AMR datasets. When talking about the Python Calculator, you did not have to differentiate between simple and composite datasets. This is because the calculator loops over all of the leaf blocks of composite datasets and applies the expression to each one. Therefore, inputs in an expression are guaranteed to be simple datasets. On the other hand, the Programmable Filter does not perform this iteration and passes the input, composite or simple, as it is to the script. Even though this makes basic scripting harder for composite datasets, it provides enormous flexibility.<br />
<br />
To work with composite datasets you need to know how to iterate over them to access the leaf nodes. <br />
<br />
<source lang="python"><br />
for block in inputs[0]:<br />
print block<br />
</source><br />
<br />
Here you iterate over all of the non-NULL leaf nodes (i.e. simple datasets) of the input and print them to the Output Messages console. Note that this will work only if the input is multi-block or AMR.<br />
<br />
When Output Dataset Type is set to "Same as Input," the Programmable Filter will copy composite dataset to the output - it will copy only the mesh unless Copy Arrays is on. Therefore, you can also iterate over the output. A simple trick is to turn on Copy Arrays and then use the arrays from the output when generating new ones. Below is an example. You should use the can.ex2 file from the ParaView testing dataset collection.<br />
<br />
<source lang="python"><br />
def process_block(block):<br />
displ = block.PointData['DISPL']<br />
block.PointData.append(displ[:,0], "displ_x")<br />
<br />
for block in output:<br />
process_block(block)<br />
</source><br />
<br />
Alternatively, you can use the MultiCompositeDataIterator to iterate over the input and output block simultaneously. The following is equivalent to the previous example:<br />
<br />
<source lang="python"><br />
def process_block(input_block, output_block):<br />
displ = input_block.PointData['DISPL']<br />
output_block.PointData.append(displ[:,0], "displ_x")<br />
<br />
from paraview.vtk.dataset_adapter import MultiCompositeDataIterator<br />
iter = MultiCompositeDataIterator([inputs[0], output])<br />
<br />
for input_block, output_block in iter:<br />
process_block(input_block, output_block)<br />
</source><br />
<br />
== Advanced ==<br />
<br />
=== Changing Output Type ===<br />
<br />
Thus far, all of the examples discussed depended on the output type being the same as input and that the Programmable Filter copied the input mesh to the output. If you set the output type to something other than Same as Input, the Programmable Filter will create an empty output of the type we specified but will not copy any information. Even though it may be more work, this provides a lot of flexibility. Since this is approaching the realm of VTK filter authoring, a very simple example is used. If you are already familiar with VTK API, you will realize that this is a great way of prototyping VTK filters. If you are not, reading up on VTK is recommended. <br />
<br />
Create a Wavelet source, apply a Programmable Filter, set the output type to vtkTable and use the following script:<br />
<br />
<source lang="python"><br />
rtdata = inputs[0].PointData['RTData']<br />
<br />
output.RowData.append(min(rtdata), 'min')<br />
output.RowData.append(max(rtdata), 'max')<br />
</source><br />
<br />
Here, you added two columns to the output table. The first one has one value - minimum of RTData - and the second one has the maximum of RTData. When you apply this filter, the output should automatically be shown in a Spreadsheet view. You could also use this sort of script to chart part of the input data. For example, the output of the following script can be display as a line chart.<br />
<br />
<source lang="python"><br />
rtdata = inputs[0].PointData['RTData']<br />
output.RowData.append(rtdata, 'rtdata')<br />
</source><br />
<br />
Changing the output type is also often necessary when using VTK filters within the script, which is demonstrated in the following section.<br />
<br />
=== Dealing with Structured Data Output ===<br />
<br />
A curvilinear gris, for instance a bluntfin.vts from the ParaView testing data, is used as a good example. If you would like to volume render a subset of this grid, since as of 3.10, ParaView does not support volume rendering of curvilinear grids, you have two choices:<br />
<br />
* Resample to an image data<br />
* Convert to unstructured grid<br />
This example demonstrates how to resample to image data using the Programmable Filter. This can be accomplished using the Resample with Dataset filter, but it is a good example nevertheless. Start with loading bluntfin.vts, then apply the Programmable Filter. Make sure to set the output type to vtkImageData. Here is the script:<br />
<br />
<source lang="python"><br />
pinput = vtk.vtkImageData()<br />
pinput.SetExtent(0, 10, 0, 10, 0, 10)<br />
pinput.SetOrigin(0, 1, 0)<br />
pinput.SetSpacing(0.5, 0.5, 0.5)<br />
<br />
probe = vtk.vtkProbeFilter()<br />
probe.SetInput(pinput)<br />
<br />
input_copy = inputs[0].NewInstance()<br />
input_copy.UnRegister(None)<br />
input_copy.ShallowCopy(inputs[0].VTKObject)<br />
<br />
probe.SetSource(input_copy)<br />
probe.Update()<br />
<br />
output.ShallowCopy(probe.GetOutput())<br />
</source><br />
<br />
'''Note:''' See the next section for details about using a VTK filter within the Programmable Filter.<br />
<br />
If you already applied, you may notice that the output looks much bigger than it should be because an important piece is missing. You need to use the following as the RequestInformation script:<br />
<br />
<source lang="python"><br />
from paraview.util import SetOutputWholeExtent<br />
<br />
SetOutputWholeExtent(self, [0, 10, 0, 10, 0, 10])<br />
</source><br />
<br />
VTK expects that all data sources and filters that produce structured data (rectilinear or curvilinear grids) to provide meta data about the logical extents of the output dataset before full execution. Thus the RequestInformation is called by the Programmable Filter before execution and is where you should provide this meta data. This is not required if the filter is simply copying the mesh as the meta data would have been provided by another pipeline object upstream. However, if you are using the Programmable Filter to produce a structured data with a different mesh than the input, you need to provide this information.<br />
<br />
The RequestUpdateExtent script can be used to augment the request that propagates upstream before execution. This is used to ask for a specific data extent, for example. This is an advanced concept and is not discussed further here.<br />
<br />
=== Using VTK Filters with Programmable Filter ===<br />
<br />
The previous example demonstrated how you can use a VTK filter (vtkProbeFilter in this case) from with the Programmable Filter. We will explain that example in more detail here. <br />
<br />
<source lang="python"><br />
pinput = vtk.vtkImageData()<br />
pinput.SetExtent(0, 10, 0, 10, 0, 10)<br />
pinput.SetOrigin(0, 1, 0)<br />
pinput.SetSpacing(0.5, 0.5, 0.5)<br />
<br />
probe = vtk.vtkProbeFilter()<br />
probe.SetInput(pinput)<br />
<br />
input_copy = inputs[0].NewInstance()<br />
input_copy.UnRegister(None)<br />
input_copy.ShallowCopy(inputs[0].VTKObject)<br />
<br />
probe.SetSource(input_copy)<br />
probe.Update()<br />
<br />
output.ShallowCopy(probe.GetOutput())<br />
</source><br />
<br />
There are two important tricks to use a VTK filter from another VTK filter. First, do not directly set the input to the outer filter as the input of the inner filter. (It is difficult to explain why without getting into VTK pipeline mechanics). Instead, make a shallow copy as follows:<br />
<br />
<source lang="python"><br />
input_copy = inputs[0].NewInstance()<br />
input_copy.UnRegister(None)<br />
input_copy.ShallowCopy(inputs[0].VTKObject)<br />
</source><br />
<br />
The UnRegister() call is essential to avoid memory leaks.<br />
<br />
The second trick is to use ShallowCopy() to copy the output of the internal filter to the output of the outer filter as follows:<br />
<br />
<source lang="python"><br />
output.ShallowCopy(probe.GetOutput())<br />
</source><br />
<br />
This should be enough to get you started. There are a large number of VTK filters so it is not possible to describe them here. Refer to the VTK documentation for more information.</div>Katie.osterdahlhttps://public.kitware.com/Wiki/index.php?title=ParaView/Users_Guide/Python_Programmable_Filter&diff=40532ParaView/Users Guide/Python Programmable Filter2011-06-09T17:46:38Z<p>Katie.osterdahl: </p>
<hr />
<div>== Introduction ==<br />
<br />
[[Image:ParaView_UG_ProgrammableFilter.png|thumb|400px|left|'''Figure 6.1''']]<br />
<br />
The Programmable Filter is a ParaView filter that processes one or more input datasets based on a Python script provided by the user. The parameters of the filter include the output data type, the script and a toggle that controls whether the input arrays are copied to the output. This chapter introduces the use of the Programmable Filter and gives a summary of the API available to the user. <br />
<br />
Note that the Programmable Filter depends on Python. All ParaView binaries distributed by Kitware are built with Python enabled. If you have built ParaView yourself, you have to make sure that PARAVIEW_ENABLE_PYTHON is turned on when configuring the ParaView build.<br />
<br />
Since the entire VTK API as well as any module that can be imported through Python is available through this filter, we can only skim the surface of what can be accomplished with this filter here. If you are not familiar with Python, we recommend first taking a look at one of the introductory guides such as the [http://docs.python.org/tutorial/ official Python Tutorial]. If you are going to do any programming beyond the very basics, we recommend reading up on the VTK API. [http://www.vtk.org The VTK website] has links to VTK books and online documentation. For reference, you may need to look at the [http://www.vtk.org/doc/release/5.6/html/ VTK class documentation]. There is also more information about the Programmable Filter and some good recipes on the ParaView Wiki ([[Python_Programmable_Filter]]).<br />
<br />
== Basic Use ==<br />
<br />
Requirements: <br />
# You are applying Programmable Filter to a "simple" dataset and not a composite dataset such as multi-block or AMR.<br />
# You have NumPy installed.<br />
<br />
The most basic reason to use the Programmable Filter is to add a new array by deriving it from arrays in the input, which can also be achieved by using the Python Calculator. One reason to use the Programmable Filter instead may be that the calculation is more involved and trying to do it in one expression may be difficult. Another reason may be that you need access to a program flow construct such as if or for. The Programmable Filter can be used to do everything the Calculator does and more.<br />
<br />
'''Note:''' Since what is described here builds on some of the concepts introduced in the [[ParaView/Users_Guide/Python_Calculator | Python Calculator section]], please read it first if you are not familiar with the Calculator.<br />
<br />
If you leave the "Output Dataset Type" parameter in the default setting of "Same as Input," the Programmable Filter will copy the topology and geometry of the input to the output before calling your Python script. Therefore, if you Apply the filter without filling the script, you should see a copy of the input without any of its arrays in the output. If you also check the Copy Arrays option, the output will have all of the input arrays. This behavior allows you to focus on creating new arrays without worrying about the mesh.<br />
<br />
Create a Sphere source and then apply the Programmable Filter and use the following script.<br />
<br />
<source lang="python"><br />
normals = inputs[0].PointData['Normals']<br />
output.PointData.append(normals[:,0], "Normals_x")<br />
</source><br />
<br />
This should create a sphere with an array called "Normals_x". There a few things to note here:<br />
<br />
* You cannot refer to arrays directly by name as in the Python Calculator. You need to access arrays using the .PointData and .CellData qualifiers.<br />
* Unlike the Python Calculator, you have to explicitly add an array to the output using the append function. Note that this function takes the name of the array as the second argument.<br />
<br />
You can use any of the functions available in the Calculator in the Programmable Filter. For example, the following code creates two new arrays and adds them to the output.<br />
<br />
<source lang="python"><br />
normals = inputs[0].PointData['Normals']<br />
output.PointData.append(sin(normals[:,0]), "sin of Normals_x")<br />
output.PointData.append(normals[:,1] + 1, "Normals_y + 1")<br />
</source><br />
<br />
== Intermediate Use ==<br />
<br />
=== Mixing VTK and NumPy APIs ===<br />
<br />
The previous examples demonstrate how the Programmable Filter can be used as an advanced Python Calculator. However, the full power of the Programmable Filter can only be harnessed by using the VTK API. The following is a simple example. Create a Sphere source and apply the Programmable Filter with the following script.<br />
<br />
<source lang="python"><br />
input = inputs[0]<br />
<br />
newPoints = vtk.vtkPoints()<br />
numPoints = input.GetNumberOfPoints()<br />
for i in range(numPoints):<br />
x, y, z = input.GetPoint(i)<br />
newPoints.InsertPoint(i, x, y, 1 + z*0.3)<br />
<br />
output.SetPoints(newPoints)<br />
</source><br />
<br />
Start with creating a new instance of vtkPoints:<br />
<br />
<source lang="python"><br />
newPoints = vtk.vtkPoints()<br />
</source><br />
<br />
vtkPoints is a data structure that VTK uses to store the coordinates of points. Next, loop over all points of the input and insert a new point in the output with coordinates (x, y, 1+z*0.3)<br />
<br />
<source lang="python"><br />
for i in range(numPoints):<br />
x, y, z = input.GetPoint(i)<br />
newPoints.InsertPoint(i, x, y, 1 + z*0.3)<br />
</source><br />
<br />
Finally, replace the output points with the new points we created using the following:<br />
<br />
<source lang="python"><br />
output.SetPoints(newPoints)<br />
</source><br />
<br />
'''Note:''' Python is an interpreted language and Python scripts do not execute as efficiently as compiled C++ code. Therefore, using a for loop that iterates over all points or cells may be a significant bottleneck when processing large datasets.<br />
<br />
The NumPy and VTK APIs can be mixed to achieve good performance. Even though this may seem a bit complicated at first, it can be used with great effect. For instance, the example above can be rewritten as follows.<br />
<br />
<source lang="python"><br />
from paraview.vtk.dataset_adapter import numpyTovtkDataArray<br />
<br />
input = inputs[0]<br />
<br />
newPoints = vtk.vtkPoints()<br />
<br />
zs = 1 + input.Points[:,2]*0.3<br />
coords = hstack([input.Points[:,0:2],zs])<br />
<br />
newPoints.SetData(numpyTovtkDataArray(coords))<br />
<br />
output.SetPoints(newPoints)<br />
</source><br />
<br />
Even though this produces exactly the same result, it is much more efficient because the for loop was moved it from Python to C. Under the hood, NumPy uses C and Fortran for tight loops.<br />
<br />
If you read the Python Calculator documentation, this example is straightforward except the use of numpyTovtkDataArray(). First, note that you are mixing two APIs here: the VTK API and NumPy. VTK and NumPy uses different types of objects to represents arrays. The basic examples previously used carefully hide this from you. However, once you start manipulating VTK objects using NumPy, you have to start converting objects between two APIs. Note that for the most part this conversion happens without "deep copying" arrays, for example copying the raw contents from one memory location to another. Rather, pointers are passed between VTK and NumPy whenever possible.<br />
<br />
The dataset_adapter provides two methods to do the conversions described above:<br />
<br />
* vtkDataArrayToVTKArray: This function creates a NumPy compatible array from a vtkDataArray. Note that VTKArray is actually a subclass of numpy.matrix and can be used anywhere matrix can be used. This function always copies the pointer and not the contents. '''Important:''' You should not directly change the values of the resulting array if the argument is an array from the input.<br />
* numpyTovtkDataArray: Converts a NumPy array (or a VTKArray) to a vtkDataArray. This function copies the pointer if the argument is a contiguous array. There are various ways of creating discontinuous arrays with NumPy including using hstack and striding. See NumPy documentation for details.<br />
<br />
=== Multiple Inputs ===<br />
<br />
Like the Python Calculator, the Programmable Filter can accept multiple inputs. First, select two or more pipeline objects in the pipeline browser and then apply the Programmable Filter. Then each input can be accessed using the inputs[] variable. Note that if the Output Dataset Type is set to Same as Input, the filter will copy the mesh from the first input to the output. If Copy Arrays is on, it will also copy arrays from the first input. As an example, the following script compares the Pressure attribute from two inputs using the difference operator.<br />
<br />
<source lang="python"><br />
output.append(inputs[1].PointData['Pressure'] - inputs[0].PointData['Pressure'], "difference")<br />
</source><br />
<br />
=== Dealing with Composite Datasets ===<br />
<br />
Thus far, none of the examples used apply to multi-block or AMR datasets. When talking about the Python Calculator, you did not have to differentiate between simple and composite datasets. This is because the calculator loops over all of the leaf blocks of composite datasets and applies the expression to each one. Therefore, inputs in an expression are guaranteed to be simple datasets. On the other hand, the Programmable Filter does not perform this iteration and passes the input, composite or simple, as it is to the script. Even though this makes basic scripting harder for composite datasets, it provides enormous flexibility.<br />
<br />
Tto work with composite datasets you need to know how to iterate over them to access the leaf nodes. <br />
<br />
<source lang="python"><br />
for block in inputs[0]:<br />
print block<br />
</source><br />
<br />
Here you iterate over all of the non-NULL leaf nodes (i.e. simple datasets) of the input and print them to the Output Messages console. Note that this will work only if the input is multi-block or AMR.<br />
<br />
When Output Dataset Type is set to "Same as Input," the Programmable Filter will copy composite dataset to the output - it will copy only the mesh unless Copy Arrays is on. Therefore, you can also iterate over the output. A simple trick is to turn on Copy Arrays and then use the arrays from the output when generating new ones. Below is an example. You should use the can.ex2 file from the ParaView testing dataset collection.<br />
<br />
<source lang="python"><br />
def process_block(block):<br />
displ = block.PointData['DISPL']<br />
block.PointData.append(displ[:,0], "displ_x")<br />
<br />
for block in output:<br />
process_block(block)<br />
</source><br />
<br />
Alternatively, you can use the MultiCompositeDataIterator to iterate over the input and output block simultaneously. The following is equivalent to the previous example:<br />
<br />
<source lang="python"><br />
def process_block(input_block, output_block):<br />
displ = input_block.PointData['DISPL']<br />
output_block.PointData.append(displ[:,0], "displ_x")<br />
<br />
from paraview.vtk.dataset_adapter import MultiCompositeDataIterator<br />
iter = MultiCompositeDataIterator([inputs[0], output])<br />
<br />
for input_block, output_block in iter:<br />
process_block(input_block, output_block)<br />
</source><br />
<br />
== Advanced ==<br />
<br />
=== Changing Output Type ===<br />
<br />
Thus far, all of the examples discussed depended on the output type being the same as input and that the Programmable Filter copied the input mesh to the output. If you set the output type to something other than Same as Input, the Programmable Filter will create an empty output of the type we specified but will not copy any information. Even though it may be more work, this provides a lot of flexibility. Since this is approaching the realm of VTK filter authoring, a very simple example is used. If you are already familiar with VTK API, you will realize that this is a great way of prototyping VTK filters. If you are not, reading up on VTK is recommended. <br />
<br />
Create a Wavelet source, apply a Programmable Filter, set the output type to vtkTable and use the following script:<br />
<br />
<source lang="python"><br />
rtdata = inputs[0].PointData['RTData']<br />
<br />
output.RowData.append(min(rtdata), 'min')<br />
output.RowData.append(max(rtdata), 'max')<br />
</source><br />
<br />
Here, you added two columns to the output table. The first one has one value - minimum of RTData - and the second one has the maximum of RTData. When you apply this filter, the output should automatically be shown in a Spreadsheet view. You could also use this sort of script to chart part of the input data. For example, the output of the following script can be display as a line chart.<br />
<br />
<source lang="python"><br />
rtdata = inputs[0].PointData['RTData']<br />
output.RowData.append(rtdata, 'rtdata')<br />
</source><br />
<br />
Changing the output type is also often necessary when using VTK filters within the script, which is demonstrated in the following section.<br />
<br />
=== Dealing with Structured Data Output ===<br />
<br />
. A curvilinear gris, for instance a bluntfin.vts from the ParaView testing data, is used as a good example. If you would like to volume render a subset of this grid, since as of 3.10, ParaView does not support volume rendering of curvilinear grids, you have two choices:<br />
<br />
* Resample to an image data<br />
* Convert to unstructured grid<br />
This example demonstrates how to resample to image data using the Programmable Filter. This can be accomplished using the Resample with Dataset filter, but it is a good example nevertheless. Start with loading bluntfin.vts, then apply the Programmable Filter. Make sure to set the output type to vtkImageData. Here is the script:<br />
<br />
<source lang="python"><br />
pinput = vtk.vtkImageData()<br />
pinput.SetExtent(0, 10, 0, 10, 0, 10)<br />
pinput.SetOrigin(0, 1, 0)<br />
pinput.SetSpacing(0.5, 0.5, 0.5)<br />
<br />
probe = vtk.vtkProbeFilter()<br />
probe.SetInput(pinput)<br />
<br />
input_copy = inputs[0].NewInstance()<br />
input_copy.UnRegister(None)<br />
input_copy.ShallowCopy(inputs[0].VTKObject)<br />
<br />
probe.SetSource(input_copy)<br />
probe.Update()<br />
<br />
output.ShallowCopy(probe.GetOutput())<br />
</source><br />
<br />
'''Note:''' See the next section for details about using a VTK filter within the Programmable Filter.<br />
<br />
If you already applied, you may notice that the output looks much bigger than it should be. This is because we are missing an important piece. We need to use the following as the RequestInformation script:<br />
<br />
<source lang="python"><br />
from paraview.util import SetOutputWholeExtent<br />
<br />
SetOutputWholeExtent(self, [0, 10, 0, 10, 0, 10])<br />
</source><br />
<br />
This requires a bit of explanation. VTK expects that all data sources and filters that produce structured data (rectilinear or curvilinear grids) to provide meta data about the logical extents of the output dataset before full execution. Thus the RequestInformation is called by the Programmable Filter before execution and is where you should provide this meta-data. This is not required if the filter is simply copying the mesh as the meta-data would have been provided by another pipeline object upstream. However, if you are using the Programmable Filter to produce a structured data with a different mesh than the input, you need to provide this information.<br />
<br />
You are probably wondering what the RequestUpdateExtent script does. This script can be used to augment the request that propagates upstream before execution. This is used to ask for a specific data extent, for example. This is an advanced concept and is not discussed further here.<br />
<br />
=== Using VTK Filters with Programmable Filter ===<br />
<br />
The previous example demonstrated how you can use a VTK filter (vtkProbeFilter in this case) from with the Programmable Filter. We will explain that example in more detail here. Here it is again.<br />
<br />
<source lang="python"><br />
pinput = vtk.vtkImageData()<br />
pinput.SetExtent(0, 10, 0, 10, 0, 10)<br />
pinput.SetOrigin(0, 1, 0)<br />
pinput.SetSpacing(0.5, 0.5, 0.5)<br />
<br />
probe = vtk.vtkProbeFilter()<br />
probe.SetInput(pinput)<br />
<br />
input_copy = inputs[0].NewInstance()<br />
input_copy.UnRegister(None)<br />
input_copy.ShallowCopy(inputs[0].VTKObject)<br />
<br />
probe.SetSource(input_copy)<br />
probe.Update()<br />
<br />
output.ShallowCopy(probe.GetOutput())<br />
</source><br />
<br />
There are two important tricks to use a VTK filter from another VTK filter. First, do not directly set the input to the outer filter as the input of the inner filter. It is difficult to explain why without getting into VTK pipeline mechanics so please take our word for it. Instead, make a shallow copy as follow.<br />
<br />
<source lang="python"><br />
input_copy = inputs[0].NewInstance()<br />
input_copy.UnRegister(None)<br />
input_copy.ShallowCopy(inputs[0].VTKObject)<br />
</source><br />
<br />
The UnRegister() call is essential to avoid memory leaks.<br />
<br />
The second trick is to use ShallowCopy() to copy the output of the internal filter to the output of the outer filter as follows.<br />
<br />
<source lang="python"><br />
output.ShallowCopy(probe.GetOutput())<br />
</source><br />
<br />
This should be enough to get you started. There are a large number of VTK filters so it is not possible to describe them here. Refer to the VTK documentation for more information.</div>Katie.osterdahlhttps://public.kitware.com/Wiki/index.php?title=ParaView/Users_Guide/Quantitative_Analysis&diff=40530ParaView/Users Guide/Quantitative Analysis2011-06-09T16:40:05Z<p>Katie.osterdahl: </p>
<hr />
<div>ParaView 2 was almost entirely a qualitative analysis tool. It was very good at drawing pictures of large scientific datasets so that you could view the data and tell if it looked "right," but it was not easy to use for finding hard quantitative information about the data and verifying that that was the case. The recommended use was to use ParaView to visualize, interact with and subset your data and then export the result into a format that could be imported by a different tool. A major goal of ParaView 3 has been to add quantitative analysis capabilities to turn it into a convenient and comprehensive tool in which you can visualize, interact with and drill all the way down into the data.<br />
<br />
These capabilities vary from semi-qualitative ones such as the Ruler source and Cube Axis representation (see [[Users_Guide_Annotation]]) to Selection which allows you to define and extract arbitrary subsets of the data based, to the spreadsheet view which presents the data in textual form. Taken together with features like the [[ParaView/Users_Guide/List_of_filters#Descriptive_Statistics| statistical analysis filters]], calculator filters, 2D plot and chart views and programmable filters (which give you the ability to run arbitrary code on the server and have access to every data point) these give you the ability to inspect the data from the highest level view all the way down to the hard numbers.<br />
<br />
This chapter describes the various tools that ParaView gives you to support quantitative analysis.</div>Katie.osterdahlhttps://public.kitware.com/Wiki/index.php?title=ParaView/UsersGuide/Macros&diff=40529ParaView/UsersGuide/Macros2011-06-09T16:36:48Z<p>Katie.osterdahl: </p>
<hr />
<div>== Macros (aka Custom Filters) ==<br />
It often happens that once you figure out how to do some specific data processing task, you want to repeat it often. <br />
You may, for example, want to reuse particular filters with specific settings (for example complicated calculator or programmable filter expressions) or even entire pipeline sections consisting on new datasets without having to manually enter the parameters each time.<br />
<br />
You can do this via the clever use of state files or more conveniently python scripts and python macros [[ParaView/Python_Scripting | (1) ]]. Saving, editing and reusing state files gives you the ability to recreate entire ParaView sessions, but not fine enough control for small, repeatedly reused tasks. Python Tracing does give you fine grained control, but this assumes that you have python enabled in your copy of ParaView (which is usually but not always the case) and that you remember to turn on Trace recording before you did whatever it was that you want to play back. Both techniques largely require that you think like a programmer when you initially create and setup the scripts. Another alternative is to use ParaView's Custom Filters which let you create reusable meta-filters strictly within the GUI.<br />
<br />
A Custom Filter is a black box filter that encapsulates one or more filters in a sub-pipeline and exposes only those parameters from that sub-pipeline that the Custom Filter creator chose to make available. For example, if you capture a ten element pipeline in your Custom Filter where each filter happened to have eight parameters, you could choose to expose anywhere from zero to eighty parameters in your Custom Filter's Properties tab. <br />
<br />
<br />
[[File:ParaView_UsersGuide_CustomFilterConcept.png|thumb|center|400px|'''Figure 5.10''' Custom Filter concept]]<br />
<br />
<br />
Once you have set up some pipeline that performs the data processing that you want to reuse, the process of creating a Custom Filter consists of three steps. First, select one or more filters from the Pipeline Browser using the mouse. Second, from the Tools menu select Create Custom Filter. From that dialog choose the filter in your chosen sub-pipeline who's input is representative of where you want data to enter into your Custom Filter. This is usually the topmost filter. If you are creating a multi-input filter, click the ''+'' button to add additional inputs and configure them in the same way. Clicking Next brings you to a similar dialog in which you choose the outputs of your Custom Filter. Third, click Next again to get to the last dialog, where you specify which parameters of the internal filters you want to expose to the eventual user of the custom filter. You can optionally give each parameter a descriptive label here as well. The three dialogs are shown below.<br />
<br />
<br />
{| style="border-spacing:0;"<br />
| style="border:none;padding-top:0in;padding-bottom:0in;padding-left:0.075in;padding-right:0.075in;"| <center>Step 1: configure one or more inputs to your new filter.</center><br />
| style="border:none;padding-top:0in;padding-bottom:0in;padding-left:0.075in;padding-right:0.075in;"| <br />
<center>[[File:ParaView_UsersGuide_CustomFilterInputs.png|400px|link=]]</center><br />
<br />
|-<br />
| style="border:none;padding-top:0in;padding-bottom:0in;padding-left:0.075in;padding-right:0.075in;"| <center>Step 2: configure one or more outputs of your new filter.</center><br />
| style="border:none;padding-top:0in;padding-bottom:0in;padding-left:0.075in;padding-right:0.075in;"| <br />
<center>[[File:ParaView_UsersGuide_CustomFilterOutputs.png|400px|link=]]</center><br />
<br />
|-<br />
| style="border:none;padding-top:0in;padding-bottom:0in;padding-left:0.075in;padding-right:0.075in;"| <center>Step 3: identify and name the controls you want to expose of your new filter.</center><br />
| style="border:none;padding-top:0in;padding-bottom:0in;padding-left:0.075in;padding-right:0.075in;"| <br />
<center>[[File:ParaView_UsersGuide_CustomFilterParameters.png|400px|link=]]</center><br />
<br />
|}<br />
<center>'''Figure 5.11''' Creating a Custom Filter</center><br />
<br />
<br />
Once you create a Custom Filter it is added to the Alphabetical sub menu of the Filters menu. It is automatically saved in ParaView's settings, so the next time you start ParaView on the same machine you can use it just like any of the other filters that came with your copy of ParaView. Custom Filters are treated no differently than other filters in ParaView and are saveable and restorable in state files and python scripts. If you find that you no longer need some Custom Filter and want to get rid of it, use the Manage Custom Filters dialog box under the Tools menu to remove it. <br />
<br />
<br />
If, on the other hand, you find that a Custom Filter is very useful, you may instead want to give it to a colleague. On that same dialog are controls for exporting and importing Custom Filters. When you save a Custom Filter you are prompted for a location and filename to save the filter in. The file format is a simple XML text file that you can simply email or otherwise deliver.</div>Katie.osterdahlhttps://public.kitware.com/Wiki/index.php?title=ParaView/UsersGuide/Recommendations&diff=40528ParaView/UsersGuide/Recommendations2011-06-09T16:30:06Z<p>Katie.osterdahl: </p>
<hr />
<div>'''Avoiding Data Explosion'''<br />
<br />
The pipeline model that ParaView presents is very convenient for exploratory visualization. The loose coupling between components provides a very flexible framework for building unique visualizations, and the pipeline structure allows you to tweak parameters quickly and easily.<br />
<br />
The downside of this coupling is that it can have a larger memory footprint. Each stage of this pipeline maintains its own copy of the data. Whenever possible, ParaView performs shallow copies of the data so that different stages of the pipeline point to the same block of data in memory. However, any filter that creates new data or changes the values or topology of the data must allocate new memory for the result. If ParaView is filtering a very large mesh, inappropriate use of filters can quickly deplete all available memory. Therefore, when visualizing large datasets, it is important to understand the memory requirements of filters.<br />
<br />
Please keep in mind that the following advice is intended only for when dealing with very large amounts of data and the remaining available memory is low. When you are not in danger of running out of memory, the following advice is not relevant. <br />
<br />
When dealing with structured data, it is absolutely important to know what filters will change the data to unstructured. Unstructured data has a much higher memory footprint, per cell, than structured data because the topology must be explicitly written out. There are many filters in ParaView that will change the topology in some way, and these filters will write out the data as an unstructured grid, because that is the only dataset that will handle any type of topology that is generated. The following list of filters will write out a new unstructured topology in its output that is roughly equivalent to the input. These filters should never be used with structured data and should be used with caution on unstructured data.<br />
<br />
* '''Append Datasets'''<br />
* '''Append Geometry'''<br />
* '''Clean'''<br />
* '''Clean to Grid'''<br />
* '''Connectivity'''<br />
* '''D3'''<br />
* '''Delaunay 2D/3D'''<br />
* '''Extract Edges'''<br />
* '''Linear Extrusion'''<br />
* '''Loop Subdivision'''<br />
* '''Reflect'''<br />
* '''Rotational Extrusion'''<br />
* '''Shrink'''<br />
* '''Smooth'''<br />
* '''Subdivide'''<br />
* '''Tessellate'''<br />
* '''Tetrahedralize'''<br />
* '''Triangle Strips'''<br />
* '''Triangulate'''<br />
<br />
Technically, the Ribbon and Tube filters should fall into this list. However, as they only work on 1D cells in poly data, the input data is usually small and of little concern. <br />
<br />
This similar set of filters also outputs unstructured grids, but also tends to reduce some of this data. Be aware though that this data reduction is often smaller than the overhead of converting to unstructured data. Also note that the reduction is often not well balanced. It is possible (often likely) that a single process may not lose any cells. Thus, these filters should be used with caution on unstructured data and extreme caution on structured data.<br />
<br />
* '''Clip'''<br />
* '''Decimate'''<br />
* '''Extract Cells by Region'''<br />
* '''Extract Selection'''<br />
* '''Quadric Clustering'''<br />
* '''Threshold'''<br />
<br />
Similar to the items in the preceding list, Extract Subset performs data reduction on a structured dataset, but also outputs a structured dataset. So the warning about creating new data still applies, but you do not have to worry about converting to an unstructured grid.<br />
<br />
This next set of filters also outputs unstructured data, but it also performs a reduction on the dimension of the data (for example 3D to 2D), which results in a much smaller output. Thus, these filters are usually safe to use with unstructured data and require only mild caution with structured data.<br />
<br />
* '''Cell Centers'''<br />
* '''Contour'''<br />
* '''Extract CTH Fragments'''<br />
* '''Extract CTH Parts'''<br />
* '''Extract Surface'''<br />
* '''Feature Edges'''<br />
* '''Mask Points'''<br />
* '''Outline (curvilinear)'''<br />
* '''Slice'''<br />
* '''Stream Tracer'''<br />
<br />
The filters below do not change the connectivity of the data at all. Instead, they only add field arrays to the data. All the existing data is shallow copied. These filters are usually safe to use on all data.<br />
<br />
* '''Block Scalars'''<br />
* '''Calculator'''<br />
* '''Cell Data to Point Data'''<br />
* '''Curvature'''<br />
* '''Elevation'''<br />
* '''Generate Surface Normals'''<br />
* '''Gradient'''<br />
* '''Level Scalars'''<br />
* '''Median'''<br />
* '''Mesh Quality'''<br />
* '''Octree Depth Limit'''<br />
* '''Octree Depth Scalars'''<br />
* '''Point Data to Cell Data'''<br />
* '''Process Id Scalars'''<br />
* '''Random Vectors'''<br />
* '''Resample with dataset'''<br />
* '''Surface Flow'''<br />
* '''Surface Vectors'''<br />
* '''Texture Map to...'''<br />
* '''Transform'''<br />
* '''Warp (scalar)'''<br />
* '''Warp (vector)'''<br />
<br />
This final set of filters either add no data to the output (all data of consequence is shallow copied) or the data they add is generally independent of the size of the input. These are almost always safe to add under any circumstances (although they may take a lot of time).<br />
<br />
* '''Annotate Time'''<br />
* '''Append Attributes'''<br />
* '''Extract Block'''<br />
* '''Extract Datasets'''<br />
* '''Extract Level'''<br />
* '''Glyph'''<br />
* '''Group Datasets'''<br />
* '''Histogram'''<br />
* '''Integrate Variables'''<br />
* '''Normal Glyphs'''<br />
* '''Outline'''<br />
* '''Outline Corners'''<br />
* '''Plot Global Variables Over Time'''<br />
* '''Plot Over Line'''<br />
* '''Plot Selection Over Time'''<br />
* '''Probe Location'''<br />
* '''Temporal Shift Scale'''<br />
* '''Temporal Snap-to-Time-Steps'''<br />
* '''Temporal Statistics'''<br />
<br />
There are a few special case filters that do not fit well into any of the previous classes. Some of the filters, currently Temporal Interpolator and Particle Tracer, perform calculations based on how data changes over time. Thus, these filters may need to load data for two or more instances of time, which can double or more the amount of data needed in memory. The Temporal Cache filter will also hold data for multiple instances of time. Keep in mind that some of the temporal filters such as the Temporal Statistics and the filters that plot over time may need to iteratively load all data from disk. Thus, it may take an impractically long amount of time even if does not require any extra memory.<br />
<br />
The Programmable Filter is also a special case that is impossible to classify. Since this filter does whatever it is programmed to do, it can fall into any one of these categories.<br />
<br />
<br />
'''Culling Data'''<br />
<br />
When dealing with large data, it is best to cull out data whenever possible and do so as early as possible. Most large data starts as 3D geometry and the desired geometry is often a surface. As surfaces usually have a much smaller memory footprint than the volumes that they are derived from, it is best to convert to a surface early on. Once you do that, you can apply other filters in relative safety.<br />
<br />
A very common visualization operation is to extract isosurfaces from a volume using the Contour filter. The Contour filter usually outputs geometry much smaller than its input. Thus, the Contour filter should be applied early if it is to be used at all. Be careful when setting up the parameters to the Contour filter because it still is possible for it to generate a lot of data. which can happen if you specify many isosurface values. High frequencies such as noise around an isosurface value can also cause a large, irregular surface to form.<br />
<br />
Another way to peer inside of a volume is to perform a Slice on it. The Slice filter will intersect a volume with a plane and allow you to see the data in the volume where the plane intersects. If you know the relative location of an interesting feature in your large dataset, slicing is a good way to view it.<br />
<br />
If you have little a-priori knowledge of your data and would like to explore the data without the long memory and processing time for the full dataset, you can use the Extract Subset filter to subsample the data. The subsampled data can be dramatically smaller than the original data and should still be well load balanced. Of course, be aware that you may miss small features if the subsampling steps over them and that once you find a feature you should go back and visualize it with the full data set.<br />
<br />
There are also several features that can pull out a subset of a volume: Clip, Threshold, Extract Selection, and Extract Subset can all extract cells based on some criterion. Be aware, however, that the extracted cells are almost never well balanced; expect some processes to have no cells removed. All of these filters, with the exception of Extract Subset, will convert structured data types to unstructured grids. Therefore, they should not be used unless the extracted cells are of at least an order of magnitude less than the source data.<br />
<br />
When possible, replace the use of a filter that extracts 3D data with one that will extract 2D surfaces. For example, if you are interested in a plane through the data, use the Slice filter rather than the Clip filter. If you are interested in knowing the location of a region of cells containing a particular range of values, consider using the Contour filter to generate surfaces at the ends of the range rather than extract all of the cells with the Threshold filter. Be aware that substituting filters can have an effect on downstream filters. For example, running the Histogram filter after Threshold will have an entirely different effect then running it after the roughly equivalent Contour filter.</div>Katie.osterdahlhttps://public.kitware.com/Wiki/index.php?title=ParaView/UsersGuide/Recommendations&diff=40525ParaView/UsersGuide/Recommendations2011-06-09T12:29:40Z<p>Katie.osterdahl: </p>
<hr />
<div>'''Avoiding Data Explosion'''<br />
<br />
The pipeline model that ParaView presents is very convenient for exploratory visualization. The loose coupling between components provides a very flexible framework for building unique visualizations, and the pipeline structure allows you to tweak parameters quickly and easily.<br />
<br />
The downside of this coupling is that it can have a larger memory footprint. Each stage of this pipeline maintains its own copy of the data. Whenever possible, ParaView performs shallow copies of the data so that different stages of the pipeline point to the same block of data in memory. However, any filter that creates new data or changes the values or topology of the data must allocate new memory for the result. If ParaView is filtering a very large mesh, inappropriate use of filters can quickly deplete all available memory. Therefore, when visualizing large datasets, it is important to understand the memory requirements of filters.<br />
<br />
Please keep in mind that the following advice is intended only for when dealing with very large amounts of data and the remaining available memory is low. When you are not in danger of running out of memory, the following advice is not relevant. <br />
<br />
When dealing with structured data, it is absolutely important to know what filters will change the data to unstructured. Unstructured data has a much higher memory footprint, per cell, than structured data because the topology must be explicitly written out. There are many filters in ParaView that will change the topology in some way, and these filters will write out the data as an unstructured grid, because that is the only dataset that will handle any type of topology that is generated. The following list of filters will write out a new unstructured topology in its output that is roughly equivalent to the input. These filters should never be used with structured data and should be used with caution on unstructured data.<br />
<br />
* '''Append Datasets'''<br />
* '''Append Geometry'''<br />
* '''Clean'''<br />
* '''Clean to Grid'''<br />
* '''Connectivity'''<br />
* '''D3'''<br />
* '''Delaunay 2D/3D'''<br />
* '''Extract Edges'''<br />
* '''Linear Extrusion'''<br />
* '''Loop Subdivision'''<br />
* '''Reflect'''<br />
* '''Rotational Extrusion'''<br />
* '''Shrink'''<br />
* '''Smooth'''<br />
* '''Subdivide'''<br />
* '''Tessellate'''<br />
* '''Tetrahedralize'''<br />
* '''Triangle Strips'''<br />
* '''Triangulate'''<br />
<br />
Technically, the Ribbon and Tube filters should fall into this list. However, as they only work on 1D cells in poly data, the input data is usually small and of little concern. <br />
<br />
This similar set of filters also outputs unstructured grids, but also tends to reduce some of this data. Be aware though that this data reduction is often smaller than the overhead of converting to unstructured data. Also note that the reduction is often not well balanced. It is possible (often likely) that a single process may not lose any cells. Thus, these filters should be used with caution on unstructured data and extreme caution on structured data.<br />
<br />
* '''Clip'''<br />
* '''Decimate'''<br />
* '''Extract Cells by Region'''<br />
* '''Extract Selection'''<br />
* '''Quadric Clustering'''<br />
* '''Threshold'''<br />
<br />
Similar to the items in the preceding list, Extract Subset performs data reduction on a structured dataset, but also outputs a structured dataset. So the warning about creating new data still applies, but you do not have to worry about converting to an unstructured grid.<br />
<br />
This next set of filters also outputs unstructured data, but it also performs a reduction on the dimension of the data (for example 3D to 2D), which results in a much smaller output. Thus, these filters are usually safe to use with unstructured data and require only mild caution with structured data.<br />
<br />
* '''Cell Centers'''<br />
* '''Contour'''<br />
* '''Extract CTH Fragments'''<br />
* '''Extract CTH Parts'''<br />
* '''Extract Surface'''<br />
* '''Feature Edges'''<br />
* '''Mask Points'''<br />
* '''Outline (curvilinear)'''<br />
* '''Slice'''<br />
* '''Stream Tracer'''<br />
<br />
The filters below do not change the connectivity of the data at all. Instead, they only add field arrays to the data. All the existing data is shallow copied. These filters are usually safe to use on all data.<br />
<br />
* '''Block Scalars'''<br />
* '''Calculator'''<br />
* '''Cell Data to Point Data'''<br />
* '''Curvature'''<br />
* '''Elevation'''<br />
* '''Generate Surface Normals'''<br />
* '''Gradient'''<br />
* '''Level Scalars'''<br />
* '''Median'''<br />
* '''Mesh Quality'''<br />
* '''Octree Depth Limit'''<br />
* '''Octree Depth Scalars'''<br />
* '''Point Data to Cell Data'''<br />
* '''Process Id Scalars'''<br />
* '''Random Vectors'''<br />
* '''Resample with dataset'''<br />
* '''Surface Flow'''<br />
* '''Surface Vectors'''<br />
* '''Texture Map to...'''<br />
* '''Transform'''<br />
* '''Warp (scalar)'''<br />
* '''Warp (vector)'''<br />
<br />
This final set of filters either add no data to the output (all data of consequence is shallow copied) or the data they add is generally independent of the size of the input. These are almost always safe to add under any circumstances (although they may take a lot of time).<br />
<br />
* '''Annotate Time'''<br />
* '''Append Attributes'''<br />
* '''Extract Block'''<br />
* '''Extract Datasets'''<br />
* '''Extract Level'''<br />
* '''Glyph'''<br />
* '''Group Datasets'''<br />
* '''Histogram'''<br />
* '''Integrate Variables'''<br />
* '''Normal Glyphs'''<br />
* '''Outline'''<br />
* '''Outline Corners'''<br />
* '''Plot Global Variables Over Time'''<br />
* '''Plot Over Line'''<br />
* '''Plot Selection Over Time'''<br />
* '''Probe Location'''<br />
* '''Temporal Shift Scale'''<br />
* '''Temporal Snap-to-Time-Steps'''<br />
* '''Temporal Statistics'''<br />
<br />
There are a few special case filters that do not fit well into any of the previous classes. Some of the filters, currently Temporal Interpolator and Particle Tracer, perform calculations based on how data changes over time. Thus, these filters may need to load data for two or more instances of time, which can double or more the amount of data needed in memory. The Temporal Cache filter will also hold data for multiple instances of time. Keep in mind that some of the temporal filters such as the Temporal Statistics and the filters that plot over time may need to iteratively load all data from disk. Thus, it may take an impractically long amount of time even if does not require any extra memory.<br />
<br />
The Programmable Filter is also a special case that is impossible to classify. Since this filter does whatever it is programmed to do, it can fall into any one of these categories.<br />
<br />
<br />
'''Culling Data'''<br />
<br />
<br />
When dealing with large data, it is best to cull out data whenever possible and do so as early as possible. Most large data starts as 3D geometry and the desired geometry is often a surface. As surfaces usually have a much smaller memory footprint than the volumes that they are derived from, it is best to convert to a surface early on. Once you do that, you can apply other filters in relative safety.<br />
<br />
A very common visualization operation is to extract isosurfaces from a volume using the contour filter. The '''Contour''' filter usually outputs geometry much smaller than its input. Thus, the '''Contour''' filter should be applied early if it is to be used at all. Be careful when setting up the parameters to the '''Contour''' filter because it still is possible for it to generate a lot of data. This obviously can happen if you specify many isosurface values. High frequencies such as noise around an isosurface value can also cause a large, irregular surface to form.<br />
<br />
Another way to peer inside of a volume is to perform a '''Slice''' on it. The '''Slice''' filter will intersect a volume with a plane and allow you to see the data in the volume where the plane intersects. If you know the relative location of an interesting feature in your large data set, slicing is a good way to view it.<br />
<br />
If you have little a-priori knowledge of your data and would like to explore the data without paying the memory and processing time for the full data set, you can use the '''Extract Subset''' filter to subsample the data. The subsampled data can be dramatically smaller than the original data and should still be well load balanced. Of course, be aware that you may miss small features if the subsampling steps over them and that once you find a feature you should go back and visualize it with the full data set.<br />
<br />
There are also several features that can pull out a subset of a volume: '''Clip''', '''Threshold''', '''Extract Selection''', and '''Extract Subset''' can all extract cells based on some criterion. Be aware, however, that the extracted cells are almost never well balanced; expect some processes to have no cells removed. Also, all of these filters with the exception of '''Extract Subset''' will convert structured data types to unstructured grids. Therefore, they should not be used unless the extracted cells are of at least an order of magnitude less than the source data.<br />
<br />
When possible, replace the use of a filter that extracts 3D data with one that will extract 2D surfaces. For example, if you are interested in a plane through the data, use the '''Slice''' filter rather than the '''Clip''' filter. If you are interested in knowing the location of a region of cells containing a particular range of values, consider using the '''Contour''' filter to generate surfaces at the ends of the range rather than extract all of the cells with the '''Threshold''' filter. Be aware that substituting filters can have an effect on downstream filters. For example, running the '''Histogram''' filter after '''Threshold''' will have an entirely different effect then running it after the roughly equivalent '''Contour''' filter.</div>Katie.osterdahlhttps://public.kitware.com/Wiki/index.php?title=ParaView/UsersGuide/Filter_Categories&diff=40524ParaView/UsersGuide/Filter Categories2011-06-09T11:25:36Z<p>Katie.osterdahl: </p>
<hr />
<div>== Available Filters ==<br />
<br />
There are many filters available in ParaView ([[ParaView/Users Guide/List of filters |1]]) (and even more in VTK). Because ParaView has a modular architecture, it is routine for people to add additional filters([[ParaView/Users_Guide/Plugins |2]]).<br />
Some filters have obscure purposes and are rarely used, but others are more general purpose and used very frequently. These most common filters are found easily on the '''Common''' ('''View'''|Toolbars) toolbar.<br />
<br />
<br />
[[File:ParaView_UsersGuide_CommonFiltersToolbar.png|thumb|center|450px|'''Figure 5.7''' Common Filters Toolbar]]<br />
<br />
These filters include:<br />
<br />
* '''Calculator''' - Evaluates a user-defined expression on a per-point or per-cell basis ([[ParaView/Users_Guide/Calculator|3]])<br />
* '''Contour''' - Extracts the points, curves, or surfaces where a scalar field is equal to a user-defined value. This surface is often also called an isosurface.<br />
* '''Clip''' - Intersects the geometry with a half space. The effect is to remove all the geometry on one side of a user-defined plane.<br />
* '''Slice''' - Intersects the geometry with a plane. The effect is similar to clipping except that all that remains is the geometry where the plane is located.<br />
* '''Threshold''' - Extracts cells that lie within a specified range of a scalar field.<br />
* '''Extract Subset''' - Extracts a subset of a grid by defining either a volume of interest or a sampling rate.<br />
* '''Glyph''' - Places a glyph, a simple shape, on each point in a mesh. The glyphs may be oriented by a vector and scaled by a vector or scalar.<br />
* '''Stream Tracer''' - Seeds a vector field with points and then traces those seed points through the (steady state) vector field.<br />
* '''Warp''' - Displaces each point in a mesh by a given vector field.<br />
* '''Group Datasets''' - Combines the output of several pipeline objects into a single multi block dataset.<br />
* '''Group Extract Level''' - Extract one or more items from a multi block dataset.<br />
<br />
These eleven filters are a small sampling of what is available in ParaView.<br />
<br />
<br />
In the alphabetical submenu of the Filters menu you will find all of the filters that are useable in your copy of ParaView. Currently there are mote than one hundred of them, so to make them easier to find the Filters menu is organized into submenus. These submenus are organized as follows.<br />
<br />
* '''Recent''' - The filters you've used recently.<br />
* '''Common''' - The common filters. This is the same set of filters as on the common filters toolbar.<br />
* '''Cosmology''' - This contains filters developed at LANL for cosmology research. <br />
* '''Data Analysis''' - The filters designed to retrieve quantitative values from the data. These filters compute data on the mesh, extract elements from the mesh, or plot data.<br />
* '''Statistics''' - This contains filters that provide descriptive statistics of data, primarily in tabular form.<br />
* '''Temporal''' - Filters that analyze or modify data that changes over time.<br />
<br />
All filters can work on data that changes over time because they are re-executed at each time step. Filters in this category have the additional capability to inspect and make use of or even modify the temporal dimension.<br />
<br />
* '''Alphabetical''' - Many filters do not fit into the above categories so all filters can be found here (see Figure 5.8).<br />
<br />
<br />
[[File:ParaView_UsersGuide_FilterMenu.png|thumb|center|600px|'''Figure 5.8''' A portion of the Alphabetical submenu of the Filters menu.]]<br />
<br />
<br />
Searching through these lists of filters, particularly the full alphabetical list, can be cumbersome. To speed up the selection of filters, you should use the quick launch dialog. Choose the first item from the filters menu, or alternatively press either ''CTRL'' and ''SPACE BAR'' (Windows or Linux) or ''ALT'' and ''SPACE BAR'' (Macintosh) together to bring up the Quick Launch dialog. As you type in words or word fragments the dialog lists the filters whose names contain them. Use the up and down arrow key to select from among them and hit ''ENTER'' to create the filter.<br />
<br />
<br />
[[File:ParaView_UsersGuide_QuickLaunchDialog.png|thumb|center|200px|'''Figure 5.9 Quick Launch]]<br />
<br />
<br />
'''Why can't I apply the filter I want?'''<br />
<br />
Note that many of the filters in the menu will be grayed out and not selectable at any given time. That is because any given filter may only operate on particular types of data. For example, the Extract Subset filter will only operate on structured datasets so it is only enabled when the module you are building on top of produces image data, rectilinear grid data, or structured grid data. Likewise, the contour filter requires scalar data and cannot operate directly on datasets that have only vectors. The input restrictions for all filters are listed in the [[ParaViewUsersGuide/List_of_filters| Appendix]] and help menus. <br />
<br />
When the filter you want is not available you should look for a similar filter which will accept your data or apply an intermediate filter which transforms your data into the required format. In ParaView 3.10 you can also ask ParaView to try to do the conversion for you automatically by clicking "Auto convert Properties" in the application [[ParaView/Users_Guide/Settings | settings]]. <br />
<br />
== What does that filter do? ==<br />
<br />
A description of what each filter does, what input data types it accepts and what output data types it produces can be found in the [[ParaViewUsersGuide/List_of_filters|Appendix]] and help menus. For a more complete understanding, remember that most ParaView filters are simply VTK algorithms, each of which is documented online in the VTK (http://www.vtk.org/doc/release/5.6/html/classes.html) and ParaView (http://www.paraview.org/ParaView3/Doc/Nightly/html/classes.html) Doxygen wiki pages.<br />
<br />
<br />
When you are exploring a given dataset, you do not want to have to hunt through the detailed descriptions of all of the filters in order to find the one filter that is needed at any given moment. It is useful then to be aware of the general high-level taxonomy of the different operations that the filters can be logically grouped into.<br />
<br />
These are: <br />
<!-- TODO these lists should be expanded and improved and each filter listed should have a short explanations or at least a links to its entry in the appendix. --><br />
* Attribute Manipulation : Manipulates the field aligned, point aligned and cell aligned data values and in general derive new aligned quantities, including <!-- TODO could have separate categories for quantities derived from geometry, topology like normals, mesh quality, elevation. --> Curvature, Elevation, Generate IDs, Generate Surface Normals, Gradient, Mesh Quality, Principal Component Analysis, and Random Vectors.<br />
<br />
<br />
* Geometric Manipulation : Operates on or manipulates the shape of the data in a spatial context, including <!-- TODO separate category for decimation, refinement -->Reflect, Transform, and Warp<br />
<br />
* Topological operations : Manipulates the connected structure of the data set itself, usually creating or destroying cells, for instance to reduce the data sets memory size while leaving it in the same place in space, including Cell Centers, Clean, Decimate, Extract Surface, Quadric Clustering, Shrink, Smooth, and Tetrahedralize.<br />
<br />
* Sampling : Computes new datasets that represent some essential features from the datasets that they take as input, including Clip, Extract Subset, Extract Selection, Glyph, Streamline, Probe, Plot, Histogram, and Slice.<br />
<br />
* Data Type Conversion : Converts between the various VTK data structures [[ParaView/Users Guide/VTK Data Model| VTK Data Model]] and joins or splits entire data structures, including Append DataSets, Append Geometry, Extract Blocks, Extract AMR Blocks, and Group DataSets.<br />
<br />
* White Box Filters : Performs arbitrary processing as specified at runtime by you the user, including the Calculator and Python Programmable filters.</div>Katie.osterdahlhttps://public.kitware.com/Wiki/index.php?title=ParaView/UsersGuide/Manipulating_the_Pipeline&diff=40506ParaView/UsersGuide/Manipulating the Pipeline2011-06-08T14:31:22Z<p>Katie.osterdahl: </p>
<hr />
<div>== Managing the Pipeline ==<br />
<br />
Data manipulation in ParaView is fairly unique because of the underlying pipeline architecture that it inherits from VTK. Each filter takes in some data and produces something new from it. Filters do not directly modify the data that is given to them and instead copy unmodified data through via reference (so as to conserve memory) and augment that with newly generated or changed data. The fact that input data is never altered in place means that unlike many visualization tools, you can apply several filtering operations in different combinations to your data during a single ParaView session. You see the result of each filter as it is applied, which helps to guide your data exploration work, and can easily display any or all intermediate pipeline outputs simultaneously. <br />
<br />
<br />
The Pipeline Browser depicts ParaView's current visualization pipeline and allows you to easily navigate to the various readers, sources, and filters it contains. Connecting an initial data set loaded from a file or created from a ParaView source to a filter creates a two filter long visualization pipeline. The initial dataset read in becomes the input to the filter, and if needed the output of that filter can be used as the input to a subsequent filter.<br />
<br />
<br />
For example, suppose you create a sphere in ParaView by selecting Sphere from the Sources menu. In this example, the sphere is the initial data set. Next create a Shrink filter from the Alphabetical submenu of the Filters menu. Because the sphere source was the active filter when the shrink filter was created, the shrink filter operates on the sphere source's output. Optionally, use the Properties tab of the Object Inspector to set initial parameters of the shrink filter and then hit Apply. Next create an Elevation filter to filter the output of the shrink filter and hit Apply again. You have just created a simple three element linear pipeline in ParaView. You will now see the following in the Pipeline Browser.<br />
<br />
[[File:ParaView_UsersGuide_LinearPipeline.png|thumb|center|300px|'''Figure 5.2''' Linear pipeline]]<br />
<br />
Within the Pipeline Browser, to the left of each entry is an "eye" icon indicating whether that dataset is currently visible. If there is no eye icon, it means that the data produced by that filter is not compatible with the active view window. Otherwise, a dark eye icon indicates that the data set is visible. When a dataset is viewable but currently invisible, its icon is drawn in light gray. Clicking on the eye icon toggles the visibility of the corresponding data set. In the above example, all three filters are potentially visible, but only the ElevationFilter is actually being displayed. The ElevationFilter is also highlighted in blue, indicating that it is the "active" filter. Since it is the "active" filter, the Object Inspector reflects its content and the next filter created will use it as the input.<br />
<br />
<br />
You can always change parameters of any filter in the pipeline after it has been applied. ''Left-click'' on the filter in the Pipeline Browser to make it active. The Properties, Display, and Information tabs always reflect the active filter. When you make changes in the Properties tab and apply your changes, all filters beyond the changed one are automatically updated. Double-clicking the name of one of the filters causes the name to become editable, enabling you to change it to something more meaningful than the default chosen by ParaView.<br />
<br />
<br />
By default, each filter you add to the pipeline becomes the active filter, which is useful when making linear pipelines. Branching pipelines are also very useful. The simplest way to make one is to click on some other, further upstream filter in the pipeline before you create a new filter. For example, select ShrinkFilter1 in the Pipeline Browser then apply Extract Edges from the Alphabetical submenu of the Filters menu. Now the output of the shrink filter is being used as the input to both the elevation and extract edges filters. You will see the following in the Pipeline Browser.<br />
<br />
[[File:ParaView_UsersGuide_branchingPipeline2.png|thumb|center|300px|'''Figure 5.3''' Branching Pipeline]]<br />
<br />
''Right-clicking'' a filter in the Pipeline Browser displays a context menu from which you can do several things. For reader modules you can use this to load a new data file. All modules can be saved (the filter and the parameters) as a Custom Filter (see the last [[ParaView/UsersGuide/Macros|section]] of this chapter), or deleted if it is at the end of the visualization pipeline. For filter modules, you can also use this menu to change the input to the filter, and thus rearrange the visualization pipeline. <br />
<br />
[[File:ParaView_UsersGuide_PipelineBrowserContextMenu.png|thumb|center|300px|'''Figure 5.4''' Context menu in the Pipeline Browser]]<br />
<br />
To rearrange the pipeline select Change Input from the context menu. That will bring up the Input Editor dialog box as shown in Figure 5.5. The name of the dialog box reflects the filter that you are moving. The middle Select Source pane shows the pipeline as it stands currently and uses this pane to select a filter to move the chosen filter on to. This pane only allows you to choose compatible filters, i.e., ones that produce data that can be ingested by the filter you are moving. It also does not allow you to create loops in the pipeline. Left-click to make your choice from the allowed set of filters and then the rightmost Pipeline Preview pane will show what the pipeline will look like once you commit your change. Click ''OK'' to do so or ''Cancel'' to abort the move.<br />
<br />
[[File:ParaView_UsersGuide_ChangeInputDialog.png|thumb|center|650px|'''Figure 5.5''' Input Editor dialog shown while moving an elevation filter to operate directly on a reader.]]<br />
<br />
Some filters require more than one input. (See the discussion of merging pipelines below). For those the leftmost input port pane of the dialog shows more than one port. Use that together with the Select Source pane to specify each input in turn.<br />
<br />
<br />
Conversely, some filters produce more than one output. Thus another way to make a branching pipeline is to open a reader that produces multiple distinct data sets, for example the SLAC reader that produces both a polygonal output and a structured data field output. Whenever you have a branching pipeline keep in mind that it is important to select the proper branch on which to extend the pipeline. For example, if you want to apply a filter like the Extract Subset filter, which operates only on structured data, you click on the reader's structured data output and make that the active one, if the SLAC reader's polygonal output was selected.<br />
<br />
Some filters that produce multiple datasets do so in a different way. Instead of producing several fundamentally distinct data sets, they produce a single composite dataset which contains many sub data sets. See the [[ParaView/Users Guide/VTK Data Model|Understanding Data]] chapter for an explanation of composite data sets. With composite data it is usually best to treat the entire group as one entity. Sometimes though, you want to operate on a particular set of sub datasets. To do that apply the Extract Block filter. This filter allows you to pick the desired sub data set(s). Next apply the filter you are interested in to the extract filters output. An alternative is to hit 'B' to use [[ParaView/Users Guide/Selection|Block Selection]] in a 3D View and then use the Extract Selection filter.<br />
<br />
Pipelines merge as well, whenever they contain filters that take in more than one input to produce their own output (or outputs). There are in fact two different varieties of merging filters. The Append Geometry and Group Data Sets filters are examples of the first kind. These filters take in any number of fundamentally similar datasets. Append for example takes in one or more polygonal datasets and combines them into a single large polygonal dataset. Group takes in a set of any type of datasets and produces a single composite dataset. To use this type of merging filter, select more than one filter within the Pipeline Browser by left clicking to select the first input and then shift-left clicking to select the rest. Now create the merging filter from the Filters menu as usual. The pipeline in this case will look like the one in Figure 5.6.<br />
<br />
<br />
[[File:ParaView_UsersGuide_mergingPipeline.png|thumb|center|400px|'''Figure 5.6''' Merging pipelines]]<br />
<br />
Other filters take in more than one, fundamentally different data sets. An example is the Resample with Dataset filter which takes in one dataset (the Input) that represents a field in space to sample values from and another data set (the Source) to use as a set of locations in space to sample the values at. Begin this type of merge by choosing either of the two inputs as the active filter and then creating the merging filter from the Filters menu. A modified version of the Change Input dialog shown in Figure 5.5 results (this one that lacks a Pipeline Preview pane). Click on either of the ports listed in the Available Inputs pane and specify an input for it from the Select Input pane. Then switch to the other input in the Available Inputs port and choose the other input on the Select Input pane. When you are satisfied with your choices click ''OK'' on the dialog and then Apply on the Pipeline Browser to create the merging filter.</div>Katie.osterdahlhttps://public.kitware.com/Wiki/index.php?title=ParaView/UsersGuide/Manipulating_the_Pipeline&diff=40505ParaView/UsersGuide/Manipulating the Pipeline2011-06-08T14:03:51Z<p>Katie.osterdahl: </p>
<hr />
<div>== Managing the Pipeline ==<br />
<br />
Data manipulation in ParaView is fairly unique because of the underlying pipeline architecture that it inherits from VTK. Each filter takes in some data and produces something new from it. Filters do not directly modify the data that is given to them and instead copy unmodified data through via reference (so as to conserve memory) and augment that with newly generated or changed data. The fact that input data is never altered in place means that unlike many visualization tools, you can apply several filtering operations in different combinations to your data during a single ParaView session. You see the result of each filter as it is applied, which helps to guide your data exploration work, and can easily display any or all intermediate pipeline outputs simultaneously. <br />
<br />
<br />
The Pipeline Browser depicts ParaView's current visualization pipeline and allows you to easily navigate to the various readers, sources, and filters it contains. Connecting an initial data set loaded from a file or created from a ParaView source to a filter creates a two filter long visualization pipeline. The initial dataset read in becomes the input to the filter, and if needed the output of that filter can be used as the input to a subsequent filter.<br />
<br />
<br />
For example, suppose you create a sphere in ParaView by selecting Sphere from the Sources menu. In this example, the sphere is the initial data set. Next create a Shrink filter from the Alphabetical submenu of the Filters menu. Because the sphere source was the active filter when the shrink filter was created, the shrink filter operates on the sphere source's output. Optionally, use the Properties tab of the Object Inspector to set initial parameters of the shrink filter and then hit Apply. Next create an Elevation filter to filter the output of the shrink filter and hit Apply again. You have just created a simple three element linear pipeline in ParaView. You will now see the following in the Pipeline Browser.<br />
<br />
[[File:ParaView_UsersGuide_LinearPipeline.png|thumb|center|300px|'''Figure 5.2''' Linear pipeline]]<br />
<br />
Within the Pipeline Browser, to the left of each entry is an "eye" icon indicating whether that dataset is currently visible. If there is no eye icon, it means that the data produced by that filter is not compatible with the active view window. Otherwise, a dark eye icon indicates that the data set is visible. When a dataset is viewable but currently invisible, its icon is drawn in light gray. Clicking on the eye icon toggles the visibility of the corresponding data set. In the above example, all three filters are potentially visible, but only the ElevationFilter is actually being displayed. The ElevationFilter is also highlighted in blue, indicating that it is the "active" filter. Since it is the "active" filter, the Object Inspector reflects its content and the next filter created will use it as the input.<br />
<br />
<br />
You can always change parameters of any filter in the pipeline after it has been applied. Left-click on the filter in the '''Pipeline Browser''' to make it the "active" one. The '''Properties''', '''Display''', and '''Information''' tabs are always reflect the "active" filter. When you make changes in the '''Properties''' tab and apply your changes, all filters beyond the changed one are automatically updated. Double-clicking the name of one of the filters causes the name to become editable, enabling you to change it to something more meaningful than the default chosen by ParaView.<br />
<br />
<br />
By default each filter you add to the pipeline becomes the active filter, which is handy when making linear pipelines. Branching pipeline are also very useful. The simplest way to make one is to click on some other, further upstream filter in the pipeline before you create a new filter. For example Select ShrinkFilter1 in the '''Pipeline Browser''' then apply '''Extract Edges''' from the '''Alphabetical''' submenu of the '''Filters''' menu. Now the output of the shrink filter is being used as the input to both the elevation and extract edges filters. You will see the following in the Pipeline Browser.<br />
<br />
<center>[[File:ParaView_UsersGuide_branchingPipeline2.png||link=]]</center><br />
<br />
<center>'''Figure 3. Branching Pipeline'''</center><br />
<br />
<br />
Right-clicking a filter in the ''Pipeline Browser''' displays a context menu from which you can do several things. For reader modules you can use this to load a new data file. All modules can be saved (the filter and the parameters you've set on it) as a Custom Filter (see the last [[ParaView/UsersGuide/Macros|section]] of this chapter), or delete it (if it is at the end of the visualization pipeline). For filter modules you can also use this menu to change the input to the filter, and thus rearrange the visualization pipeline. <br />
<br />
<center>[[File:ParaView_UsersGuide_PipelineBrowserContextMenu.png||link=]]</center><br />
<br />
<center>'''Figure 4. Context menu in Pipeline Browser'''</center><br />
<br />
To rearrange the pipeline select '''Change Input''' from the context menu. That will bring up the '''Input Editor''' dialog box shown in '''Figure 5'''. The name of the dialog box reflect the filter that you are moving. The middle '''Select Source''' pane shows the pipeline as it stands currently and use this pane to select a filter to move the chosen filter on to. This pane only allows you to choose compatible filters. Ie, ones that produce data that can be ingested by the filter you are moving. It also does not allow you to create loops in the pipeline. Left-click to make your choice from the allowed set of filter and then the rightmost '''Pipeline Preview''' pane will show what the pipeline will look like once you commit your change. Click '''OK''' to do so or '''Cancel''' to abort the move.<br />
<br />
<center>[[File:ParaView_UsersGuide_ChangeInputDialog.png||link=]]</center><br />
<br />
<center>'''Figure 5. Input Editor dialog shown while moving an elevation filter to operate directly on a reader.'''</center><br />
<br />
<br />
Some filters require more than one input. (See the discussion of merging pipelines below). For those the leftmost '''input port''' pane of the dialog produces shows more than one port. Use that together with the '''Select Source''' pane to specify each input in turn.<br />
<br />
<br />
Conversely, some filters produce more than one output. Thus another was to make a branching pipeline is simply to open a reader for instance that produces multiple distinct data sets. An example of this is the SLAC reader that produces both a polygonal output and a structured data field output. Whenever you have a branching pipeline keep in mind that it is important to select the proper branch on which to extend the pipeline. For example, if you want to apply a filter like the Extract Subset filter, which operates only on structured data, while SLAC reader's polygonal output is the currently active filter, until you click on the readers structured data output and make that the currently active one.<br />
<br />
Some filters that produce multiple data sets do so in a different way. Instead of producing several fundamentally distinct data sets, they produce a single composite data set which contains many sub data sets. See the [[ParaView/Users Guide/VTK Data Model|Understanding Data]] chapter for an explanation of composite data sets. With composite data it is usually best to treat the entire group as one entity and you do not need to do anything in particular to do so. Sometimes though, you want to operate on a particular set of sub data sets. To do that apply the '''Extract Block''' filter. This filter allows you to pick the desired sub data set(s). Next apply the filter you are actually interested in to the extract filters output. An alternative is to hit 'B' to use '[[ParaView/Users Guide/Selection|Block Selection' in a 3D View and then use the '''Extract Selection''' filter.<br />
<br />
Pipelines merge as well, whenever they contain filters that take in more than one input to produce their own output (or outputs). There are in fact two different varieties of merging filters. The '''Append Geometry''' and '''Group Data Sets''' filters are examples of the first kind. These filters take in any number of fundamentally similar data sets. Append for example takes in one or more polygonal datasets and combines them into a single large polygonal data set. Group takes in a set of any type of datasets and produces a single composite dataset. To use this type of merging filter, select more than one filter within the Pipeline browser by left clicking to select the first input and then shift-left clicking to select the rest. Now create the merging filter from the '''Filters''' menu as usual. The pipeline in this case will look like the one in the following figure.<br />
<br />
<br />
<center>[[File:ParaView_UsersGuide_mergingPipeline.png||link=]]</center><br />
<br />
<center>'''Figure 7. merging pipeline'''</center><br />
<br />
Other filters take in more than one, fundamentally different data sets. An example is the '''Resample with Dataset''' filter which takes in one data set (the '''Input''') that represents a field in space to sample values from and another data set (the '''Source''') to use as a set of locations in space to sample the values at. Begin this type of merge by choosing either of the two inputs as the active filter and then creating the merging filter from the '''Filters''' menu. A modified version of the '''Change Input''' dialog shown in '''Figure 5''' results (this one that lacks a '''Pipeline Preview''' pane). Click on either of the ports listed in the '''Available Inputs''' pane and specify and input for it from the '''Select Input''' pane. Then switch to the other input in the '''Available Inputs''' port and choose the other input on the '''Select Input''' pane. When you are satisfied with your choices click '''OK''' on the dialog and then '''Apply''' on the '''Pipeline Browser''' to create the merging filter.</div>Katie.osterdahlhttps://public.kitware.com/Wiki/index.php?title=ParaView/UsersGuide/Filter_Parameters&diff=40504ParaView/UsersGuide/Filter Parameters2011-06-08T13:58:43Z<p>Katie.osterdahl: </p>
<hr />
<div>== Filter Parameters ==<br />
<br />
Each time a dataset is opened from a file, a source is selected, a filter is applied, or an existing reader, source, or filter (hereafter simply referred to as filter) is selected in the Pipeline Browser, ParaView updates the Object Inspector for the corresponding output dataset. The Object Inspector has three tabs. In this chapter we are primarily concerned with the Properties tab. The [[ParaView/Displaying Data|Display]] tab gives you control over the visual characteristics of the data produced by the filter as displayed in the active view. The [[ParaView/Users Guide/Information Panel|Information]] tab presents meta-information about the data produced by the filter.<br />
<br />
== Properties ==<br />
<br />
From the Properties tab you modify the parameters of the filter, fine tuning what it produces from its input (if any).<br />
For example, a filter that extracts an isocontour will have a control with which to set the isovalue (or isovalues) to extract at. The specific controls and information provided on the tab then are specific to the particular vtkAlgorithm you are working with, but all filters have at least the Apply, Reset, Delete and ? (help) controls. <br />
<br />
[[File:ParaView_UsersGuide_PropertiesTabExample.png|thumb|center|600px|'''Figure 5.1''' Sample properties tab for a cone source]]<br />
<br />
The help button brings up the documentation for the filter in ParaView's help system in which the input restrictions to the filter, output type generated by the filter, and descriptions of each parameter are listed. The same information is repeated in the Appendices [[ParaView/Users Guide/List of readers#Readers|1]], [[ParaView/Users Guide/List of filters|2]] of this book.<br />
<br />
The Delete button removes this filter from the pipeline. The delete button is only enabled when there are no filters further down the pipeline that depend on this filter's output. You have to either use the Pipeline Browser and Object Inspector in conjunction to delete the dependent parts of the pipeline or use Delete All from the Edit menu.<br />
<br />
When a reader, source, or filter is first selected, the associated data set is not immediately created. By default (unless you turn on Auto-Accept in ParaView's settings) the filter will not run until you hit the '''Apply''' button. When you do press apply, ParaView sends the values shown on the Properties tab to the data processing engine and then the pipeline is executed. This delayed commit behavior is important when working with large data, for which any given action might take a long time to finish. <br />
<br />
Until you press Apply and any other time that the values shown on the GUI do not agree with what was last sent to the server, the the Apply button will be highlighted (in blue or green depending on your operating system). In this state the Reset button is also enabled. Pressing that returns the GUI to the last committed state, which gives you an easy way to cancel mistakes you've made before they happen.<br />
<br />
The specific parameter control widgets vary from filter to filter and sometimes vary depending on the exact input to the filter. Some filters have no parameters at all and others have many. Many readers present the list and type of arrays in the file, and allow you to pick some or all of them as you need. In all cases the widgets shown on the Properties tab give you control over exactly what the filter does. If you are unsure of what they do, remember to hit the ? button to see the documentation for that filter. <br />
<br />
Note that ParaView attempts to provide reasonable default settings for the parameter settings and to some extent guards against invalid entries. A numeric entry box will not let you type in non-numerical values for example. Sliders and spin boxes typically have minimum and maximum limits built in. In some cases though you may want to ignore these default limits. Whenever there is a numeric entry beside the widget, you are able to manually type in any number you need to.<br />
<br />
Some filter parameters are best manipulated directly in the 3D View window with the mouse. For example, the Slice filter extracts slices from the data that lie on a set of parallel planes oriented in space. This type of world space interactive control is what [[Users Guide Widgets|3D Widgets]] are for. The textual controls in the Properties Tab and the displayed state of the 3D widgets are always linked so that changing either updates the other. You can of course use the '''Reset''' button to revert changes you make from either place.</div>Katie.osterdahlhttps://public.kitware.com/Wiki/index.php?title=ParaView/UsersGuide/Filtering_Data&diff=40503ParaView/UsersGuide/Filtering Data2011-06-08T13:50:31Z<p>Katie.osterdahl: </p>
<hr />
<div>= Manipulating Data =<br />
<br />
<!-- Overview of how to apply filters <br />
multiple input/output <br />
change input<br />
why are filters disabled<br />
:Apply/Reset<br />
:List of filters in categories: a higher level classification of filters based on their functionality and then refer them to the details given later.<br />
:filters changing data types <br />
:3D widgets -- how they affect parameters and active view etc. <br />
:custom filters --><br />
<br />
In the course of either searching for information within data or in preparing images for publication that explain data, it is often necessary to process the raw data in various ways. Examples include slicing into the data to make the interior visible, extracting regions that have particular qualities, and computing statistical measurements from the data. All of these operations involving taking in some original data and using it to compute some derived quantities. This chapter explains how you control the data processing portion of ParaView's visualization pipeline to do such analyses.<br />
<br />
A filter is the basic tool that you use to manipulate data. If data is a noun, then a filter is the verb that operates on the data. Filters operate by ingesting some data, processing it and producing some other data. In the abstract sense a data reader is a filter as well because it ingests data from the file system. ParaView creates filters when you open data files and instantiate new filters form the Filters menu. The set of filters you create becomes your visualization pipeline, and that pipeline is shown in ParaView's Pipeline Browser.</div>Katie.osterdahlhttps://public.kitware.com/Wiki/index.php?title=ParaView/Displaying_Data&diff=40501ParaView/Displaying Data2011-06-08T13:45:51Z<p>Katie.osterdahl: </p>
<hr />
<div>This chapter covers different mechanisms in ParaView for visualizing data. Through these visualizations, users are able to gain unique insight on their data.<br />
<br />
=Understanding Views=<br />
==Views==<br />
<br />
When the ParaView application starts up, you see a 3D viewport with<br />
an axes at the center. This is a ''view''. In ParaView, views are frames in<br />
which the data can be seen. There are different types of views. The default<br />
view that shows up is a ''3D view'' which shows rendering of the geometry<br />
extracted from the data or volumes or slices in a 3D scene. You can change the<br />
default view in the Settings dialog ('''Edit''' | Settings (in case of Mac OS X,<br />
'''ParaView''' | Preferences)).<br />
<br />
[[Image:ParaViewDisplayingDataFigure1.png|thumb|center|600px|'''Figure 4.1''' ParaView view screen]]<br />
<br />
There may be parameters that are available to the user that control how the data<br />
is displayed e.g. in case of 3D view, the data can be displayed as wireframes or<br />
surfaces, where the user selects the color of the surface or uses a scalar for<br />
coloring etc. All these options are known as Display properties and are<br />
accessible from the Display tab in the Object Inspector.<br />
<br />
Since there can be multiple datasets shown in a view, as well as multiple views,<br />
the Display tabs shows the properties for the active pipeline object<br />
(changed by using the Pipeline Browser, for example) in the active view.<br />
<br />
==Multiple Views==<br />
<br />
ParaView supports showing multiple views side by side. To create multiple views,<br />
use the controls in the top right corner of the view to split the frame<br />
vertically or horizontally. You can also maximize a particular view to<br />
temporarily hide other views. Once a view-frame is split, you will see a list of<br />
buttons showing the different types of views that you can create to place in<br />
that view. Simply click the button to create the view of your choice.<br />
<br />
[[Image:ParaViewDisplayingDataFigure2.png|thumb|center|600px|'''Figure 4.2''' View options in ParaView]]<br />
<br />
Some filters, such as Plot Over Line may automatically split the view<br />
frame and show the data in a particular type of view suitable for the data<br />
generated by the filter.<br />
<br />
==Active View==<br />
<br />
Once you have multiple views, the active view is indicated by a colored border<br />
around the view frame. Several menus as well as toolbar buttons affect the<br />
active view alone. Additionally, they may become enabled/disabled based on whether that<br />
corresponding action is supported by the active view.<br />
<br />
The Display tab affects the active view. Similarly, the eye icon in<br />
the Pipeline Browser, next to the pipeline objects, indicates the visibility<br />
state for that object in the active view.<br />
<br />
When a new filter, source or reader is created, if possible it will be displayed by<br />
default in the active view, otherwise, if will create a new view.<br />
<br />
=Types of Views=<br />
<br />
This section covers the different types of views available in<br />
ParaView. For each view, we will talk about the controls available to change the<br />
view parameters using View Settings as well as the parameters associated<br />
with the '''Display Tab''' for showing data in that view.<br />
<br />
==3D View==<br />
<br />
3D view is used to show the surface or volume rendering for the data in a 3D<br />
world. This is the most commonly used view type.<br />
<br />
When running in client-server mode, 3D view can render data either by bringing<br />
the geometry to the client and then rendering it there or by rendering it on the<br />
server (possibly in parallel) and then delivering the composited images to the<br />
client. Refer to the '''Client-Server Visualization''' chapter for details.<br />
<br />
===Interaction===<br />
<br />
Interacting with the 3D view will typically update the camera. This makes it<br />
possible to explore the visualization scene. The default buttons are shown in Table 4.1 and <br />
they can be changed using the Application Settings dialog.<br />
<br />
{| style="background-color:#ffffcc;" cellpadding="10" cellspacing="0" border="1"<br />
|+'''Table 4.1'''<br />
!Modifier<br />
!Left Button<br />
!Middle Button<br />
!Right Button<br />
|-<br />
|<br />
|Rotate<br />
|Pan<br />
|Zoom<br />
|-<br />
|Shift<br />
|Roll<br />
|Rotate<br />
|Pan<br />
|-<br />
|Control<br />
|Zoom<br />
|Rotate<br />
|Zoom<br />
|}<br />
<br />
This view supports selection. You can select cells or points either on the<br />
surface or those within a frustum. Selecting cells or points makes it possible<br />
to extract those for further inspection or to label them. Details about data<br />
querying and selection can be found the Quantitative analysis chapter.<br />
<br />
===View Settings===<br />
<br />
The View Settings dialog is accessible through the '''Edit''' | View Settings menu or the<br />
tool button in the left corner of the view can be used to change the view settings<br />
per view.<br />
<br />
====General====<br />
<br />
[[Image:ViewSettingsGeneral.png|thumb|center|400px|'''Figure 4.3''' General tab in the View Settings menu]]<br />
<br />
The General tab allows the user to choose the background color. You can use a solid<br />
color, gradient or a background image.<br />
<br />
By default the camera uses perspective projection. To switch to parallel<br />
projection, check the Use Parallel Projection checkbox in this panel.<br />
<br />
====Lights====<br />
<br />
[[Image:ViewSettingsLights.png|thumb|center|400px|'''Figure 4.4''' Lights tab in the View Settings menu ]]<br />
<br />
The 3D View requires lights to illumniate the geometry being rendered in the<br />
scene. You can control these lights using this pane.<br />
<br />
====Annotation====<br />
<br />
[[Image:ViewSettingsAnnotation.png|thumb|center|400px|'''Figure 4.5''' Annotation tab in the View Settings menu]]<br />
<br />
The annotation pane enables control of the visibility of the center axes and<br />
the orientation widget. Users can also make the orientation widget interactive so that they can manually place the widget at location of their liking.<br />
<br />
===Display Properties===<br />
<br />
Users can control how the data from any source or filter is shown in this view<br />
using the Display tab. This section covers the various options<br />
available to a user for controlling appearance of the rendering in the 3D view.<br />
<br />
====View====<br />
The View menu has three options for controlling how the data is viewed. These are described in Table 4.2.<br />
[[Image:3DViewDisplayView.png|thumb|center|400px|'''Figure 4.6''' View menu]]<br />
<br />
{| style="background-color:#ffffcc;" cellpadding="10" cellspacing="0" border="1"<br />
|+''' Table 4.2'''<br />
!Name<br />
!Usage<br />
|-<br />
| Visible<br />
| Checkbox used to toggle the visibility of the data in the view. If it disabled, it implies that the data cannot be shown in this view.<br />
|-<br />
| Selectable<br />
| Checkbox used to toggle whether the data gets selected when using the selection mechanism for selecting and sub-setting data.<br />
|-<br />
| Zoom to Data<br />
| Click this button to zoom the camera so that the dataset is completely fits within the viewport.<br />
|}<br />
<br />
====Color====<br />
[[Image:3DViewDisplayColor.png|thumb|center|400px|'''Figure 4.7''' Color options]]<br />
<br />
The color group allows users to pick the scalar to color with or set a fixed<br />
solid color for the rendering. The options in Figure 4.7 are described in detail in Table 4.3<br />
<br />
{| style="background-color:#ffffcc;" cellpadding="10" cellspacing="0" border="1"<br />
|+'''Table 4.3'''<br />
!Name<br />
!Usage<br />
|-<br />
| Interpolate Scalars<br />
| If selected, the scalars will be interpolated within polygons and the scalar mapping happens on a per pixel basis. If not selected, then color mapping happens at points and colors are interpolated which is typically less accurate. This only affects when coloring with point arrays and has no effect otherwise. This is disabled when coloring using a solid color.<br />
|-<br />
| Map Scalars<br />
| If the data array can be directly interpreted as colors, then you can uncheck this to not use any lookup table. Otherwise, when selected, a lookup table will be used to map scalars to colors. This is disabled when the array is not of a type that can be interpreted as colors (i.e. vtkUnsignedCharArray).<br />
|-<br />
| Apply Texture<br />
| This feature makes it possible to apply a texture over the surface. This requires that the data has texture coordinates. You can use filters like Texture Map to Sphere, Texture Map to Cylinder or Texture Map to Plane to generate texture coordinates when they are not present in the data. To load a texture, select Load from the combo box which will pop up a dialog allowing you to choose an image. Otherwise, select from already loaded textures listed in the combo box.<br />
|-<br />
| Color By<br />
| This feature enables coloring of the surface/volume. Either choose the array to color with or set the solid color to use. When volume rendering, solid coloring is not possible, you must choose the data array to volume render with.<br />
|-<br />
| Set solid color<br />
| Used to set the solid color. This is available only when Color By is set to use Solid Color. ParaView defines a notion of a color palette consisting of different color categories. To choose a color from one of these predefined categories, click the arrow next to this button. It will open up a drop down with options to choose from. If you use a color from the palette, it is possible to globally change the color by changing the color palette e.g. for printing or for display on screen etc.<br />
|-<br />
| Edit Color Map...<br />
| You can edit the color map or lookup table by clicking the Edit Color Map button. It is only shown when an array is chosen in the Color By combo-box.<br />
|}<br />
<br />
====Slice====<br />
[[Image:3DViewDisplaySlice.png|thumb|center|400px|'''Figure 4.8''' Slice options]]<br />
<br />
The slice controls are available only for image datasets (uniform rectilinear grids) when the representation type is Slice. The representation type is<br />
controlled using the ''Style'' group on the Display tab.<br />
These allow the user to pick the slice direction as well as the slice<br />
offset.<br />
<br />
====Annotation====<br />
[[Image:3DViewDisplayCubeAxes.png|thumb|center|400px|'''Figure 4.9''' Annotation options]]<br />
<br />
Cube axes is an annotation box that can be used to show a scale around the<br />
dataset. Use the Show cube axes checkbox to toggle its visibility. You can<br />
further control the apperance of the cube axes by clicking Edit once the<br />
cube-axes is visible.<br />
<br />
[[Image:ParaViewDisplayingDataCubeAxes.png|thumb|center|300px|'''Figure 4.10''' Show cube axes example]]<br />
<br />
====Style====<br />
Figure 4.11 shows the Style dialog box. The options in this dialog box are described in detail in Table 4.4 below.<br />
<br />
[[Image:3DViewDisplayStyle.png|thumb|center|400px|'''Figure 4.11''' Sytle dialog box]]<br />
<br />
{| style="background-color:#ffffcc;" cellpadding="10" cellspacing="0" border="1"<br />
|+'''Table 4.4'''<br />
!Name<br />
!Usage<br />
|-<br />
| Representation<br />
| Use this to change how the data is represented i.e. as a surface, volume,<br />
wireframe, points, or surface with edges.<br />
|-<br />
| Interpolation<br />
| Choose the method used to shade the geometry and interpolate point attributes.<br />
|-<br />
| Point Size<br />
| If your dataset contains points or vertices, this adjusts the diameter of the rendered points. It also affects the point size when Representation is Points.<br />
|-<br />
| Line width<br />
| If your dataset contains lines or edges, this scale adjusts the width of the rendered lines. It also affects the rendered line width when Representation is Wireframe or Surface With Edges.<br />
|-<br />
| Opacity<br />
| Set the opacity of the dataset's geometry. ParaView uses hardware-assisted depth peeling, whenever possible, to remove artifacts due to incorrect sorting order of rendered primitives.<br />
|-<br />
| Volume Mapper<br />
| When Representation is Volume, this combo box allows the user to choose a specific volume rendering technique. The techniques available change based on the type of the dataset.<br />
|-<br />
| Set Edge Color<br />
| This is available when Representation is Surface with Edges. It allows the user to pick the color to use for the edges rendered over the surface.<br />
|}<br />
<br />
====Backface Style====<br />
<br />
[[Image:3DViewDisplayBackface.png|thumb|center|400px|'''Figure 4.12''' Backface Style dialog box]]<br />
<br />
The Backface Style dialog box allows the user to define backface properties. In computer graphics, backface refers to the face of a geometric primitive with the normal point away from the camera. Users can choose to hide the backface or front face, or specify different characteristics for the two faces using these settings.<br />
<br />
====Transformation====<br />
<br />
[[Image:3DViewDisplayTransform.png|thumb|center|400px|'''Figure 4.13''' Transformation dialog box]]<br />
<br />
These settings allow the user to transform the rendered geometry, without actually transforming the data. Note that since this transformation happens during rendering, any filters that you apply to this data source will still be working on the original, untransformed data. Use the Transform filter if you want to transform the data instead.<br />
<br />
==2D View==<br />
<br />
2D View is similar to 3D view except that it can only show slices from uniform<br />
grid datasets i.e. volume datasets or image datasets.<br />
The interaction is also limited to a 2D plane and so rotation is not available. Currently this view does not support selection, which will be supported in future releases.<br />
When you load a 2D image, ParaView by default creates this view.<br />
<br />
Since this view is same as the 3D view, it has the same features in regards to client-server and parallel rendering. <br />
<br />
===Interaction===<br />
Interactions with this view update the camera. The default buttons are described in Table 4.5 and can be changed using the Application Settings dialog.<br />
<br />
{| style="background-color:#ffffcc;" cellpadding="10" cellspacing="0" border="1"<br />
|+'''Table 4.5'''<br />
!Modifier<br />
!Left Button<br />
!Middle Button<br />
!Right Button<br />
|-<br />
|<br />
|Pan<br />
|Pan<br />
|Zoom<br />
|-<br />
|Shift<br />
|Zoom<br />
|Zoom<br />
|Zoom<br />
|-<br />
|Control<br />
|Zoom<br />
|Zoom<br />
|Pan<br />
|}<br />
<br />
Unlike 3D view, this view does not currently support selection. However, that support will be added in future releases.<br />
<br />
===View Settings===<br />
The view settings dialog is accessible through the '''Edit''' | View Settings menu or the tool button in the left corner of the view.<br />
<br />
[[File:ParaViewUsersGuide2DViewSettings.png|thumb|center|300px|'''Figure 4.14''' View settings dialog for the 2D View]]<br />
<br />
In 2D view options, the user can change the background color and toggle the visibility of the axes-box, as in Figure 4.14.<br />
<br />
[[File:ParaViewUsersGuide2DViewAxes.png|thumb|center|300px|'''Figure 4.15''' 2D View showing the axes-box]]<br />
<br />
===Display Properties===<br />
<br />
The display tab for this view is same as the 3D view, except that some options may be unavailable such as changing of representation type.<br />
<br />
==Spreadsheet View==<br />
<br />
Spreadsheet View is used to inspect the raw data in a spreadsheet. When running<br />
in client-server mode, to avoid delivering the entire dataset to the client for<br />
displaying in the spreadsheet (since the data can be very large), this view streams<br />
only visible chunks of the data to the client. As the user scrolls around the<br />
spreadsheet, new data chunks are fetched.<br />
<br />
Unlike some other views, this view can only show one dataset at a time. For<br />
composite datasets, it shows only one block at a time. You can select the block<br />
to show using the Display tab.<br />
<br />
===Interaction===<br />
In regards to usability, this view behaves like typical spreadsheets shown in applications like Microsoft Excel or Apple Pages:<br />
* You can scroll up and down to inspect new rows. <br />
* You can sort any column by clicking on the header for the column. Repeated clicking on the column header toggles the sorting order. When running in parallel, ParaView uses sophisticated parallel sorting algorithms to avoid memory and communication overheads to sort large, distributed datasets.<br />
* You can double-click on a column header to toggle a mode in which only that column is visible. This reduces clutter when you are interested in a single attribute array.<br />
* You can click on rows to select the corresponding elements i.e. cells or points. This is not available when in "Show selected only mode." Also, when you create a selection in other views e.g. the 3D view, the rows corresponding to the selected elements will be highlighted.<br />
<br />
===Header===<br />
<br />
Unlike other views, Spreadsheet View has a header. This header provides quick access to some of the commonly used functionality in this view.<br />
<br />
[[File:ParaViewUsersGuideSpreadsheetViewHeader.png|thumb|center|400px|'''Figure 4.16''' Spreadsheet View Header]]<br />
<br />
Since this view can only show one dataset at a time, you can quickly choose the dataset to show using the Showing combo box. You can choose the attribute type i.e. point attributes, cell attributes, to display using the Attribute combo box. The Precision option controls the number of digits to show after decimal point for floating point numbers. Lastly, the last button allows the user to enter the view in a mode where it only shows the selected rows. This is useful when you create a selection using another view such as the 3D view and want to inspect the details for the selected cells or points.<br />
<br />
===View Settings===<br />
<br />
Currently, no user settable settings are available for this view.<br />
<br />
===Display Properties===<br />
<br />
[[File:ParaViewUsersGuideSpreadsheetView2.png|thumb|center|300px|'''Figure 4.17''' Display tab in the Object Inspector]]<br />
<br />
The display properties for this view provide the same functionality as the header. Additionally, when dealing with composite datasets, the display tab shows a widget allowing the user to choose the block to display in the view.<br />
<br />
==Line Chart View==<br />
<br />
A traditional 2D line plot is often the best option to show trends in small quantities of data. A line plot is also a good choice to examine relationships between different data values that vary over the same domain.<br />
<br />
Any reader, source, or filter that produces plottable data can be displayed in an XY plot view. ParaView stores its plotable data in a table (vtkTable). Using the display properties, users can choose which columns in the table must be plotted on the X and Y axes.<br />
<br />
As with the other view types, what is displayed in the active XY plot view is displayed by and controllable with the eye icons in the Pipeline Browser panel. When an XY plot view is active, only those filters that produce plotable output have eye icons.<br />
<br />
The XY plot view is the preferred view type for the Plot over Line, Plot Point over Time, Plot Cell over Time, Plot Field Variable over Time, and Probe Location over Time filters. Creating any one of these filters will automatically create an XY plot view for displaying its output. Figure 4.18 shows a plot of the data values within a volume as they vary along three separate paths. The top curve comes from the line running across the center of the volume, where the largest values lie. The other two curves come from lines running near the edges of the volume.<br />
<br />
Unlike the 3D and 2D render view, the charting views are client-side views i.e. they deliver the data to be plotted to the client. Hence ParaView only allows results from some standard filters such as Plot over Line in the line chart view by default. However it is also possible to plot cell or point data arrays for any dataset by apply the Plot Data filter.<br />
<br />
[[Image:ParaViewUsersGuideLineChartView.png|thumb|center|600px|'''Figure 4.18''' Plot of data values within a volume]]<br />
<br />
===Interaction===<br />
<br />
The line chart view supports the following interaction modes:<br />
<br />
* ''Right-click'' and ''drag'' to pan<br />
* ''Left-click'' and ''drag'' to select <br />
* ''Middle-click'' and ''drag'' to zoom to region drawn.<br />
* ''Hover'' over any line in the plot to see the details for the data at that location.<br />
<br />
To reset the view, use the Reset Camera button in the Camera Toolbar.<br />
===View Settings===<br />
<br />
The '''View Settings''' for Line Chart enable the user to control the appearance of the chart including titles, axes positions etc. There are several pages available in this dialog. The General page controls the overall appearance of the chart, while the other pages controls the appearance of each of the axes.<br />
<br />
====General Settings Page====<br />
<br />
[[Image:ParaViewUsersGuideChartSettingsGeneral.png|thumb|center|600px|'''Figure 4.19''' General Settings panel]]<br />
<br />
This page allows users to change the title and legend. To show the current animation time in the title text, simply use the keyword ''${TIME}''. Users can further change the font and alignment for the title.<br />
<br />
This page also enables changing the appearance and positioning of the legend.<br />
<br />
====Axis Settings Page====<br />
<br />
On this page you can change the properties of a particular axis. Four pages are provided for each of the axes. By clicking on the name of the axis, you can access the settings page for the corresponding axes.<br />
<br />
[[Image:ParaViewUsersGuideChartSettingsAxis.png|thumb|center|600px|'''Figure 4.20''' Axis Settings panel]]<br />
<br />
<br />
The options on this panel are described below:<br />
Axis<br />
* Show Axis: controls the axis visibility<br />
* Show Axis Grid: controls whether a grid is to be drawn perpendicular to this axis<br />
* Colors: controls the axis and the grid color<br />
<br />
Labels<br />
* Show Axis Labels When Space is Available : controls label visibility along this axis<br />
* Font and Color: controls the label font and color<br />
* Notation: allows user to choose between Mixed, Scientific and Fixed point notations for numbers<br />
* Precision: controls precision after '.' in Scientific and Fixed notations<br />
<br />
====Axis Layout Page====<br />
<br />
This page allows the user to change the axis range and scale.<br />
<br />
[[Image:ParaViewUsersGuideChartSettingsAxisLayout.png|thumb|center|600px|'''Figure 4.21''' Axis Layout panel]]<br />
<br />
<br />
* Use Logarithmic Scale When Available: Check this to use a log scale unless the data contains numbers <= 0.<br />
* Let the Chart Determine the Axis Layout: Select this button to let the chart use the optimal range and spacing for this axis.<br />
* Specify the Axis Range: Select this button to specify the axis range explicitly. The labels are auto-placed within this range.<br />
* Specify Each of the Axis Labels: Select this button to specify each label location on axis explicitly.<br />
<br />
====Axis Title Page====<br />
<br />
This page allows the user to change the title for the axis. You can change the text, color and font for the axis title.<br />
<br />
[[Image:ParaViewUsersGuideChartSettingsAxisTitle.png|thumb|center|600px|'''Figure 4.22''' Axis Title panel]]<br />
<br />
===Display Properties===<br />
<br />
Display Properties for the Line Chart view allow the user to choose what arrays are plotted along which of the axes and the appearance for each of the lines such as its color, thickness and style.<br />
<br />
<br />
[[Image:ParaViewUsersGuideChartDisplayProperties.png|thumb|center|600px|'''Figure 4.23''' Display Properties within the Object Inspector]]<br />
<br />
* Attribute Mode: pick which attribute arrays to plot i.e. point arrays, cell arrays, etc.<br />
* X Axis Data: controls the array to use as the X axis.<br />
** Use Array Index From Y Axis Data: when checked, results in ParaView using the index in data-array are plotted on Y as the X axis.<br />
** Use Data Array: when checked the user can pick an array to be interpreted as the X coordinate.<br />
* Line Series: controls the properties of each of the arrays plotted along the Y axis.<br />
** Variable: check the variable to be plotted. <br />
** Legend Name: click to change the name used in the legend for this array.<br />
<br />
Select any of the series in the list to change following properties for that series. You can select multiple entries to change multiple series.<br />
** Line Color: controls the color for the series.<br />
** Line Thickness: controls the thickness for the series.<br />
** Line Style: controls the style for the line.<br />
** Marker Style: controls the style used for those markers, which can be placed at every data point.<br />
<br />
==Bar Chart View==<br />
<br />
Traditional 2D graphs present some types of information much more readily than 3D renderings do; they are usually the best choice for displaying one and two dimensional data. The bar chart view is very useful for examining the relative quantities of different values within data, for example. <br />
<br />
The bar chart view is used most frequently to display the output of the histogram filter. This filter divides the range of a component of a specified array from the input data set into a specified number of bins, producing a simple sequence of the number of values in the range of each bin. A bar chart is the natural choice for displaying this type of data. In fact, the bar chart view is the preferred view type for the histogram filter. Filters that have a preferred view type will create a view of the preferred type whenever they are instantiated.<br />
<br />
When the new view is created for the histogram filter, the pre-existing 3D view is made smaller to make space for the new chart view. The chart view then becomes the active view, which is denoted with a red border around the view in the display area. Clicking on any view window makes it the active view. The contents of the Object Inspector and Pipeline Browser panels change and menu items are enabled or disabled whenever a different view becomes active to reflect the active view’s settings and available controls. In this way, you can independently control numerous views. Simply make a view active, and then use the rest of the GUI to change it. By default, the changes you make will only affect the active view.<br />
<br />
As with the 3D View, the visibility of different datasets within a bar chart view is displayed and controlled by the eye icons in the Pipeline Browser. The bar chart view can only display datasets that contain chartable data, and when a bar chart view is active, the Pipeline Browser will only display the eye icon next to those datasets that can be charted. <br />
<br />
ParaView stores its chartable data in 1D Rectilinear Grids, where the X locations of the grid contain the bin boundaries, and the cell data contain the counts within each bin. Any source or filter that produces data in this format can be displayed in the bar chart view. Figure 4.24 shows a histogram of the values from a slice of a data set.<br />
<br />
The Edit View Options for chart views dialog allows you to create labels, titles, and legends for the chart and to control the range and scaling of each axis.<br />
<br />
The Interaction, Display Properties as well as View Settings for this view and similar to those for the Line Chart.<br />
<br />
[[Image:ParaViewUsersGuideBarChartView.png|thumb|center|600px|'''Figure 4.24''' Histogram of values from a slice of a dataset]]<br />
<br />
==Color Transfer Functions==<br />
<br />
The interface for changing the color mapping and properties of the scalar bar is accessible from the Display tab of the Object Inspector. Pressing the Edit Color Map button displays the interface for manipulating the color map and scalar bar as shown in Figure 4.25. <br />
<br />
[[File:ParaView_UsersGuide_ColorScaleEditor2.png|thumb|center|600px|'''Figure 4.25''' Color Map Controls]]<br />
<br />
At the top of the Color Scale tab of the Color Scale Editor dialog is an editor for mapping scalar values to colors (for surface rendering) and to opacity (for volume rendering). The scalar range of this color map editor is shown below the Automatically Rescale to Fit Data Range check box. The leftmost sphere corresponds to the minimum scalar value, and the rightmost one corresponds to the maximum. Any interior nodes correspond to values between these two extremes. New nodes may be added to the color editor by left-clicking in the editor; this determines the scalar value associated with the node, but that value may be changed by typing a new value in the Scalar Value text box below the color map editor or by clicking and dragging a node. The scalar value for a particular node may not be changed such that it is less than that for a node left of it or greater than that for a node right of it. When volume rendering, the vertical height of a node indicates its opacity. For surface rendering, opacity is determined for an entire data set, not based on the underlying scalar values.<br />
<br />
When a node in the color map editor is clicked, it becomes highlighted (i.e., drawn larger than the other spheres in the editor). In the example above, the second node from the left has been selected. Clicking again on the selected node displays a color selector from which you may select a new color for the node. Pressing the ‘d’ or Delete key while a node is selected removes that node from the editor. Only the endpoint nodes may not be deleted.<br />
<br />
Below the color map editor (or transfer function editor, for volume rendering) is a set of three text boxes for changing the scalar value, opacity, and scale associated with a given node. Only the scalar value is associated with surface rendering. The scalar values at the endpoints may only be changed if the Automatically Rescale to Fit Data Range check box (discussed later in this section) is unmarked. When volume rendering, you may also specify the opacity and scale per node in the editor. In volume rendering, the opacity is accumulated as you step through the volume being rendered. The Scale value determines the unit distance over which the opacity is accumulated.<br />
<br />
The controls below the set of three text boxes specify the color space and any color map preset you wish to save or use. The color spaces available are '''RGB''' (red, green, blue), '''HSV''' (hue, saturation, value), '''Wrapped HSV''', and '''CIELAB''' (a more perceptually linear color space). The color space determines how the colors are interpolated between specified values; the colors at the color map (or transfer function) editor nodes will remain the same regardless of the color space chosen. If wrapped HSV is used, the interpolation will use the shortest path in hue, even going through the value hue = 0. For non-wrapped HSV, the hue interpolation will not pass through 0. A hue of zero sets the color to red.<br />
<br />
In addition to choosing the color space and modifying the color map or transfer function nodes, you may also create and load preset color scales. When volume rendering, only the color map is stored; the scalar-to-opacity mapping is not. To store your current settings as a preset, click the Save button. In the dialog box that appears, you may enter a name for your new preset. By default, the scalar values from the data array being used are stored in the preset. If you wish these values to be normalized between 0 and 1, press the Normalize button.<br />
<br />
[[File:ParaView_UsersGuide_PresetColorScalesDialog.png|thumb|center|600px|'''Figure 4.26''' Dialog for selecting color scale presets]]<br />
<br />
Any presets you save, in addition to the default ones provided by ParaView, are available by pressing the Choose Preset button, causing the dialog shown below to be displayed. Selecting a preset and clicking OK causes the current color map to be set to the chosen preset. Any user-defined presets may be normalized (as discussed above) or removed from the list of presets entirely using the Normalize and Remove buttons, respectively. The default presets are already normalized and may not be removed from the application.<br />
<br />
Any of the color scale presets may be exported to a file using the Export button in the above dialog. The resulting file(s) may then be copied to another computer for use with ParaView on a different machine. In order to load presets that are stored in such files, press the Import button on the above dialog, and navigate to the desired color preset file.<br />
<br />
If the current dataset is colored by an array of vectors, the Component menu will be enabled. It determines whether the data is colored by a single vector component (X, Y, or Z) or by the vector’s Magnitude (the default). If the data is colored by a single-component (scalar) array, then the Component menu is disabled.<br />
<br />
If Use Logarithmic Scale <nowiki> is checked, then instead of the scalar values in the data array being used directly to determine the colors, the base-10 logarithm of the data array values is computed, and the resulting value is used for extracting a color from the color map. If the data array contains values for which a logarithm would produce invalid results (i.e., any values less than or equal to 0), the range for the color map is changed to [0, 10] so that the logarithm produces valid results.</nowiki><br />
<br />
By default, any data attribute that has been used to color a dataset currently loaded in ParaView, and whose name and number of components match that of the array selected in the Color by menu, contributes to the range of the color map. To change this behavior, first uncheck the Automatically Rescale to Fit Data Range check box. This ensures that the range of the color map is not reset when the range of the data attribute changes. The minimum and maximum values of the color map can be overridden by pressing the Rescale Range button, entering different Minimum and Maximum values in the dialog that appears, and pressing Rescale<nowiki>. This rescales all the nodes in the color map so that the scalar values lie at the same normalized positions. Alternatively, you may modify the scalar values of any node (including the endpoints if </nowiki>Automatically Rescale to Fit Data Range is off) by clicking a node to highlight it and typing a new value in the Scalar Value entry box. By changing the minimum and maximum color map values, it is possible to manually specify what range of data values the color map will cover. Pressing the Rescale to Data Range button on the Color Scale tab of the Color Scale Editor sets the range to cover only the current data set.<br />
<br />
If Use Discrete Colors is checked, the Resolution slider at the bottom of the dialog specifies the number of colors to use in the color map. The scale ranges from 2 to 256 (the default). The fewer the number of colors, the larger the range each color covers. This is useful if the data attribute has a small number of distinct values or if larger ranges of the array values should be mapped to the same color.<br />
<br />
[[File:ParaView_UsersGuide_ColorScaleEditorColorLegend.png|thumb|center|600px|'''Figure 4.27''' Scalar Bar controls]]</div>Katie.osterdahlhttps://public.kitware.com/Wiki/index.php?title=ParaView/Displaying_Data&diff=40499ParaView/Displaying Data2011-06-08T13:35:25Z<p>Katie.osterdahl: </p>
<hr />
<div>This chapter covers different mechanisms in ParaView for visualizing data. Through these visualizations, users are able to gain unique insight on their data.<br />
<br />
=Understanding Views=<br />
==Views==<br />
<br />
When the ParaView application starts up, you see a 3D viewport with<br />
an axes at the center. This is a ''view''. In ParaView, views are frames in<br />
which the data can be seen. There are different types of views. The default<br />
view that shows up is a ''3D view'' which shows rendering of the geometry<br />
extracted from the data or volumes or slices in a 3D scene. You can change the<br />
default view in the Settings dialog ('''Edit''' | Settings (in case of Mac OS X,<br />
'''ParaView''' | Preferences)).<br />
<br />
[[Image:ParaViewDisplayingDataFigure1.png|thumb|center|600px|'''Figure 4.1''' ParaView view screen]]<br />
<br />
There may be parameters that are available to the user that control how the data<br />
is displayed e.g. in case of 3D view, the data can be displayed as wireframes or<br />
surfaces, where the user selects the color of the surface or uses a scalar for<br />
coloring etc. All these options are known as Display properties and are<br />
accessible from the Display tab in the Object Inspector.<br />
<br />
Since there can be multiple datasets shown in a view, as well as multiple views,<br />
the Display tabs shows the properties for the active pipeline object<br />
(changed by using the Pipeline Browser, for example) in the active view.<br />
<br />
==Multiple Views==<br />
<br />
ParaView supports showing multiple views side by side. To create multiple views,<br />
use the controls in the top right corner of the view to split the frame<br />
vertically or horizontally. You can also maximize a particular view to<br />
temporarily hide other views. Once a view-frame is split, you will see a list of<br />
buttons showing the different types of views that you can create to place in<br />
that view. Simply click the button to create the view of your choice.<br />
<br />
[[Image:ParaViewDisplayingDataFigure2.png|thumb|center|600px|'''Figure 4.2''' View options in ParaView]]<br />
<br />
Some filters, such as Plot Over Line may automatically split the view<br />
frame and show the data in a particular type of view suitable for the data<br />
generated by the filter.<br />
<br />
==Active View==<br />
<br />
Once you have multiple views, the active view is indicated by a colored border<br />
around the view frame. Several menus as well as toolbar buttons affect the<br />
active view alone. Additionally, they may become enabled/disabled based on whether that<br />
corresponding action is supported by the active view.<br />
<br />
The Display tab affects the active view. Similarly, the eye icon in<br />
the Pipeline Browser, next to the pipeline objects, indicates the visibility<br />
state for that object in the active view.<br />
<br />
When a new filter, source or reader is created, if possible it will be displayed by<br />
default in the active view, otherwise, if will create a new view.<br />
<br />
=Types of Views=<br />
<br />
This section covers the different types of views available in<br />
ParaView. For each view, we will talk about the controls available to change the<br />
view parameters using View Settings as well as the parameters associated<br />
with the '''Display Tab''' for showing data in that view.<br />
<br />
==3D View==<br />
<br />
3D view is used to show the surface or volume rendering for the data in a 3D<br />
world. This is the most commonly used view type.<br />
<br />
When running in client-server mode, 3D view can render data either by bringing<br />
the geometry to the client and then rendering it there or by rendering it on the<br />
server (possibly in parallel) and then delivering the composited images to the<br />
client. Refer to the '''Client-Server Visualization''' chapter for details.<br />
<br />
===Interaction===<br />
<br />
Interacting with the 3D view will typically update the camera. This makes it<br />
possible to explore the visualization scene. The default buttons are shown in Table 4.1 and <br />
they can be changed using the Application Settings dialog.<br />
<br />
{| style="background-color:#ffffcc;" cellpadding="10" cellspacing="0" border="1"<br />
|+'''Table 4.1'''<br />
!Modifier<br />
!Left Button<br />
!Middle Button<br />
!Right Button<br />
|-<br />
|<br />
|Rotate<br />
|Pan<br />
|Zoom<br />
|-<br />
|Shift<br />
|Roll<br />
|Rotate<br />
|Pan<br />
|-<br />
|Control<br />
|Zoom<br />
|Rotate<br />
|Zoom<br />
|}<br />
<br />
This view supports selection. You can select cells or points either on the<br />
surface or those within a frustum. Selecting cells or points makes it possible<br />
to extract those for further inspection or to label them. Details about data<br />
querying and selection can be found the Quantitative analysis chapter.<br />
<br />
===View Settings===<br />
<br />
The View Settings dialog is accessible through the '''Edit''' | View Settings menu or the<br />
tool button in the left corner of the view can be used to change the view settings<br />
per view.<br />
<br />
====General====<br />
<br />
[[Image:ViewSettingsGeneral.png|thumb|center|400px|'''Figure 4.3''' General tab in the View Settings menu]]<br />
<br />
The General tab allows the user to choose the background color. You can use a solid<br />
color, gradient or a background image.<br />
<br />
By default the camera uses perspective projection. To switch to parallel<br />
projection, check the Use Parallel Projection checkbox in this panel.<br />
<br />
====Lights====<br />
<br />
[[Image:ViewSettingsLights.png|thumb|center|400px|'''Figure 4.4''' Lights tab in the View Settings menu ]]<br />
<br />
The 3D View requires lights to illumniate the geometry being rendered in the<br />
scene. You can control these lights using this pane.<br />
<br />
====Annotation====<br />
<br />
[[Image:ViewSettingsAnnotation.png|thumb|center|400px|'''Figure 4.5''' Annotation tab in the View Settings menu]]<br />
<br />
The annotation pane enables control of the visibility of the center axes and<br />
the orientation widget. Users can also make the orientation widget interactive so that they can manually place the widget at location of their liking.<br />
<br />
===Display Properties===<br />
<br />
Users can control how the data from any source or filter is shown in this view<br />
using the Display tab. This section covers the various options<br />
available to a user for controlling appearance of the rendering in the 3D view.<br />
<br />
====View====<br />
The View menu has three options for controlling how the data is viewed. These are described in Table 4.2.<br />
[[Image:3DViewDisplayView.png|thumb|center|400px|'''Figure 4.6''' View menu]]<br />
<br />
{| style="background-color:#ffffcc;" cellpadding="10" cellspacing="0" border="1"<br />
|+''' Table 4.2'''<br />
!Name<br />
!Usage<br />
|-<br />
| Visible<br />
| Checkbox used to toggle the visibility of the data in the view. If it disabled, it implies that the data cannot be shown in this view.<br />
|-<br />
| Selectable<br />
| Checkbox used to toggle whether the data gets selected when using the selection mechanism for selecting and sub-setting data.<br />
|-<br />
| Zoom to Data<br />
| Click this button to zoom the camera so that the dataset is completely fits within the viewport.<br />
|}<br />
<br />
====Color====<br />
[[Image:3DViewDisplayColor.png|thumb|center|400px|'''Figure 4.7''' Color options]]<br />
<br />
The color group allows users to pick the scalar to color with or set a fixed<br />
solid color for the rendering. The options in Figure 4.7 are described in detail in Table 4.3<br />
<br />
{| style="background-color:#ffffcc;" cellpadding="10" cellspacing="0" border="1"<br />
|+'''Table 4.3'''<br />
!Name<br />
!Usage<br />
|-<br />
| Interpolate Scalars<br />
| If selected, the scalars will be interpolated within polygons and the scalar mapping happens on a per pixel basis. If not selected, then color mapping happens at points and colors are interpolated which is typically less accurate. This only affects when coloring with point arrays and has no effect otherwise. This is disabled when coloring using a solid color.<br />
|-<br />
| Map Scalars<br />
| If the data array can be directly interpreted as colors, then you can uncheck this to not use any lookup table. Otherwise, when selected, a lookup table will be used to map scalars to colors. This is disabled when the array is not of a type that can be interpreted as colors (i.e. vtkUnsignedCharArray).<br />
|-<br />
| Apply Texture<br />
| This feature makes it possible to apply a texture over the surface. This requires that the data has texture coordinates. You can use filters like Texture Map to Sphere, Texture Map to Cylinder or Texture Map to Plane to generate texture coordinates when they are not present in the data. To load a texture, select Load from the combo box which will pop up a dialog allowing you to choose an image. Otherwise, select from already loaded textures listed in the combo box.<br />
|-<br />
| Color By<br />
| This feature enables coloring of the surface/volume. Either choose the array to color with or set the solid color to use. When volume rendering, solid coloring is not possible, you must choose the data array to volume render with.<br />
|-<br />
| Set solid color<br />
| Used to set the solid color. This is available only when Color By is set to use Solid Color. ParaView defines a notion of a color palette consisting of different color categories. To choose a color from one of these predefined categories, click the arrow next to this button. It will open up a drop down with options to choose from. If you use a color from the palette, it is possible to globally change the color by changing the color palette e.g. for printing or for display on screen etc.<br />
|-<br />
| Edit Color Map...<br />
| You can edit the color map or lookup table by clicking the Edit Color Map button. It is only shown when an array is chosen in the Color By combo-box.<br />
|}<br />
<br />
====Slice====<br />
[[Image:3DViewDisplaySlice.png|thumb|center|400px|'''Figure 4.8''' Slice options]]<br />
<br />
The slice controls are available only for image datasets (uniform rectilinear grids) when the representation type is Slice. The representation type is<br />
controlled using the ''Style'' group on the Display tab.<br />
These allow the user to pick the slice direction as well as the slice<br />
offset.<br />
<br />
====Annotation====<br />
[[Image:3DViewDisplayCubeAxes.png|thumb|center|400px|'''Figure 4.9''' Annotation options]]<br />
<br />
Cube axes is an annotation box that can be used to show a scale around the<br />
dataset. Use the Show cube axes checkbox to toggle its visibility. You can<br />
further control the apperance of the cube axes by clicking Edit once the<br />
cube-axes is visible.<br />
<br />
[[Image:ParaViewDisplayingDataCubeAxes.png|thumb|center|300px|'''Figure 4.10''' Show cube axes example]]<br />
<br />
====Style====<br />
Figure 4.11 shows the Style dialog box. The options in this dialog box are described in detail in Table 4.4 below.<br />
<br />
[[Image:3DViewDisplayStyle.png|thumb|center|400px|'''Figure 4.11''' Sytle dialog box]]<br />
<br />
{| style="background-color:#ffffcc;" cellpadding="10" cellspacing="0" border="1"<br />
|+'''Table 4.4'''<br />
!Name<br />
!Usage<br />
|-<br />
| Representation<br />
| Use this to change how the data is represented i.e. as a surface, volume,<br />
wireframe, points, or surface with edges.<br />
|-<br />
| Interpolation<br />
| Choose the method used to shade the geometry and interpolate point attributes.<br />
|-<br />
| Point Size<br />
| If your dataset contains points or vertices, this adjusts the diameter of the rendered points. It also affects the point size when Representation is Points.<br />
|-<br />
| Line width<br />
| If your dataset contains lines or edges, this scale adjusts the width of the rendered lines. It also affects the rendered line width when Representation is Wireframe or Surface With Edges.<br />
|-<br />
| Opacity<br />
| Set the opacity of the dataset's geometry. ParaView uses hardware-assisted depth peeling, whenever possible, to remove artifacts due to incorrect sorting order of rendered primitives.<br />
|-<br />
| Volume Mapper<br />
| When Representation is Volume, this combo box allows the user to choose a specific volume rendering technique. The techniques available change based on the type of the dataset.<br />
|-<br />
| Set Edge Color<br />
| This is available when Representation is Surface with Edges. It allows the user to pick the color to use for the edges rendered over the surface.<br />
|}<br />
<br />
====Backface Style====<br />
<br />
[[Image:3DViewDisplayBackface.png|thumb|center|400px|'''Figure 4.12''' Backface Style dialog box]]<br />
<br />
The Backface Style dialog box allows the user to define backface properties. In computer graphics, backface refers to the face of a geometric primitive with the normal point away from the camera. Users can choose to hide the backface or front face, or specify different characteristics for the two faces using these settings.<br />
<br />
====Transformation====<br />
<br />
[[Image:3DViewDisplayTransform.png|thumb|center|400px|'''Figure 4.13''' Transformation dialog box]]<br />
<br />
These settings allow the user to transform the rendered geometry, without actually transforming the data. Note that since this transformation happens during rendering, any filters that you apply to this data source will still be working on the original, untransformed data. Use the Transform filter if you want to transform the data instead.<br />
<br />
==2D View==<br />
<br />
2D View is similar to 3D view except that it can only show slices from uniform<br />
grid datasets i.e. volume datasets or image datasets.<br />
The interaction is also limited to a 2D plane and so rotation is not available. Currently this view does not support selection, which will be supported in future releases.<br />
When you load a 2D image, ParaView by default creates this view.<br />
<br />
Since this view is same as the 3D view, it has the same features in regards to client-server and parallel rendering. <br />
<br />
===Interaction===<br />
Interactions with this view update the camera. The default buttons are described in Table 4.5 and can be changed using the Application Settings dialog.<br />
<br />
{| style="background-color:#ffffcc;" cellpadding="10" cellspacing="0" border="1"<br />
|+'''Table 4.5'''<br />
!Modifier<br />
!Left Button<br />
!Middle Button<br />
!Right Button<br />
|-<br />
|<br />
|Pan<br />
|Pan<br />
|Zoom<br />
|-<br />
|Shift<br />
|Zoom<br />
|Zoom<br />
|Zoom<br />
|-<br />
|Control<br />
|Zoom<br />
|Zoom<br />
|Pan<br />
|}<br />
<br />
Unlike 3D view, this view does not currently support selection. However, that support will be added in future releases.<br />
<br />
===View Settings===<br />
The view settings dialog is accessible through the '''Edit''' | View Settings menu or the tool button in the left corner of the view.<br />
<br />
[[File:ParaViewUsersGuide2DViewSettings.png|thumb|center|300px|'''Figure 4.14''' View settings dialog for the 2D View]]<br />
<br />
In 2D view options, the user can change the background color and toggle the visibility of the axes-box, as in Figure 4.14.<br />
<br />
[[File:ParaViewUsersGuide2DViewAxes.png|thumb|center|300px|'''Figure 4.15''' 2D View showing the axes-box]]<br />
<br />
===Display Properties===<br />
<br />
The display tab for this view is same as the 3D view, except that some options may be unavailable such as changing of representation type.<br />
<br />
==Spreadsheet View==<br />
<br />
Spreadsheet View is used to inspect the raw data in a spreadsheet. When running<br />
in client-server mode, to avoid delivering the entire dataset to the client for<br />
displaying in the spreadsheet (since the data can be very large), this view streams<br />
only visible chunks of the data to the client. As the user scrolls around the<br />
spreadsheet, new data chunks are fetched.<br />
<br />
Unlike some other views, this view can only show one dataset at a time. For<br />
composite datasets, it shows only one block at a time. You can select the block<br />
to show using the Display tab.<br />
<br />
===Interaction===<br />
In regards to usability, this view behaves like typical spreadsheets shown in applications like Microsoft Excel or Apple Pages:<br />
* You can scroll up and down to inspect new rows. <br />
* You can sort any column by clicking on the header for the column. Repeated clicking on the column header toggles the sorting order. When running in parallel, ParaView uses sophisticated parallel sorting algorithms to avoid memory and communication overheads to sort large, distributed datasets.<br />
* You can double-click on a column header to toggle a mode in which only that column is visible. This reduces clutter when you are interested in a single attribute array.<br />
* You can click on rows to select the corresponding elements i.e. cells or points. This is not available when in "Show selected only mode." Also, when you create a selection in other views e.g. the 3D view, the rows corresponding to the selected elements will be highlighted.<br />
<br />
===Header===<br />
<br />
Unlike other views, Spreadsheet View has a header. This header provides quick access to some of the commonly used functionality in this view.<br />
<br />
[[File:ParaViewUsersGuideSpreadsheetViewHeader.png|thumb|center|400px|'''Figure 4.16''' Spreadsheet View Header]]<br />
<br />
Since this view can only show one dataset at a time, you can quickly choose the dataset to show using the Showing combo box. You can choose the attribute type i.e. point attributes, cell attributes, to display using the Attribute combo box. The Precision option controls the number of digits to show after decimal point for floating point numbers. Lastly, the last button allows the user to enter the view in a mode where it only shows the selected rows. This is useful when you create a selection using another view such as the 3D view and want to inspect the details for the selected cells or points.<br />
<br />
===View Settings===<br />
<br />
Currently, no user settable settings are available for this view.<br />
<br />
===Display Properties===<br />
<br />
[[File:ParaViewUsersGuideSpreadsheetView2.png|thumb|center|300px|'''Figure 4.17''' Display tab in the Object Inspector]]<br />
<br />
The display properties for this view provide the same functionality as the header. Additionally, when dealing with composite datasets, the display tab shows a widget allowing the user to choose the block to display in the view.<br />
<br />
==Line Chart View==<br />
<br />
A traditional 2D line plot is often the best option to show trends in small quantities of data. A line plot is also a good choice to examine relationships between different data values that vary over the same domain.<br />
<br />
Any reader, source, or filter that produces plottable data can be displayed in an XY plot view. ParaView stores its plotable data in a table (vtkTable). Using the display properties, users can choose which columns in the table must be plotted on the X and Y axes.<br />
<br />
As with the other view types, what is displayed in the active XY plot view is displayed by and controllable with the eye icons in the Pipeline Browser panel. When an XY plot view is active, only those filters that produce plotable output have eye icons.<br />
<br />
The XY plot view is the preferred view type for the Plot over Line, Plot Point over Time, Plot Cell over Time, Plot Field Variable over Time, and Probe Location over Time filters. Creating any one of these filters will automatically create an XY plot view for displaying its output. Figure 4.18 shows a plot of the data values within a volume as they vary along three separate paths. The top curve comes from the line running across the center of the volume, where the largest values lie. The other two curves come from lines running near the edges of the volume.<br />
<br />
Unlike the 3D and 2D render view, the charting views are client-side views i.e. they deliver the data to be plotted to the client. Hence ParaView only allows results from some standard filters such as Plot over Line in the line chart view by default. However it is also possible to plot cell or point data arrays for any dataset by apply the Plot Data filter.<br />
<br />
[[Image:ParaViewUsersGuideLineChartView.png|thumb|center|600px|'''Figure 4.18''' Plot of data values within a volume]]<br />
<br />
===Interaction===<br />
<br />
The line chart view supports the following interaction modes:<br />
<br />
* ''Right-click'' and ''drag'' to pan<br />
* ''Left-click'' and ''drag'' to select <br />
* ''Middle-click'' and ''drag'' to zoom to region drawn.<br />
* ''Hover'' over any line in the plot to see the details for the data at that location.<br />
<br />
To reset the view, use the Reset Camera button in the Camera Toolbar.<br />
===View Settings===<br />
<br />
The '''View Settings''' for Line Chart enable the user to control the appearance of the chart including titles, axes positions etc. There are several pages available in this dialog. The General page controls the overall appearance of the chart, while the other pages controls the appearance of each of the axes.<br />
<br />
====General Settings Page====<br />
<br />
[[Image:ParaViewUsersGuideChartSettingsGeneral.png|thumb|center|600px|'''Figure 4.19''' General Settings panel]]<br />
<br />
This page allows users to change the title and legend. To show the current animation time in the title text, simply use the keyword ''${TIME}''. Users can further change the font and alignment for the title.<br />
<br />
This page also enables changing the appearance and positioning of the legend.<br />
<br />
====Axis Settings Page====<br />
<br />
On this page you can change the properties of a particular axis. Four pages are provided for each of the axes. By clicking on the name of the axis, you can access the settings page for the corresponding axes.<br />
<br />
[[Image:ParaViewUsersGuideChartSettingsAxis.png|thumb|center|600px|'''Figure 4.20''' Axis Settings panel]]<br />
<br />
<br />
The options on this panel are described below:<br />
Axis<br />
* Show Axis: controls the axis visibility<br />
* Show Axis Grid: controls whether a grid is to be drawn perpendicular to this axis<br />
* Colors: controls the axis and the grid color<br />
<br />
Labels<br />
* Show Axis Labels When Space is Available : controls label visibility along this axis<br />
* Font and Color: controls the label font and color<br />
* Notation: allows user to choose between Mixed, Scientific and Fixed point notations for numbers<br />
* Precision: controls precision after '.' in Scientific and Fixed notations<br />
<br />
====Axis Layout Page====<br />
<br />
This page allows the user to change the axis range and scale.<br />
<br />
[[Image:ParaViewUsersGuideChartSettingsAxisLayout.png|thumb|center|600px|'''Figure 4.21''' Axis Layout panel]]<br />
<br />
<br />
* Use Logarithmic Scale When Available: Check this to use a log scale unless the data contains numbers <= 0.<br />
* Let the Chart Determine the Axis Layout: Select this button to let the chart use the optimal range and spacing for this axis.<br />
* Specify the Axis Range: Select this button to specify the axis range explicitly. The labels are auto-placed within this range.<br />
* Specify Each of the Axis Labels: Select this button to specify each label location on axis explicitly.<br />
<br />
====Axis Title Page====<br />
<br />
This page allows the user to change the title for the axis. You can change the text, color and font for the axis title.<br />
<br />
[[Image:ParaViewUsersGuideChartSettingsAxisTitle.png|thumb|center|600px|'''Figure 4.22''' Axis Title panel]]<br />
<br />
===Display Properties===<br />
<br />
Display Properties for the Line Chart view allow the user to choose what arrays are plotted along which of the axes and the appearance for each of the lines such as its color, thickness and style.<br />
<br />
<br />
[[Image:ParaViewUsersGuideChartDisplayProperties.png|thumb|center|600px|'''Figure 4.23''' Display Properties within the Object Inspector]]<br />
<br />
* Attribute Mode: pick which attribute arrays to plot i.e. point arrays, cell arrays, etc.<br />
* X Axis Data: controls the array to use as the X axis.<br />
** Use Array Index From Y Axis Data: when checked, results in ParaView using the index in data-array are plotted on Y as the X axis.<br />
** Use Data Array: when checked the user can pick an array to be interpreted as the X coordinate.<br />
* Line Series: controls the properties of each of the arrays plotted along the Y axis.<br />
** Variable: check the variable to be plotted. <br />
** Legend Name: click to change the name used in the legend for this array.<br />
<br />
Select any of the series in the list to change following properties for that series. You can select multiple entries to change multiple series.<br />
** Line Color: controls the color for the series.<br />
** Line Thickness: controls the thickness for the series.<br />
** Line Style: controls the style for the line.<br />
** Marker Style: controls the style used for those markers, which can be placed at every data point.<br />
<br />
==Bar Chart View==<br />
<br />
Traditional 2D graphs present some types of information much more readily than 3D renderings do; they are usually the best choice for displaying one and two dimensional data. The bar chart view is very useful for examining the relative quantities of different values within data, for example. <br />
<br />
The bar chart view is used most frequently to display the output of the histogram filter. This filter divides the range of a component of a specified array from the input data set into a specified number of bins, producing a simple sequence of the number of values in the range of each bin. A bar chart is the natural choice for displaying this type of data. In fact, the bar chart view is the preferred view type for the histogram filter. Filters that have a preferred view type will create a view of the preferred type whenever they are instantiated.<br />
<br />
When the new view is created for the histogram filter, the pre-existing 3D view is made smaller to make space for the new chart view. The chart view then becomes the active view, which is denoted with a red border around the view in the display area. Clicking on any view window makes it the active view. The contents of the Object Inspector and Pipeline Browser panels change and menu items are enabled or disabled whenever a different view becomes active to reflect the active view’s settings and available controls. In this way, you can independently control numerous views. Simply make a view active, and then use the rest of the GUI to change it. By default, the changes you make will only affect the active view.<br />
<br />
As with the 3D View, the visibility of different datasets within a bar chart view is displayed and controlled by the eye icons in the Pipeline Browser. The bar chart view can only display datasets that contain chartable data, and when a bar chart view is active, the Pipeline Browser will only display the eye icon next to those datasets that can be charted. <br />
<br />
ParaView stores its chartable data in 1D Rectilinear Grids, where the X locations of the grid contain the bin boundaries, and the cell data contain the counts within each bin. Any source or filter that produces data in this format can be displayed in the bar chart view. Figure 4.24 shows a histogram of the values from a slice of a data set.<br />
<br />
The Edit View Options for chart views dialog allows you to create labels, titles, and legends for the chart and to control the range and scaling of each axis.<br />
<br />
The Interaction, Display Properties as well as View Settings for this view and similar to those for the Line Chart.<br />
<br />
[[Image:ParaViewUsersGuideBarChartView.png|thumb|center|600px|'''Figure 4.24''' Histogram of values from a slice of a dataset]]<br />
<br />
==Color Transfer Functions==<br />
<br />
The interface for changing the color mapping and properties of the scalar bar is accessible from the '''Display''' tab of the '''Object Inspector'''. Pressing the '''Edit Color Map''' button displays the interface for manipulating the color map and scalar bar as shown below. <br />
<br />
<center>[[File:ParaView_UsersGuide_ColorScaleEditor2.png||link=]]</center><br />
<br />
<center>'''Figure 1. Color Map Controls'''</center><br />
<br />
At the top of the '''Color Scale''' tab of the '''Color Scale Editor''' dialog is an editor for mapping scalar values to colors (for surface rendering) and also to opacity (for volume rendering). The scalar range of this color map editor is shown below the '''Automatically Rescale to Fit Data Range''' check box. The leftmost sphere corresponds to the minimum scalar value, and the rightmost one corresponds to the maximum. Any interior nodes correspond to values between these two extremes. New nodes may be added to the color editor by left-clicking in the editor; this determines the scalar value associated with the node, but that value may be changed by typing a new value in the '''Scalar Value''' text box below the color map editor or by clicking and dragging a node. (The scalar value for a particular node may not be changed such that it is less than that for a node left of it or greater than that for a node right of it.) When volume rendering, the vertical height of a node indicates its opacity. For surface rendering, opacity is determined for an entire data set, not based on the underlying scalar values.<br />
<br />
When a node in the color map editor is clicked, it becomes highlighted (i.e., drawn larger than the other spheres in the editor). In the example above, the second node from the left has been selected. Clicking again on the selected node displays a color chooser from which you may select a new color for the node. Pressing the ‘d’ or Delete key while a node is selected removes that node from the editor. Only the endpoint nodes may not be deleted.<br />
<br />
Below the color map editor (or transfer function editor, for volume rendering) is a set of three text boxes for changing the scalar value, opacity, and scale associated with a given node. Only the scalar value is associated with surface rendering. The scalar values at the endpoints may only be changed if the '''Automatically Rescale to Fit Data Range''' check box (discussed later in this section) is unmarked. When volume rendering, you may also specify the opacity and scale per node in the editor. In volume rendering, the opacity is accumulated as you step through the volume being rendered. The '''Scale''' value determines the unit distance over which the opacity is accumulated.<br />
<br />
The controls below the set of three text boxes specify the color space and any color map preset you wish to save or use. The color spaces available are '''RGB''' (red, green, blue), '''HSV''' (hue, saturation, value), '''Wrapped HSV''', and '''CIELAB''' (a more perceptually linear color space). The color space determines how the colors are interpolated between specified values; the colors at the color map (or transfer function) editor nodes will remain the same regardless of the color space chosen. If wrapped HSV is used, the interpolation will use the shortest path in hue, even going through the value hue = 0. For non-wrapped HSV, the hue interpolation will not pass through 0. (A hue of zero sets the color to red.)<br />
<br />
In addition to choosing the color space and modifying the color map / transfer function nodes, you may also create and load preset color scales. (When volume rendering, only the color map is stored; the scalar-to-opacity mapping is not.) To store your current settings as a preset, click the '''Save''' button. In the dialog box that appears, you may enter a name for your new preset. By default, the scalar values from the data array being used are stored in the preset. If you wish these values to be normalized between 0 and 1, press the '''Normalize''' button.<br />
<br />
<center>[[File:ParaView_UsersGuide_PresetColorScalesDialog.png||link=]]</center><br />
<br />
<center>'''Figure 2. Dialog for choosing color scale presets.'''</center><br />
<br />
Any presets you save, in addition to the default ones provided by ParaView, are available by pressing the '''Choose Preset''' button, causing the dialog shown below to be displayed. Selecting a preset and clicking '''OK''' causes the current color map to be set to the chosen preset. Any user-defined presets may be normalized (as discussed above) or removed from the list of presets entirely using the '''Normalize''' and '''Remove''' buttons, respectively. (The default presets are already normalized and may not be removed from the application.)<br />
<br />
Any of the color scale presets may be exported to a file using the '''Export''' button in the above dialog. The resulting file(s) may then be copied to another computer for use with ParaView on a different machine. In order to load presets that are stored in such files, press the '''Import '''button on the above dialog, and navigate to the desired color preset file.<br />
<br />
If the current data set is colored by an array of vectors, the '''Component''' menu will be enabled. It determines whether the data is colored by a single vector component ('''X''', '''Y''', or '''Z''') or by the vector’s '''Magnitude''' (the default). If the data is colored by a single-component (scalar) array, then the '''Component''' menu is disabled.<br />
<br />
If '''Use Logarithmic Scale'''<nowiki> is checked, then instead of the scalar values in the data array being used directly to determine the colors, the base-10 logarithm of the data array values is computed, and the resulting value is used for extracting a color from the color map. If the data array contains values for which a logarithm would produce invalid results (i.e., any values less than or equal to 0), the range for the color map is changed to [0, 10] so that the logarithm produces valid results.</nowiki><br />
<br />
By default, any data attribute that has been used to color a data set currently loaded in ParaView whose name and number of components match that of the array selected in the '''Color by''' menu contributes to the range of the color map. To change this behavior, first uncheck the '''Automatically Rescale to Fit Data Range''' check box. (This ensures that the range of the color map is not reset when the range of the data attribute changes.) The minimum and maximum values of the color map can be overridden by pressing the '''Rescale Range''' button, entering different '''Minimum''' and '''Maximum''' values in the dialog that appears, and pressing '''Rescale'''<nowiki>; this rescales all the nodes in the color map so that the scalar values lie at the same normalized positions. Alternatively, you may modify the scalar values of any node (including the endpoints if </nowiki>'''Automatically Rescale to Fit Data Range''' is off) by clicking a node to highlight it and typing a new value in the '''Scalar Value''' entry box. By changing the minimum and maximum color map values, it is possible to manually specify what range of data values the color map will cover. Pressing the '''Rescale to Data Range''' button on the '''Color Scale''' tab of the '''Color Scale Editor '''sets the range to cover only the current data set.<br />
<br />
If '''Use Discrete Colors''' is checked, the '''Resolution''' slider at the bottom of the dialog specifies the number of colors to in the color map. The scale ranges from 2 to 256 (the default). The fewer the number of colors, the larger the range each color covers. This is useful if the data attribute has a small number of distinct values or if larger ranges of the array values should be mapped to the same color.<br />
<br />
<center>[[File:ParaView_UsersGuide_ColorScaleEditorColorLegend.png||link=]]</center><br />
<br />
<center>'''Figure 3. Scalar Bar controls'''</center></div>Katie.osterdahlhttps://public.kitware.com/Wiki/index.php?title=ParaView/Displaying_Data&diff=40497ParaView/Displaying Data2011-06-08T13:16:48Z<p>Katie.osterdahl: /* General Settings Page */</p>
<hr />
<div>This chapter covers different mechanisms in ParaView for visualizing data. Through these visualizations, users are able to gain unique insight on their data.<br />
<br />
=Understanding Views=<br />
==Views==<br />
<br />
When the ParaView application starts up, you see a 3D viewport with<br />
an axes at the center. This is a ''view''. In ParaView, views are frames in<br />
which the data can be seen. There are different types of views. The default<br />
view that shows up is a ''3D view'' which shows rendering of the geometry<br />
extracted from the data or volumes or slices in a 3D scene. You can change the<br />
default view in the Settings dialog ('''Edit''' | Settings (in case of Mac OS X,<br />
'''ParaView''' | Preferences)).<br />
<br />
[[Image:ParaViewDisplayingDataFigure1.png|thumb|center|600px|'''Figure 4.1''' ParaView view screen]]<br />
<br />
There may be parameters that are available to the user that control how the data<br />
is displayed e.g. in case of 3D view, the data can be displayed as wireframes or<br />
surfaces, where the user selects the color of the surface or uses a scalar for<br />
coloring etc. All these options are known as Display properties and are<br />
accessible from the Display tab in the Object Inspector.<br />
<br />
Since there can be multiple datasets shown in a view, as well as multiple views,<br />
the Display tabs shows the properties for the active pipeline object<br />
(changed by using the Pipeline Browser, for example) in the active view.<br />
<br />
==Multiple Views==<br />
<br />
ParaView supports showing multiple views side by side. To create multiple views,<br />
use the controls in the top right corner of the view to split the frame<br />
vertically or horizontally. You can also maximize a particular view to<br />
temporarily hide other views. Once a view-frame is split, you will see a list of<br />
buttons showing the different types of views that you can create to place in<br />
that view. Simply click the button to create the view of your choice.<br />
<br />
[[Image:ParaViewDisplayingDataFigure2.png|thumb|center|600px|'''Figure 4.2''' View options in ParaView]]<br />
<br />
Some filters, such as Plot Over Line may automatically split the view<br />
frame and show the data in a particular type of view suitable for the data<br />
generated by the filter.<br />
<br />
==Active View==<br />
<br />
Once you have multiple views, the active view is indicated by a colored border<br />
around the view frame. Several menus as well as toolbar buttons affect the<br />
active view alone. Additionally, they may become enabled/disabled based on whether that<br />
corresponding action is supported by the active view.<br />
<br />
The Display tab affects the active view. Similarly, the eye icon in<br />
the Pipeline Browser, next to the pipeline objects, indicates the visibility<br />
state for that object in the active view.<br />
<br />
When a new filter, source or reader is created, if possible it will be displayed by<br />
default in the active view, otherwise, if will create a new view.<br />
<br />
=Types of Views=<br />
<br />
This section covers the different types of views available in<br />
ParaView. For each view, we will talk about the controls available to change the<br />
view parameters using View Settings as well as the parameters associated<br />
with the '''Display Tab''' for showing data in that view.<br />
<br />
==3D View==<br />
<br />
3D view is used to show the surface or volume rendering for the data in a 3D<br />
world. This is the most commonly used view type.<br />
<br />
When running in client-server mode, 3D view can render data either by bringing<br />
the geometry to the client and then rendering it there or by rendering it on the<br />
server (possibly in parallel) and then delivering the composited images to the<br />
client. Refer to the '''Client-Server Visualization''' chapter for details.<br />
<br />
===Interaction===<br />
<br />
Interacting with the 3D view will typically update the camera. This makes it<br />
possible to explore the visualization scene. The default buttons are shown in Table 4.1 and <br />
they can be changed using the Application Settings dialog.<br />
<br />
{| style="background-color:#ffffcc;" cellpadding="10" cellspacing="0" border="1"<br />
|+'''Table 4.1'''<br />
!Modifier<br />
!Left Button<br />
!Middle Button<br />
!Right Button<br />
|-<br />
|<br />
|Rotate<br />
|Pan<br />
|Zoom<br />
|-<br />
|Shift<br />
|Roll<br />
|Rotate<br />
|Pan<br />
|-<br />
|Control<br />
|Zoom<br />
|Rotate<br />
|Zoom<br />
|}<br />
<br />
This view supports selection. You can select cells or points either on the<br />
surface or those within a frustum. Selecting cells or points makes it possible<br />
to extract those for further inspection or to label them. Details about data<br />
querying and selection can be found the Quantitative analysis chapter.<br />
<br />
===View Settings===<br />
<br />
The View Settings dialog is accessible through the '''Edit''' | View Settings menu or the<br />
tool button in the left corner of the view can be used to change the view settings<br />
per view.<br />
<br />
====General====<br />
<br />
[[Image:ViewSettingsGeneral.png|thumb|center|400px|'''Figure 4.3''' General tab in the View Settings menu]]<br />
<br />
The General tab allows the user to choose the background color. You can use a solid<br />
color, gradient or a background image.<br />
<br />
By default the camera uses perspective projection. To switch to parallel<br />
projection, check the Use Parallel Projection checkbox in this panel.<br />
<br />
====Lights====<br />
<br />
[[Image:ViewSettingsLights.png|thumb|center|400px|'''Figure 4.4''' Lights tab in the View Settings menu ]]<br />
<br />
The 3D View requires lights to illumniate the geometry being rendered in the<br />
scene. You can control these lights using this pane.<br />
<br />
====Annotation====<br />
<br />
[[Image:ViewSettingsAnnotation.png|thumb|center|400px|'''Figure 4.5''' Annotation tab in the View Settings menu]]<br />
<br />
The annotation pane enables control of the visibility of the center axes and<br />
the orientation widget. Users can also make the orientation widget interactive so that they can manually place the widget at location of their liking.<br />
<br />
===Display Properties===<br />
<br />
Users can control how the data from any source or filter is shown in this view<br />
using the Display tab. This section covers the various options<br />
available to a user for controlling appearance of the rendering in the 3D view.<br />
<br />
====View====<br />
The View menu has three options for controlling how the data is viewed. These are described in Table 4.2.<br />
[[Image:3DViewDisplayView.png|thumb|center|400px|'''Figure 4.6''' View menu]]<br />
<br />
{| style="background-color:#ffffcc;" cellpadding="10" cellspacing="0" border="1"<br />
|+''' Table 4.2'''<br />
!Name<br />
!Usage<br />
|-<br />
| Visible<br />
| Checkbox used to toggle the visibility of the data in the view. If it disabled, it implies that the data cannot be shown in this view.<br />
|-<br />
| Selectable<br />
| Checkbox used to toggle whether the data gets selected when using the selection mechanism for selecting and sub-setting data.<br />
|-<br />
| Zoom to Data<br />
| Click this button to zoom the camera so that the dataset is completely fits within the viewport.<br />
|}<br />
<br />
====Color====<br />
[[Image:3DViewDisplayColor.png|thumb|center|400px|'''Figure 4.7''' Color options]]<br />
<br />
The color group allows users to pick the scalar to color with or set a fixed<br />
solid color for the rendering. The options in Figure 4.7 are described in detail in Table 4.3<br />
<br />
{| style="background-color:#ffffcc;" cellpadding="10" cellspacing="0" border="1"<br />
|+'''Table 4.3'''<br />
!Name<br />
!Usage<br />
|-<br />
| Interpolate Scalars<br />
| If selected, the scalars will be interpolated within polygons and the scalar mapping happens on a per pixel basis. If not selected, then color mapping happens at points and colors are interpolated which is typically less accurate. This only affects when coloring with point arrays and has no effect otherwise. This is disabled when coloring using a solid color.<br />
|-<br />
| Map Scalars<br />
| If the data array can be directly interpreted as colors, then you can uncheck this to not use any lookup table. Otherwise, when selected, a lookup table will be used to map scalars to colors. This is disabled when the array is not of a type that can be interpreted as colors (i.e. vtkUnsignedCharArray).<br />
|-<br />
| Apply Texture<br />
| This feature makes it possible to apply a texture over the surface. This requires that the data has texture coordinates. You can use filters like Texture Map to Sphere, Texture Map to Cylinder or Texture Map to Plane to generate texture coordinates when they are not present in the data. To load a texture, select Load from the combo box which will pop up a dialog allowing you to choose an image. Otherwise, select from already loaded textures listed in the combo box.<br />
|-<br />
| Color By<br />
| This feature enables coloring of the surface/volume. Either choose the array to color with or set the solid color to use. When volume rendering, solid coloring is not possible, you must choose the data array to volume render with.<br />
|-<br />
| Set solid color<br />
| Used to set the solid color. This is available only when Color By is set to use Solid Color. ParaView defines a notion of a color palette consisting of different color categories. To choose a color from one of these predefined categories, click the arrow next to this button. It will open up a drop down with options to choose from. If you use a color from the palette, it is possible to globally change the color by changing the color palette e.g. for printing or for display on screen etc.<br />
|-<br />
| Edit Color Map...<br />
| You can edit the color map or lookup table by clicking the Edit Color Map button. It is only shown when an array is chosen in the Color By combo-box.<br />
|}<br />
<br />
====Slice====<br />
[[Image:3DViewDisplaySlice.png|thumb|center|400px|'''Figure 4.8''' Slice options]]<br />
<br />
The slice controls are available only for image datasets (uniform rectilinear grids) when the representation type is Slice. The representation type is<br />
controlled using the ''Style'' group on the Display tab.<br />
These allow the user to pick the slice direction as well as the slice<br />
offset.<br />
<br />
====Annotation====<br />
[[Image:3DViewDisplayCubeAxes.png|thumb|center|400px|'''Figure 4.9''' Annotation options]]<br />
<br />
Cube axes is an annotation box that can be used to show a scale around the<br />
dataset. Use the Show cube axes checkbox to toggle its visibility. You can<br />
further control the apperance of the cube axes by clicking Edit once the<br />
cube-axes is visible.<br />
<br />
[[Image:ParaViewDisplayingDataCubeAxes.png|thumb|center|300px|'''Figure 4.10''' Show cube axes example]]<br />
<br />
====Style====<br />
Figure 4.11 shows the Style dialog box. The options in this dialog box are described in detail in Table 4.4 below.<br />
<br />
[[Image:3DViewDisplayStyle.png|thumb|center|400px|'''Figure 4.11''' Sytle dialog box]]<br />
<br />
{| style="background-color:#ffffcc;" cellpadding="10" cellspacing="0" border="1"<br />
|+'''Table 4.4'''<br />
!Name<br />
!Usage<br />
|-<br />
| Representation<br />
| Use this to change how the data is represented i.e. as a surface, volume,<br />
wireframe, points, or surface with edges.<br />
|-<br />
| Interpolation<br />
| Choose the method used to shade the geometry and interpolate point attributes.<br />
|-<br />
| Point Size<br />
| If your dataset contains points or vertices, this adjusts the diameter of the rendered points. It also affects the point size when Representation is Points.<br />
|-<br />
| Line width<br />
| If your dataset contains lines or edges, this scale adjusts the width of the rendered lines. It also affects the rendered line width when Representation is Wireframe or Surface With Edges.<br />
|-<br />
| Opacity<br />
| Set the opacity of the dataset's geometry. ParaView uses hardware-assisted depth peeling, whenever possible, to remove artifacts due to incorrect sorting order of rendered primitives.<br />
|-<br />
| Volume Mapper<br />
| When Representation is Volume, this combo box allows the user to choose a specific volume rendering technique. The techniques available change based on the type of the dataset.<br />
|-<br />
| Set Edge Color<br />
| This is available when Representation is Surface with Edges. It allows the user to pick the color to use for the edges rendered over the surface.<br />
|}<br />
<br />
====Backface Style====<br />
<br />
[[Image:3DViewDisplayBackface.png|thumb|center|400px|'''Figure 4.12''' Backface Style dialog box]]<br />
<br />
The Backface Style dialog box allows the user to define backface properties. In computer graphics, backface refers to the face of a geometric primitive with the normal point away from the camera. Users can choose to hide the backface or front face, or specify different characteristics for the two faces using these settings.<br />
<br />
====Transformation====<br />
<br />
[[Image:3DViewDisplayTransform.png|thumb|center|400px|'''Figure 4.13''' Transformation dialog box]]<br />
<br />
These settings allow the user to transform the rendered geometry, without actually transforming the data. Note that since this transformation happens during rendering, any filters that you apply to this data source will still be working on the original, untransformed data. Use the Transform filter if you want to transform the data instead.<br />
<br />
==2D View==<br />
<br />
2D View is similar to 3D view except that it can only show slices from uniform<br />
grid datasets i.e. volume datasets or image datasets.<br />
The interaction is also limited to a 2D plane and so rotation is not available. Currently this view does not support selection, which will be supported in future releases.<br />
When you load a 2D image, ParaView by default creates this view.<br />
<br />
Since this view is same as the 3D view, it has the same features in regards to client-server and parallel rendering. <br />
<br />
===Interaction===<br />
Interactions with this view update the camera. The default buttons are described in Table 4.5 and can be changed using the Application Settings dialog.<br />
<br />
{| style="background-color:#ffffcc;" cellpadding="10" cellspacing="0" border="1"<br />
|+'''Table 4.5'''<br />
!Modifier<br />
!Left Button<br />
!Middle Button<br />
!Right Button<br />
|-<br />
|<br />
|Pan<br />
|Pan<br />
|Zoom<br />
|-<br />
|Shift<br />
|Zoom<br />
|Zoom<br />
|Zoom<br />
|-<br />
|Control<br />
|Zoom<br />
|Zoom<br />
|Pan<br />
|}<br />
<br />
Unlike 3D view, this view does not currently support selection. However, that support will be added in future releases.<br />
<br />
===View Settings===<br />
The view settings dialog is accessible through the '''Edit''' | View Settings menu or the tool button in the left corner of the view.<br />
<br />
[[File:ParaViewUsersGuide2DViewSettings.png|thumb|center|300px|'''Figure 4.14''' View settings dialog for the 2D View]]<br />
<br />
In 2D view options, the user can change the background color and toggle the visibility of the axes-box, as in Figure 4.14.<br />
<br />
[[File:ParaViewUsersGuide2DViewAxes.png|thumb|center|300px|'''Figure 4.15''' 2D View showing the axes-box]]<br />
<br />
===Display Properties===<br />
<br />
The display tab for this view is same as the 3D view, except that some options may be unavailable such as changing of representation type.<br />
<br />
==Spreadsheet View==<br />
<br />
Spreadsheet View is used to inspect the raw data in a spreadsheet. When running<br />
in client-server mode, to avoid delivering the entire dataset to the client for<br />
displaying in the spreadsheet (since the data can be very large), this view streams<br />
only visible chunks of the data to the client. As the user scrolls around the<br />
spreadsheet, new data chunks are fetched.<br />
<br />
Unlike some other views, this view can only show one dataset at a time. For<br />
composite datasets, it shows only one block at a time. You can select the block<br />
to show using the Display tab.<br />
<br />
===Interaction===<br />
In regards to usability, this view behaves like typical spreadsheets shown in applications like Microsoft Excel or Apple Pages:<br />
* You can scroll up and down to inspect new rows. <br />
* You can sort any column by clicking on the header for the column. Repeated clicking on the column header toggles the sorting order. When running in parallel, ParaView uses sophisticated parallel sorting algorithms to avoid memory and communication overheads to sort large, distributed datasets.<br />
* You can double-click on a column header to toggle a mode in which only that column is visible. This reduces clutter when you are interested in a single attribute array.<br />
* You can click on rows to select the corresponding elements i.e. cells or points. This is not available when in "Show selected only mode." Also, when you create a selection in other views e.g. the 3D view, the rows corresponding to the selected elements will be highlighted.<br />
<br />
===Header===<br />
<br />
Unlike other views, Spreadsheet View has a header. This header provides quick access to some of the commonly used functionality in this view.<br />
<br />
[[File:ParaViewUsersGuideSpreadsheetViewHeader.png|thumb|center|400px|'''Figure 4.16''' Spreadsheet View Header]]<br />
<br />
Since this view can only show one dataset at a time, you can quickly choose the dataset to show using the Showing combo box. You can choose the attribute type i.e. point attributes, cell attributes, to display using the Attribute combo box. The Precision option controls the number of digits to show after decimal point for floating point numbers. Lastly, the last button allows the user to enter the view in a mode where it only shows the selected rows. This is useful when you create a selection using another view such as the 3D view and want to inspect the details for the selected cells or points.<br />
<br />
===View Settings===<br />
<br />
Currently, no user settable settings are available for this view.<br />
<br />
===Display Properties===<br />
<br />
[[File:ParaViewUsersGuideSpreadsheetView2.png|thumb|center|300px|'''Figure 4.17''' Display tab in the Object Inspector]]<br />
<br />
The display properties for this view provide the same functionality as the header. Additionally, when dealing with composite datasets, the display tab shows a widget allowing the user to choose the block to display in the view.<br />
<br />
==Line Chart View==<br />
<br />
A traditional 2D line plot is often the best option to show trends in small quantities of data. A line plot is also a good choice to examine relationships between different data values that vary over the same domain.<br />
<br />
Any reader, source, or filter that produces plottable data can be displayed in an XY plot view. ParaView stores its plotable data in a table (vtkTable). Using the display properties, users can choose which columns in the table must be plotted on the X and Y axes.<br />
<br />
As with the other view types, what is displayed in the active XY plot view is displayed by and controllable with the eye icons in the Pipeline Browser panel. When an XY plot view is active, only those filters that produce plotable output have eye icons.<br />
<br />
The XY plot view is the preferred view type for the Plot over Line, Plot Point over Time, Plot Cell over Time, Plot Field Variable over Time, and Probe Location over Time filters. Creating any one of these filters will automatically create an XY plot view for displaying its output. Figure 4.18 shows a plot of the data values within a volume as they vary along three separate paths. The top curve comes from the line running across the center of the volume, where the largest values lie. The other two curves come from lines running near the edges of the volume.<br />
<br />
Unlike the 3D and 2D render view, the charting views are client-side views i.e. they deliver the data to be plotted to the client. Hence ParaView only allows results from some standard filters such as Plot over Line in the line chart view by default. However it is also possible to plot cell or point data arrays for any dataset by apply the Plot Data filter.<br />
<br />
[[Image:ParaViewUsersGuideLineChartView.png|thumb|center|400px|'''Figure 4.18''' Plot of data values within a volume]]<br />
<br />
===Interaction===<br />
<br />
The line chart view supports the following interaction modes:<br />
<br />
* ''Right-click'' and ''drag'' to pan<br />
* ''Left-click'' and ''drag'' to select <br />
* ''Middle-click'' and ''drag'' to zoom to region drawn.<br />
* ''Hover'' over any line in the plot to see the details for the data at that location.<br />
<br />
To reset the view, use the Reset Camera button in the Camera Toolbar.<br />
===View Settings===<br />
<br />
The '''View Settings''' for Line Chart enable the user to control the appearance of the chart including titles, axes positions etc. There are several pages available in this dialog. The '''General''' page controls the overall appearance of the chart, while the other pages controls the appearance of each of the axes.<br />
<br />
====General Settings Page====<br />
<br />
[[Image:ParaViewUsersGuideChartSettingsGeneral.png|thumb|center|600px|'''Figure 4.19''' View Settings dialog box]]<br />
<br />
This page allows users to change the title and legend. To show the current animation time in the title text, simply use the keyword ''${TIME}''. Users can further change the font and alignment for the title.<br />
<br />
This page also enables changing the appearance and positioning of the legend.<br />
<br />
====Axis Settings Page====<br />
<br />
This page allows changing the properties of a particular axis. Four pages are provided for each of the axes. By clicking on the name of the axis, one can access the settings page for the corresponding axes.<br />
<br />
[[Image:ParaViewUsersGuideChartSettingsAxis.png]]<br />
<br />
* Axis<br />
** '''Show Axis''' : controls the axis visibility.<br />
** '''Show Axis Grid''': controls whether a grid is to be drawn perpendicular to this axis.<br />
** '''Colors''': enables changing the axis as well as the grid color.<br />
<br />
* Labels<br />
** '''Show Axis Labels When Space is Available''' : controls label visibility along this axis.<br />
** '''Font''' and '''Color''': enables changing the label font and color.<br />
** '''Notation''': allows user to choose between '''Mixed''', '''Scientific''' and '''Fixed''' point notations for numbers.<br />
** '''Precision''': controls precision after '.' in '''Scientific''' and '''Fixed''' notations.<br />
<br />
====Axis Layout Page====<br />
<br />
This page allows the user to change the axis range and scale.<br />
<br />
[[Image:ParaViewUsersGuideChartSettingsAxisLayout.png]]<br />
<br />
<br />
* '''Use Logarithmic Scale When Available''': check this to use a log scale unless the data contains numbers <= 0.<br />
* '''Let the Chart Determine the Axis Layout''': pick this radio button to let the chart use the optimal range and spacing for this axis.<br />
* '''Specify the Axis Range''': pick this radio button to specify the axis range explicitly. The labels are auto-placed within this range.<br />
* '''Specify Each of the Axis Labels''': pick this radio button to specify each label location on axis explicitly.<br />
<br />
====Axis Title Page====<br />
<br />
This page allows the user to change the title for the axis. One can change the text as well as color and font for the axis title.<br />
<br />
[[Image:ParaViewUsersGuideChartSettingsAxisTitle.png]]<br />
<br />
===Display Properties===<br />
<br />
Display Properties for the Line Chart view allow the user to choose what arrays are plotted along which of the axes as well as the appearance for each of the lines such as its color, thickness and style.<br />
<br />
<br />
[[Image:ParaViewUsersGuideChartDisplayProperties.png]]<br />
<br />
* '''Attribute Mode''' : pick which attribute arrays to plot i.e. point arrays or cell arrays etc.<br />
* '''X Axis Data''' : controls the array to use as the X-axis.<br />
** '''Use Array Index From Y Axis Data''' : when checked results in ParaView simply using the index in data-array plotted on Y as the x axis.<br />
** '''Use Data Array''': when checked the user can pick an array to be interpreted as the x co-ordinate.<br />
* '''Line Series''' : controls the properties of each of the arrays plotted along the y-axis.<br />
** '''Variable''' : check the variable to be plotted. <br />
** '''Legend Name''' : click to change the name used in the legend for this array.<br />
<br />
Select any of the series in the list to change following properties for that series. One can select multiple entries to change multiple series.<br />
** '''Line Color''' : controls the color for the series.<br />
** '''Line Thickness''' : controls the thickness for the series.<br />
** '''Line Style''' : controls the style for the line.<br />
** '''Marker Style''' : markers can be placed at every data point. This controls the style used for those markers.<br />
** '''Chart Axes''' :<br />
<br />
==Bar Chart View==<br />
<br />
Traditional 2D graphs present some types of information much more readily than 3D renderings do; they are usually the best choice for displaying one and two dimensional data. The Bar Chart View is very useful for examining the relative quantities of different values within data, for example. <br />
<br />
The Bart Chart View is used most frequently to display the output of the Histogram filter. This filter divides the range of a component of a specified array from the input data set into a specified number of bins, producing a simple sequence of the number of values in the range of each bin. A Bar Chart is the natural choice for displaying this type of data. In fact the Bar Chart View is the preferred View type for the Histogram filter. Filters that have a preferred View type will create a View of the preferred type whenever they are instantiated.<br />
<br />
When the new View is created for the histogram filter, the pre-existing 3D view is made smaller to make space for the new Chart View. The Chart View then becomes the Active View, which is denoted with a red border around the View in the display area. Clicking on any View window makes it the active View. The contents of the Object Inspector and Pipeline Browser panels change and menu items are enabled or disabled whenever a different View becomes active to reflect the Active View’s settings and available controls. In this way, you can independently control numerous Views. Simply make a View active, and then use the rest of the GUI to change it. By default, the changes you make will only affect the active View.<br />
<br />
As with the 3D View, the visibility of different datasets within a Bar Chart View is displayed and controlled by the eye icons in the Pipeline Browser. The Bar Chart View can only display datasets that contain chartable data, and when a Bar Chart View is active, the Pipeline Browser will only display the eye icon next to those datasets that can be charted. <br />
<br />
ParaView stores its chartable data in 1D Rectilinear Grids, where the X locations of the grid contain the bin boundaries, and the cell data contain the counts within each bin. Any source or filter that produces data in this format can be displayed in the Bar Chart View. Figure 46 shows a histogram of the values from a slice of a data set.<br />
<br />
The Chart View’s Edit View Options dialog allows you to create labels, titles, and legends for the chart and to control the range and scaling of each axis.<br />
<br />
The '''Interaction''', '''Display Properties''' as well as '''View Settings''' for this view and similar to those for the Line Chart.<br />
<br />
[[Image:ParaViewUsersGuideBarChartView.png|600px]]<br />
<br />
==Color Transfer Functions==<br />
<br />
The interface for changing the color mapping and properties of the scalar bar is accessible from the '''Display''' tab of the '''Object Inspector'''. Pressing the '''Edit Color Map''' button displays the interface for manipulating the color map and scalar bar as shown below. <br />
<br />
<center>[[File:ParaView_UsersGuide_ColorScaleEditor2.png||link=]]</center><br />
<br />
<center>'''Figure 1. Color Map Controls'''</center><br />
<br />
At the top of the '''Color Scale''' tab of the '''Color Scale Editor''' dialog is an editor for mapping scalar values to colors (for surface rendering) and also to opacity (for volume rendering). The scalar range of this color map editor is shown below the '''Automatically Rescale to Fit Data Range''' check box. The leftmost sphere corresponds to the minimum scalar value, and the rightmost one corresponds to the maximum. Any interior nodes correspond to values between these two extremes. New nodes may be added to the color editor by left-clicking in the editor; this determines the scalar value associated with the node, but that value may be changed by typing a new value in the '''Scalar Value''' text box below the color map editor or by clicking and dragging a node. (The scalar value for a particular node may not be changed such that it is less than that for a node left of it or greater than that for a node right of it.) When volume rendering, the vertical height of a node indicates its opacity. For surface rendering, opacity is determined for an entire data set, not based on the underlying scalar values.<br />
<br />
When a node in the color map editor is clicked, it becomes highlighted (i.e., drawn larger than the other spheres in the editor). In the example above, the second node from the left has been selected. Clicking again on the selected node displays a color chooser from which you may select a new color for the node. Pressing the ‘d’ or Delete key while a node is selected removes that node from the editor. Only the endpoint nodes may not be deleted.<br />
<br />
Below the color map editor (or transfer function editor, for volume rendering) is a set of three text boxes for changing the scalar value, opacity, and scale associated with a given node. Only the scalar value is associated with surface rendering. The scalar values at the endpoints may only be changed if the '''Automatically Rescale to Fit Data Range''' check box (discussed later in this section) is unmarked. When volume rendering, you may also specify the opacity and scale per node in the editor. In volume rendering, the opacity is accumulated as you step through the volume being rendered. The '''Scale''' value determines the unit distance over which the opacity is accumulated.<br />
<br />
The controls below the set of three text boxes specify the color space and any color map preset you wish to save or use. The color spaces available are '''RGB''' (red, green, blue), '''HSV''' (hue, saturation, value), '''Wrapped HSV''', and '''CIELAB''' (a more perceptually linear color space). The color space determines how the colors are interpolated between specified values; the colors at the color map (or transfer function) editor nodes will remain the same regardless of the color space chosen. If wrapped HSV is used, the interpolation will use the shortest path in hue, even going through the value hue = 0. For non-wrapped HSV, the hue interpolation will not pass through 0. (A hue of zero sets the color to red.)<br />
<br />
In addition to choosing the color space and modifying the color map / transfer function nodes, you may also create and load preset color scales. (When volume rendering, only the color map is stored; the scalar-to-opacity mapping is not.) To store your current settings as a preset, click the '''Save''' button. In the dialog box that appears, you may enter a name for your new preset. By default, the scalar values from the data array being used are stored in the preset. If you wish these values to be normalized between 0 and 1, press the '''Normalize''' button.<br />
<br />
<center>[[File:ParaView_UsersGuide_PresetColorScalesDialog.png||link=]]</center><br />
<br />
<center>'''Figure 2. Dialog for choosing color scale presets.'''</center><br />
<br />
Any presets you save, in addition to the default ones provided by ParaView, are available by pressing the '''Choose Preset''' button, causing the dialog shown below to be displayed. Selecting a preset and clicking '''OK''' causes the current color map to be set to the chosen preset. Any user-defined presets may be normalized (as discussed above) or removed from the list of presets entirely using the '''Normalize''' and '''Remove''' buttons, respectively. (The default presets are already normalized and may not be removed from the application.)<br />
<br />
Any of the color scale presets may be exported to a file using the '''Export''' button in the above dialog. The resulting file(s) may then be copied to another computer for use with ParaView on a different machine. In order to load presets that are stored in such files, press the '''Import '''button on the above dialog, and navigate to the desired color preset file.<br />
<br />
If the current data set is colored by an array of vectors, the '''Component''' menu will be enabled. It determines whether the data is colored by a single vector component ('''X''', '''Y''', or '''Z''') or by the vector’s '''Magnitude''' (the default). If the data is colored by a single-component (scalar) array, then the '''Component''' menu is disabled.<br />
<br />
If '''Use Logarithmic Scale'''<nowiki> is checked, then instead of the scalar values in the data array being used directly to determine the colors, the base-10 logarithm of the data array values is computed, and the resulting value is used for extracting a color from the color map. If the data array contains values for which a logarithm would produce invalid results (i.e., any values less than or equal to 0), the range for the color map is changed to [0, 10] so that the logarithm produces valid results.</nowiki><br />
<br />
By default, any data attribute that has been used to color a data set currently loaded in ParaView whose name and number of components match that of the array selected in the '''Color by''' menu contributes to the range of the color map. To change this behavior, first uncheck the '''Automatically Rescale to Fit Data Range''' check box. (This ensures that the range of the color map is not reset when the range of the data attribute changes.) The minimum and maximum values of the color map can be overridden by pressing the '''Rescale Range''' button, entering different '''Minimum''' and '''Maximum''' values in the dialog that appears, and pressing '''Rescale'''<nowiki>; this rescales all the nodes in the color map so that the scalar values lie at the same normalized positions. Alternatively, you may modify the scalar values of any node (including the endpoints if </nowiki>'''Automatically Rescale to Fit Data Range''' is off) by clicking a node to highlight it and typing a new value in the '''Scalar Value''' entry box. By changing the minimum and maximum color map values, it is possible to manually specify what range of data values the color map will cover. Pressing the '''Rescale to Data Range''' button on the '''Color Scale''' tab of the '''Color Scale Editor '''sets the range to cover only the current data set.<br />
<br />
If '''Use Discrete Colors''' is checked, the '''Resolution''' slider at the bottom of the dialog specifies the number of colors to in the color map. The scale ranges from 2 to 256 (the default). The fewer the number of colors, the larger the range each color covers. This is useful if the data attribute has a small number of distinct values or if larger ranges of the array values should be mapped to the same color.<br />
<br />
<center>[[File:ParaView_UsersGuide_ColorScaleEditorColorLegend.png||link=]]</center><br />
<br />
<center>'''Figure 3. Scalar Bar controls'''</center></div>Katie.osterdahlhttps://public.kitware.com/Wiki/index.php?title=ParaView/Displaying_Data&diff=40269ParaView/Displaying Data2011-05-31T12:42:16Z<p>Katie.osterdahl: </p>
<hr />
<div>This chapter covers different mechanisms in ParaView for visualizing data. Through these visualizations, users are able to gain unique insight on their data.<br />
<br />
=Understanding Views=<br />
==Views==<br />
<br />
When the ParaView application starts up, you see a 3D viewport with<br />
an axes at the center. This is a ''view''. In ParaView, views are frames in<br />
which the data can be seen. There are different types of views. The default<br />
view that shows up is a ''3D view'' which shows rendering of the geometry<br />
extracted from the data or volumes or slices in a 3D scene. You can change the<br />
default view in the Settings dialog ('''Edit''' | Settings (in case of Mac OS X,<br />
'''ParaView''' | Preferences)).<br />
<br />
[[Image:ParaViewDisplayingDataFigure1.png|thumb|center|600px|'''Figure 4.1''' ParaView view screen]]<br />
<br />
There may be parameters that are available to the user that control how the data<br />
is displayed e.g. in case of 3D view, the data can be displayed as wireframes or<br />
surfaces, where the user selects the color of the surface or uses a scalar for<br />
coloring etc. All these options are known as Display properties and are<br />
accessible from the Display tab in the Object Inspector.<br />
<br />
Since there can be multiple datasets shown in a view, as well as multiple views,<br />
the Display tabs shows the properties for the active pipeline object<br />
(changed by using the Pipeline Browser, for example) in the active view.<br />
<br />
==Multiple Views==<br />
<br />
ParaView supports showing multiple views side by side. To create multiple views,<br />
use the controls in the top right corner of the view to split the frame<br />
vertically or horizontally. You can also maximize a particular view to<br />
temporarily hide other views. Once a view-frame is split, you will see a list of<br />
buttons showing the different types of views that you can create to place in<br />
that view. Simply click the button to create the view of your choice.<br />
<br />
[[Image:ParaViewDisplayingDataFigure2.png|thumb|center|600px|'''Figure 4.2''' View options in ParaView]]<br />
<br />
Some filters, such as Plot Over Line may automatically split the view<br />
frame and show the data in a particular type of view suitable for the data<br />
generated by the filter.<br />
<br />
==Active View==<br />
<br />
Once you have multiple views, the active view is indicated by a colored border<br />
around the view frame. Several menus as well as toolbar buttons affect the<br />
active view alone. Additionally, they may become enabled/disabled based on whether that<br />
corresponding action is supported by the active view.<br />
<br />
The Display tab affects the active view. Similarly, the eye icon in<br />
the Pipeline Browser, next to the pipeline objects, indicates the visibility<br />
state for that object in the active view.<br />
<br />
When a new filter, source or reader is created, if possible it will be displayed by<br />
default in the active view, otherwise, if will create a new view.<br />
<br />
=Types of Views=<br />
<br />
This section covers the different types of views available in<br />
ParaView. For each view, we will talk about the controls available to change the<br />
view parameters using View Settings as well as the parameters associated<br />
with the '''Display Tab''' for showing data in that view.<br />
<br />
==3D View==<br />
<br />
3D view is used to show the surface or volume rendering for the data in a 3D<br />
world. This is the most commonly used view type.<br />
<br />
When running in client-server mode, 3D view can render data either by bringing<br />
the geometry to the client and then rendering it there or by rendering it on the<br />
server (possibly in parallel) and then delivering the composited images to the<br />
client. Refer to the '''Client-Server Visualization''' chapter for details.<br />
<br />
===Interaction===<br />
<br />
Interacting with the 3D view will typically update the camera. This makes it<br />
possible to explore the visualization scene. The default buttons are shown in Table 4.1 and <br />
they can be changed using the Application Settings dialog.<br />
<br />
{| style="background-color:#ffffcc;" cellpadding="10" cellspacing="0" border="1"<br />
|+'''Table 4.1'''<br />
!Modifier<br />
!Left Button<br />
!Middle Button<br />
!Right Button<br />
|-<br />
|<br />
|Rotate<br />
|Pan<br />
|Zoom<br />
|-<br />
|Shift<br />
|Roll<br />
|Rotate<br />
|Pan<br />
|-<br />
|Control<br />
|Zoom<br />
|Rotate<br />
|Zoom<br />
|}<br />
<br />
This view supports selection. You can select cells or points either on the<br />
surface or those within a frustum. Selecting cells or points makes it possible<br />
to extract those for further inspection or to label them. Details about data<br />
querying and selection can be found the Quantitative analysis chapter.<br />
<br />
===View Settings===<br />
<br />
The View Settings dialog is accessible through the '''Edit''' | View Settings menu or the<br />
tool button in the left corner of the view can be used to change the view settings<br />
per view.<br />
<br />
====General====<br />
<br />
[[Image:ViewSettingsGeneral.png|thumb|center|400px|'''Figure 4.3''' General tab in the View Settings menu]]<br />
<br />
The General tab allows the user to choose the background color. You can use a solid<br />
color, gradient or a background image.<br />
<br />
By default the camera uses perspective projection. To switch to parallel<br />
projection, check the Use Parallel Projection checkbox in this panel.<br />
<br />
====Lights====<br />
<br />
[[Image:ViewSettingsLights.png|thumb|center|400px|'''Figure 4.4''' Lights tab in the View Settings menu ]]<br />
<br />
The 3D View requires lights to illumniate the geometry being rendered in the<br />
scene. You can control these lights using this pane.<br />
<br />
====Annotation====<br />
<br />
[[Image:ViewSettingsAnnotation.png|thumb|center|400px|'''Figure 4.5''' Annotation tab in the View Settings menu]]<br />
<br />
The annotation pane enables control of the visibility of the center axes and<br />
the orientation widget. Users can also make the orientation widget interactive so that they can manually place the widget at location of their liking.<br />
<br />
===Display Properties===<br />
<br />
Users can control how the data from any source or filter is shown in this view<br />
using the Display tab. This section covers the various options<br />
available to a user for controlling appearance of the rendering in the 3D view.<br />
<br />
====View====<br />
The View menu has three options for controlling how the data is viewed. These are described in Table 4.2.<br />
[[Image:3DViewDisplayView.png|thumb|center|400px|'''Figure 4.6''' View menu]]<br />
<br />
{| style="background-color:#ffffcc;" cellpadding="10" cellspacing="0" border="1"<br />
|+''' Table 4.2'''<br />
!Name<br />
!Usage<br />
|-<br />
| Visible<br />
| Checkbox used to toggle the visibility of the data in the view. If it disabled, it implies that the data cannot be shown in this view.<br />
|-<br />
| Selectable<br />
| Checkbox used to toggle whether the data gets selected when using the selection mechanism for selecting and sub-setting data.<br />
|-<br />
| Zoom to Data<br />
| Click this button to zoom the camera so that the dataset is completely fits within the viewport.<br />
|}<br />
<br />
====Color====<br />
[[Image:3DViewDisplayColor.png|thumb|center|400px|'''Figure 4.7''' Color options]]<br />
<br />
The color group allows users to pick the scalar to color with or set a fixed<br />
solid color for the rendering. The options in Figure 4.7 are described in detail in Table 4.3<br />
<br />
{| style="background-color:#ffffcc;" cellpadding="10" cellspacing="0" border="1"<br />
|+'''Table 4.3'''<br />
!Name<br />
!Usage<br />
|-<br />
| Interpolate Scalars<br />
| If selected, the scalars will be interpolated within polygons and the scalar mapping happens on a per pixel basis. If not selected, then color mapping happens at points and colors are interpolated which is typically less accurate. This only affects when coloring with point arrays and has no effect otherwise. This is disabled when coloring using a solid color.<br />
|-<br />
| Map Scalars<br />
| If the data array can be directly interpreted as colors, then you can uncheck this to not use any lookup table. Otherwise, when selected, a lookup table will be used to map scalars to colors. This is disabled when the array is not of a type that can be interpreted as colors (i.e. vtkUnsignedCharArray).<br />
|-<br />
| Apply Texture<br />
| This feature makes it possible to apply a texture over the surface. This requires that the data has texture coordinates. You can use filters like Texture Map to Sphere, Texture Map to Cylinder or Texture Map to Plane to generate texture coordinates when they are not present in the data. To load a texture, select Load from the combo box which will pop up a dialog allowing you to choose an image. Otherwise, select from already loaded textures listed in the combo box.<br />
|-<br />
| Color By<br />
| This feature enables coloring of the surface/volume. Either choose the array to color with or set the solid color to use. When volume rendering, solid coloring is not possible, you must choose the data array to volume render with.<br />
|-<br />
| Set solid color<br />
| Used to set the solid color. This is available only when Color By is set to use Solid Color. ParaView defines a notion of a color palette consisting of different color categories. To choose a color from one of these predefined categories, click the arrow next to this button. It will open up a drop down with options to choose from. If you use a color from the palette, it is possible to globally change the color by changing the color palette e.g. for printing or for display on screen etc.<br />
|-<br />
| Edit Color Map...<br />
| You can edit the color map or lookup table by clicking the Edit Color Map button. It is only shown when an array is chosen in the Color By combo-box.<br />
|}<br />
<br />
====Slice====<br />
[[Image:3DViewDisplaySlice.png|thumb|center|400px|'''Figure 4.8''' Slice options]]<br />
<br />
The slice controls are available only for image datasets (uniform rectilinear grids) when the representation type is Slice. The representation type is<br />
controlled using the ''Style'' group on the Display tab.<br />
These allow the user to pick the slice direction as well as the slice<br />
offset.<br />
<br />
====Annotation====<br />
[[Image:3DViewDisplayCubeAxes.png|thumb|center|400px|'''Figure 4.9''' Annotation options]]<br />
<br />
Cube axes is an annotation box that can be used to show a scale around the<br />
dataset. Use the Show cube axes checkbox to toggle its visibility. You can<br />
further control the apperance of the cube axes by clicking Edit once the<br />
cube-axes is visible.<br />
<br />
[[Image:ParaViewDisplayingDataCubeAxes.png|thumb|center|300px|'''Figure 4.10''' Show cube axes example]]<br />
<br />
====Style====<br />
Figure 4.11 shows the Style dialog box. The options in this dialog box are described in detail in Table 4.4 below.<br />
<br />
[[Image:3DViewDisplayStyle.png|thumb|center|400px|'''Figure 4.11''' Sytle dialog box]]<br />
<br />
{| style="background-color:#ffffcc;" cellpadding="10" cellspacing="0" border="1"<br />
|+'''Table 4.4'''<br />
!Name<br />
!Usage<br />
|-<br />
| Representation<br />
| Use this to change how the data is represented i.e. as a surface, volume,<br />
wireframe, points, or surface with edges.<br />
|-<br />
| Interpolation<br />
| Choose the method used to shade the geometry and interpolate point attributes.<br />
|-<br />
| Point Size<br />
| If your dataset contains points or vertices, this adjusts the diameter of the rendered points. It also affects the point size when Representation is Points.<br />
|-<br />
| Line width<br />
| If your dataset contains lines or edges, this scale adjusts the width of the rendered lines. It also affects the rendered line width when Representation is Wireframe or Surface With Edges.<br />
|-<br />
| Opacity<br />
| Set the opacity of the dataset's geometry. ParaView uses hardware-assisted depth peeling, whenever possible, to remove artifacts due to incorrect sorting order of rendered primitives.<br />
|-<br />
| Volume Mapper<br />
| When Representation is Volume, this combo box allows the user to choose a specific volume rendering technique. The techniques available change based on the type of the dataset.<br />
|-<br />
| Set Edge Color<br />
| This is available when Representation is Surface with Edges. It allows the user to pick the color to use for the edges rendered over the surface.<br />
|}<br />
<br />
====Backface Style====<br />
<br />
[[Image:3DViewDisplayBackface.png|thumb|center|400px|'''Figure 4.12''' Backface Style dialog box]]<br />
<br />
The Backface Style dialog box allows the user to define backface properties. In computer graphics, backface refers to the face of a geometric primitive with the normal point away from the camera. Users can choose to hide the backface or front face, or specify different characteristics for the two faces using these settings.<br />
<br />
====Transformation====<br />
<br />
[[Image:3DViewDisplayTransform.png|thumb|center|400px|'''Figure 4.13''' Transformation dialog box]]<br />
<br />
These settings allow the user to transform the rendered geometry, without actually transforming the data. Note that since this transformation happens during rendering, any filters that you apply to this data source will still be working on the original, untransformed data. Use the Transform filter if you want to transform the data instead.<br />
<br />
==2D View==<br />
<br />
2D View is similar to 3D view except that it can only show slices from uniform<br />
grid datasets i.e. volume datasets or image datasets.<br />
The interaction is also limited to a 2D plane and so rotation is not available. Currently this view does not support selection, which will be supported in future releases.<br />
When you load a 2D image, ParaView by default creates this view.<br />
<br />
Since this view is same as the 3D view, it has the same features in regards to client-server and parallel rendering. <br />
<br />
===Interaction===<br />
Interactions with this view update the camera. The default buttons are described in Table 4.5 and can be changed using the Application Settings dialog.<br />
<br />
{| style="background-color:#ffffcc;" cellpadding="10" cellspacing="0" border="1"<br />
|+'''Table 4.5'''<br />
!Modifier<br />
!Left Button<br />
!Middle Button<br />
!Right Button<br />
|-<br />
|<br />
|Pan<br />
|Pan<br />
|Zoom<br />
|-<br />
|Shift<br />
|Zoom<br />
|Zoom<br />
|Zoom<br />
|-<br />
|Control<br />
|Zoom<br />
|Zoom<br />
|Pan<br />
|}<br />
<br />
Unlike 3D view, this view does not currently support selection. However, that support will be added in future releases.<br />
<br />
===View Settings===<br />
The view settings dialog is accessible through the '''Edit''' | View Settings menu or the tool button in the left corner of the view.<br />
<br />
[[File:ParaViewUsersGuide2DViewSettings.png|thumb|center|300px|'''Figure 4.14''' View settings dialog for the 2D View]]<br />
<br />
In 2D view options, the user can change the background color and toggle the visibility of the axes-box, as in Figure 4.14.<br />
<br />
[[File:ParaViewUsersGuide2DViewAxes.png|thumb|center|300px|'''Figure 4.15''' 2D View showing the axes-box]]<br />
<br />
===Display Properties===<br />
<br />
The display tab for this view is same as the 3D view, except that some options may be unavailable such as changing of representation type.<br />
<br />
==Spreadsheet View==<br />
<br />
Spreadsheet View is used to inspect the raw data in a spreadsheet. When running<br />
in client-server mode, to avoid delivering the entire dataset to the client for<br />
displaying in the spreadsheet (since the data can be very large), this view streams<br />
only visible chunks of the data to the client. As the user scrolls around the<br />
spreadsheet, new data chunks are fetched.<br />
<br />
Unlike some other views, this view can only show one dataset at a time. For<br />
composite datasets, it shows only one block at a time. You can select the block<br />
to show using the Display tab.<br />
<br />
===Interaction===<br />
In regards to usability, this view behaves like typical spreadsheets shown in applications like Microsoft Excel or Apple Pages:<br />
* You can scroll up and down to inspect new rows. <br />
* You can sort any column by clicking on the header for the column. Repeated clicking on the column header toggles the sorting order. When running in parallel, ParaView uses sophisticated parallel sorting algorithms to avoid memory and communication overheads to sort large, distributed datasets.<br />
* You can double-click on a column header to toggle a mode in which only that column is visible. This reduces clutter when you are interested in a single attribute array.<br />
* You can click on rows to select the corresponding elements i.e. cells or points. This is not available when in "Show selected only mode." Also, when you create a selection in other views e.g. the 3D view, the rows corresponding to the selected elements will be highlighted.<br />
<br />
===Header===<br />
<br />
Unlike other views, Spreadsheet View has a header. This header provides quick access to some of the commonly used functionality in this view.<br />
<br />
[[File:ParaViewUsersGuideSpreadsheetViewHeader.png|thumb|center|400px|'''Figure 4.16''' Spreadsheet View Header]]<br />
<br />
Since this view can only show one dataset at a time, you can quickly choose the dataset to show using the Showing combo box. You can choose the attribute type i.e. point attributes, cell attributes, to display using the Attribute combo box. The Precision option controls the number of digits to show after decimal point for floating point numbers. Lastly, the last button allows the user to enter the view in a mode where it only shows the selected rows. This is useful when you create a selection using another view such as the 3D view and want to inspect the details for the selected cells or points.<br />
<br />
===View Settings===<br />
<br />
Currently, no user settable settings are available for this view.<br />
<br />
===Display Properties===<br />
<br />
[[File:ParaViewUsersGuideSpreadsheetView2.png|thumb|center|300px|'''Figure 4.17''' Display tab in the Object Inspector]]<br />
<br />
The display properties for this view provide the same functionality as the header. Additionally, when dealing with composite datasets, the display tab shows a widget allowing the user to choose the block to display in the view.<br />
<br />
==Line Chart View==<br />
<br />
A traditional 2D line plot is often the best option to show trends in small quantities of data. A line plot is also a good choice to examine relationships between different data values that vary over the same domain.<br />
<br />
Any reader, source, or filter that produces plottable data can be displayed in an XY plot view. ParaView stores its plotable data in a table (vtkTable). Using the display properties, users can choose which columns in the table must be plotted on the X and Y axes.<br />
<br />
As with the other view types, what is displayed in the active XY plot view is displayed by and controllable with the eye icons in the Pipeline Browser panel. When an XY plot view is active, only those filters that produce plotable output have eye icons.<br />
<br />
The XY plot view is the preferred view type for the Plot over Line, Plot Point over Time, Plot Cell over Time, Plot Field Variable over Time, and Probe Location over Time filters. Creating any one of these filters will automatically create an XY plot view for displaying its output. Figure 4.18 shows a plot of the data values within a volume as they vary along three separate paths. The top curve comes from the line running across the center of the volume, where the largest values lie. The other two curves come from lines running near the edges of the volume.<br />
<br />
Unlike the 3D and 2D render view, the charting views are client-side views i.e. they deliver the data to be plotted to the client. Hence ParaView only allows results from some standard filters such as Plot over Line in the line chart view by default. However it is also possible to plot cell or point data arrays for any dataset by apply the Plot Data filter.<br />
<br />
[[Image:ParaViewUsersGuideLineChartView.png|thumb|center|400px|'''Figure 4.18''' Plot of data values within a volume]]<br />
<br />
===Interaction===<br />
<br />
The line chart view supports the following interaction modes:<br />
<br />
* ''Right-click'' and ''drag'' to pan<br />
* ''Left-click'' and ''drag'' to select <br />
* ''Middle-click'' and ''drag'' to zoom to region drawn.<br />
* ''Hover'' over any line in the plot to see the details for the data at that location.<br />
<br />
To reset the view, use the Reset Camera button in the Camera Toolbar.<br />
===View Settings===<br />
<br />
The '''View Settings''' for Line Chart enable the user to control the appearance of the chart including titles, axes positions etc. There are several pages available in this dialog. The '''General''' page controls the overall appearance of the chart, while the other pages controls the appearance of each of the axes.<br />
<br />
====General Settings Page====<br />
<br />
[[Image:ParaViewUsersGuideChartSettingsGeneral.png]]<br />
<br />
This page allows users to change the title and legend. One can change the title text. To show the current animation time in the title text, simply use the keyword ''${TIME}''. Users can further change the font and alignment for the title.<br />
<br />
This page also enable changing the appearance and positioning of the legend.<br />
<br />
====Axis Settings Page====<br />
<br />
This page allows changing the properties of a particular axis. Four pages are provided for each of the axes. By clicking on the name of the axis, one can access the settings page for the corresponding axes.<br />
<br />
[[Image:ParaViewUsersGuideChartSettingsAxis.png]]<br />
<br />
* Axis<br />
** '''Show Axis''' : controls the axis visibility.<br />
** '''Show Axis Grid''': controls whether a grid is to be drawn perpendicular to this axis.<br />
** '''Colors''': enables changing the axis as well as the grid color.<br />
<br />
* Labels<br />
** '''Show Axis Labels When Space is Available''' : controls label visibility along this axis.<br />
** '''Font''' and '''Color''': enables changing the label font and color.<br />
** '''Notation''': allows user to choose between '''Mixed''', '''Scientific''' and '''Fixed''' point notations for numbers.<br />
** '''Precision''': controls precision after '.' in '''Scientific''' and '''Fixed''' notations.<br />
<br />
====Axis Layout Page====<br />
<br />
This page allows the user to change the axis range and scale.<br />
<br />
[[Image:ParaViewUsersGuideChartSettingsAxisLayout.png]]<br />
<br />
<br />
* '''Use Logarithmic Scale When Available''': check this to use a log scale unless the data contains numbers <= 0.<br />
* '''Let the Chart Determine the Axis Layout''': pick this radio button to let the chart use the optimal range and spacing for this axis.<br />
* '''Specify the Axis Range''': pick this radio button to specify the axis range explicitly. The labels are auto-placed within this range.<br />
* '''Specify Each of the Axis Labels''': pick this radio button to specify each label location on axis explicitly.<br />
<br />
====Axis Title Page====<br />
<br />
This page allows the user to change the title for the axis. One can change the text as well as color and font for the axis title.<br />
<br />
[[Image:ParaViewUsersGuideChartSettingsAxisTitle.png]]<br />
<br />
===Display Properties===<br />
<br />
Display Properties for the Line Chart view allow the user to choose what arrays are plotted along which of the axes as well as the appearance for each of the lines such as its color, thickness and style.<br />
<br />
<br />
[[Image:ParaViewUsersGuideChartDisplayProperties.png]]<br />
<br />
* '''Attribute Mode''' : pick which attribute arrays to plot i.e. point arrays or cell arrays etc.<br />
* '''X Axis Data''' : controls the array to use as the X-axis.<br />
** '''Use Array Index From Y Axis Data''' : when checked results in ParaView simply using the index in data-array plotted on Y as the x axis.<br />
** '''Use Data Array''': when checked the user can pick an array to be interpreted as the x co-ordinate.<br />
* '''Line Series''' : controls the properties of each of the arrays plotted along the y-axis.<br />
** '''Variable''' : check the variable to be plotted. <br />
** '''Legend Name''' : click to change the name used in the legend for this array.<br />
<br />
Select any of the series in the list to change following properties for that series. One can select multiple entries to change multiple series.<br />
** '''Line Color''' : controls the color for the series.<br />
** '''Line Thickness''' : controls the thickness for the series.<br />
** '''Line Style''' : controls the style for the line.<br />
** '''Marker Style''' : markers can be placed at every data point. This controls the style used for those markers.<br />
** '''Chart Axes''' :<br />
<br />
==Bar Chart View==<br />
<br />
Traditional 2D graphs present some types of information much more readily than 3D renderings do; they are usually the best choice for displaying one and two dimensional data. The Bar Chart View is very useful for examining the relative quantities of different values within data, for example. <br />
<br />
The Bart Chart View is used most frequently to display the output of the Histogram filter. This filter divides the range of a component of a specified array from the input data set into a specified number of bins, producing a simple sequence of the number of values in the range of each bin. A Bar Chart is the natural choice for displaying this type of data. In fact the Bar Chart View is the preferred View type for the Histogram filter. Filters that have a preferred View type will create a View of the preferred type whenever they are instantiated.<br />
<br />
When the new View is created for the histogram filter, the pre-existing 3D view is made smaller to make space for the new Chart View. The Chart View then becomes the Active View, which is denoted with a red border around the View in the display area. Clicking on any View window makes it the active View. The contents of the Object Inspector and Pipeline Browser panels change and menu items are enabled or disabled whenever a different View becomes active to reflect the Active View’s settings and available controls. In this way, you can independently control numerous Views. Simply make a View active, and then use the rest of the GUI to change it. By default, the changes you make will only affect the active View.<br />
<br />
As with the 3D View, the visibility of different datasets within a Bar Chart View is displayed and controlled by the eye icons in the Pipeline Browser. The Bar Chart View can only display datasets that contain chartable data, and when a Bar Chart View is active, the Pipeline Browser will only display the eye icon next to those datasets that can be charted. <br />
<br />
ParaView stores its chartable data in 1D Rectilinear Grids, where the X locations of the grid contain the bin boundaries, and the cell data contain the counts within each bin. Any source or filter that produces data in this format can be displayed in the Bar Chart View. Figure 46 shows a histogram of the values from a slice of a data set.<br />
<br />
The Chart View’s Edit View Options dialog allows you to create labels, titles, and legends for the chart and to control the range and scaling of each axis.<br />
<br />
The '''Interaction''', '''Display Properties''' as well as '''View Settings''' for this view and similar to those for the Line Chart.<br />
<br />
[[Image:ParaViewUsersGuideBarChartView.png|600px]]<br />
<br />
==Color Transfer Functions==<br />
<br />
The interface for changing the color mapping and properties of the scalar bar is accessible from the '''Display''' tab of the '''Object Inspector'''. Pressing the '''Edit Color Map''' button displays the interface for manipulating the color map and scalar bar as shown below. <br />
<br />
<center>[[File:ParaView_UsersGuide_ColorScaleEditor2.png||link=]]</center><br />
<br />
<center>'''Figure 1. Color Map Controls'''</center><br />
<br />
At the top of the '''Color Scale''' tab of the '''Color Scale Editor''' dialog is an editor for mapping scalar values to colors (for surface rendering) and also to opacity (for volume rendering). The scalar range of this color map editor is shown below the '''Automatically Rescale to Fit Data Range''' check box. The leftmost sphere corresponds to the minimum scalar value, and the rightmost one corresponds to the maximum. Any interior nodes correspond to values between these two extremes. New nodes may be added to the color editor by left-clicking in the editor; this determines the scalar value associated with the node, but that value may be changed by typing a new value in the '''Scalar Value''' text box below the color map editor or by clicking and dragging a node. (The scalar value for a particular node may not be changed such that it is less than that for a node left of it or greater than that for a node right of it.) When volume rendering, the vertical height of a node indicates its opacity. For surface rendering, opacity is determined for an entire data set, not based on the underlying scalar values.<br />
<br />
When a node in the color map editor is clicked, it becomes highlighted (i.e., drawn larger than the other spheres in the editor). In the example above, the second node from the left has been selected. Clicking again on the selected node displays a color chooser from which you may select a new color for the node. Pressing the ‘d’ or Delete key while a node is selected removes that node from the editor. Only the endpoint nodes may not be deleted.<br />
<br />
Below the color map editor (or transfer function editor, for volume rendering) is a set of three text boxes for changing the scalar value, opacity, and scale associated with a given node. Only the scalar value is associated with surface rendering. The scalar values at the endpoints may only be changed if the '''Automatically Rescale to Fit Data Range''' check box (discussed later in this section) is unmarked. When volume rendering, you may also specify the opacity and scale per node in the editor. In volume rendering, the opacity is accumulated as you step through the volume being rendered. The '''Scale''' value determines the unit distance over which the opacity is accumulated.<br />
<br />
The controls below the set of three text boxes specify the color space and any color map preset you wish to save or use. The color spaces available are '''RGB''' (red, green, blue), '''HSV''' (hue, saturation, value), '''Wrapped HSV''', and '''CIELAB''' (a more perceptually linear color space). The color space determines how the colors are interpolated between specified values; the colors at the color map (or transfer function) editor nodes will remain the same regardless of the color space chosen. If wrapped HSV is used, the interpolation will use the shortest path in hue, even going through the value hue = 0. For non-wrapped HSV, the hue interpolation will not pass through 0. (A hue of zero sets the color to red.)<br />
<br />
In addition to choosing the color space and modifying the color map / transfer function nodes, you may also create and load preset color scales. (When volume rendering, only the color map is stored; the scalar-to-opacity mapping is not.) To store your current settings as a preset, click the '''Save''' button. In the dialog box that appears, you may enter a name for your new preset. By default, the scalar values from the data array being used are stored in the preset. If you wish these values to be normalized between 0 and 1, press the '''Normalize''' button.<br />
<br />
<center>[[File:ParaView_UsersGuide_PresetColorScalesDialog.png||link=]]</center><br />
<br />
<center>'''Figure 2. Dialog for choosing color scale presets.'''</center><br />
<br />
Any presets you save, in addition to the default ones provided by ParaView, are available by pressing the '''Choose Preset''' button, causing the dialog shown below to be displayed. Selecting a preset and clicking '''OK''' causes the current color map to be set to the chosen preset. Any user-defined presets may be normalized (as discussed above) or removed from the list of presets entirely using the '''Normalize''' and '''Remove''' buttons, respectively. (The default presets are already normalized and may not be removed from the application.)<br />
<br />
Any of the color scale presets may be exported to a file using the '''Export''' button in the above dialog. The resulting file(s) may then be copied to another computer for use with ParaView on a different machine. In order to load presets that are stored in such files, press the '''Import '''button on the above dialog, and navigate to the desired color preset file.<br />
<br />
If the current data set is colored by an array of vectors, the '''Component''' menu will be enabled. It determines whether the data is colored by a single vector component ('''X''', '''Y''', or '''Z''') or by the vector’s '''Magnitude''' (the default). If the data is colored by a single-component (scalar) array, then the '''Component''' menu is disabled.<br />
<br />
If '''Use Logarithmic Scale'''<nowiki> is checked, then instead of the scalar values in the data array being used directly to determine the colors, the base-10 logarithm of the data array values is computed, and the resulting value is used for extracting a color from the color map. If the data array contains values for which a logarithm would produce invalid results (i.e., any values less than or equal to 0), the range for the color map is changed to [0, 10] so that the logarithm produces valid results.</nowiki><br />
<br />
By default, any data attribute that has been used to color a data set currently loaded in ParaView whose name and number of components match that of the array selected in the '''Color by''' menu contributes to the range of the color map. To change this behavior, first uncheck the '''Automatically Rescale to Fit Data Range''' check box. (This ensures that the range of the color map is not reset when the range of the data attribute changes.) The minimum and maximum values of the color map can be overridden by pressing the '''Rescale Range''' button, entering different '''Minimum''' and '''Maximum''' values in the dialog that appears, and pressing '''Rescale'''<nowiki>; this rescales all the nodes in the color map so that the scalar values lie at the same normalized positions. Alternatively, you may modify the scalar values of any node (including the endpoints if </nowiki>'''Automatically Rescale to Fit Data Range''' is off) by clicking a node to highlight it and typing a new value in the '''Scalar Value''' entry box. By changing the minimum and maximum color map values, it is possible to manually specify what range of data values the color map will cover. Pressing the '''Rescale to Data Range''' button on the '''Color Scale''' tab of the '''Color Scale Editor '''sets the range to cover only the current data set.<br />
<br />
If '''Use Discrete Colors''' is checked, the '''Resolution''' slider at the bottom of the dialog specifies the number of colors to in the color map. The scale ranges from 2 to 256 (the default). The fewer the number of colors, the larger the range each color covers. This is useful if the data attribute has a small number of distinct values or if larger ranges of the array values should be mapped to the same color.<br />
<br />
<center>[[File:ParaView_UsersGuide_ColorScaleEditorColorLegend.png||link=]]</center><br />
<br />
<center>'''Figure 3. Scalar Bar controls'''</center></div>Katie.osterdahl