.. include:: ../macros.hrst .. include:: ../abbreviations.hrst .. _chapter:ComparativeVisualization: Comparative visualization ######################### Comparative visualization in |ParaView| refers to the ability to create side-by-side visualizations for comparing with one another. In its most basic form, you can indeed use |ParaView|'s ability to show multiple views side by side to set up simultaneous visualizations. But, that can get cumbersome too quickly. Let's take a look at a simple example: Let's say you want to do a parameter study where you want to compare isosurfaces generated by a set of isovalues in a dataset. To set up such a visualization, you'll need to first create as many ``Render View`` :index:`\ `\ s as isovalues. Then, create just as many ``Contour`` :index:`\ `\ filters, setting each one up with a right isovalue for the contour to generate and display the result in one of the views. As the number of isovalues increases, you can see how this can get tedious. It is highly error prone, as you need to keep track of which view shows which isovalue. Now, imagine after having set up the entire visualization that you need to change the ``Representation`` :index:`\ `\ type for all the of the isosurfaces to ``Wireframe`` :index:`\ `\ ! ``Comparative View`` :index:`\ `\ s were designed to handle such use-cases. Instead of creating separate views, you create a single view ``Render View (Comparative)`` :index:`\ `\ . The view itself comprises of a configurable :math:`m\times n` ``Render View`` :index:`\ `\ s. Any data that you show in this view gets shown in all the internal views simultaneously. Any display property changes, such as scalar coloring and representation type are also maintained consistently between these internal views. The interactions in the internal views are linked, so when you interact with one, all other views update as well. While this is all nice and well, the real power of ``Comparative View`` :index:`\ `\ s becomes apparent when you set up a parameter to vary across the views. This parameter can be any of the properties on the pipeline modules such as filter properties and opacity, or it could be the data time. Each of these internal views will now render the result obtained by setting the parameter as per your selection. Going back to our original example, we will create a single ``Contour`` :index:`\ `\ filter that we show in ``Render View (Comparative)`` :index:`\ `\ with as many internal views as the isovalue to compare. Next, we will set up a parameter study for varying the ``Isosurfaces`` :index:`\ `\ property on the ``Contour`` :index:`\ `\ filter, and, viola! The view will generate the comparative visualization for us! In this chapter, we look at how to configure this view and how to set these parameters to compare. We limit our discussion to ``Render View (Comparative)`` :index:`\ `\ . However, the same principles are applicable to other comparative views, including ``Bar Chart View (Comparative)`` :index:`\ `\ and ``Line Chart View (Comparative)`` :index:`\ `\ . .. figure:: ../images/ComparativeRenderView.png :name: fig:ComparativeRenderView :width: 80% :align: center ``Render View (Comparative)`` :index:`\ `\ in |paraview| showing a parameter study. In this case, we are comparing the visualization generated using different isovalues for the ``Contour`` :index:`\ `\ filter. The ``Comparative View Inspector`` :index:`\ `\ dockpanel (on the right) is used to configure the parameter study. Setting up a comparative view ============================= To create ``Render View (Comparative)`` :index:`\ `\ in |paraview|, split or close the active view and select ``Render View (Comparative)`` :index:`\ `\ from the new view creation widget. |paraview| will immediately show four ``Render View`` :index:`\ `\ s laid out in a :math:`2\times 2` grid. While you cannot resize these internal views, notice that you can still split the view frame and create other views if needed. The ``Properties`` :index:`\ `\ panel will show properties similar to those available on the ``Render View`` :index:`\ `\ under the ``View`` :index:`\ `\ properties section. If you change any of these properties, they will affect all these internal views, e.g., setting the ``Background`` :index:`\ `\ color to ``Gradient`` :index:`\ `\ will make all the views show a gradient background. .. figure:: ../images/ComparativeViewInspector.png :name: fig:ComparativeViewInspector :width: 50% :align: center ``Comparative View Inspector`` :index:`\ `\ in |paraview| used to configure the active comparative view. To configure the comparative view itself, you must to use the ``Comparative View Inspector`` :index:`\ `\ ( :numref:`fig:ComparativeViewInspector`) accessible from the :guilabel:`View` menu. The ``Comparative View Inspector`` :index:`\ `\ is a dockable panel that is enabled when the active view is a comparative view. To change how many internal views are used in the active comparative view and how they are laid out, use the ``Layout`` :index:`\ `\ . The first value is the number of views in the horizontal direction and the second is the count in the vertical direction. Besides doing a parameter study in side-by-side views, you can also show all the results in a single view. For that, simply check the ``Overlay all comparisons`` :index:`\ `\ checkbox. When checked, instead of getting a grid of :math:`m\times n` views, you will only see one view with all visible data displayed :math:`m\times n` times. To show data in this view is the same as any other view: Make this view active and use the ``Pipeline Browser`` :index:`\ `\ to toggle the eyeball icons to show data produced by the selected pipeline module(s). Showing any dataset in this view will result in the data being shown in all the internal views simultaneously. As is true with ``View`` :index:`\ `\ properties, with ``Display`` :index:`\ `\ properties, changing ``Coloring`` :index:`\ `\ , ``Styling`` :index:`\ `\ , or any other properties will reflect in all internal views. Since the cameras among the internal views are automatically linked, if you interact with one of the views, all views will also update simultaneously when you release the mouse button. Setting up a parameter study ============================ .. figure:: ../images/ComparativeViewWithTime.png :name: fig:ComparativeViewWithTime :width: 80% :align: center ``Render View (Comparative)`` :index:`\ `\ with ``Annotate Time`` :index:`\ `\ filter showing the time for each of the views. In this case, the parameter study is varying ``Time`` :index:`\