In ParaView, selection is a mechanism for identifying a set of cells or points in the data produced by a source. In this article, source stands for any VTK algorithm, including readers, data sources, filters etc. that produces data output. ParaView supports a single active selection. This selection is associated with a source and is shown in every view that displays the source’s output. When a new selection is made, it replaces the previous one.
This article uses a use-case driven approach to demonstrate ParaView’s selection capabilities. In this section we introduce the main GUI components that are used in the article. The subsequent sections address different use cases.
ParaView provides a selection inspector (referred to simply as the inspector in this article) to inspect and edit the details about the active selection. One 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.
We will look at each of these options as we try to explore the different selection types in ParaView.
Spreadsheet View provides data exploration capabilities. One of the common complains 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.
When the spreadsheet view is active (i.e. selected by clicking on its toolbar), and the visible source is selected in the pipeline browser, the Display tab in the Object Inspector panel can be used to control what is shown in this view. This panel contains a selector that can be used to toggle between point and cell data. For composite datasets (multi-block datasets and AMR datasets), it shows a Composite Data Structure tree that can be used to select the block that is shown in the view. Another widget named Show only selected elements can be selected to restrict what is shown in the spreadsheet to only selected cells or points. We will revisit this check box later.
Create a Selection
In this section we will discuss different ways of creating a selection.
Select cells/points on the Surface
One of the simplest use-case 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 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).
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 is showing cell or point attributes of the selected data, then it will highlight the corresponding rows. If we are selecting points then the spreadsheet view shows the selection only if point attributes are being displayed. If we are selecting cells then 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 haven’t been selected.
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.
Select cells/points using a Frustum
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, here the indices of the cells or points are not computed 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.