Recently, we added two new filters to the Visualization Toolkit (VTK) and ParaView. These filters can sample the point and cell data of one dataset on to the points of another dataset. Under VTK, these filters are implemented in vtkResampleWithDataSet and vtkResampleToImage. There are also parallel, distributed versions of these filters called vtkPResampleWithDataSet and vtkPResampleToImage. In ParaView, these filters are called “Resample With Dataset” and “Resample To Image.”
The new filters are implemented using Diy2, a block-parallel library. Diy2 provides an abstraction over Message Passing Interface (MPI). It has built-in facilities for complex communication patterns like neighbor exchange and swap-reduce, and commonly used algorithms such as domain decomposition. Diy2 greatly simplifies the process of implementing parallel programs such as dataset resampling filters.
Following is a brief description of the two filters and their usage in ParaView:
Resample With Dataset
This filter takes two inputs: Input and Source, which can be any DataSet or Composite DataSet type. The filter samples the point and cell data of Input on the points of Source. The output DataSet has the same structure as Source, and its point data contains the resampled values from Input.
Resample With Dataset also works in parallel with distributed datasets. The output dataset will have the same distribution as Source.
Resample To Image
This filter is a specialization of Resample With Dataset. The filter takes one input and samples its point and cell data onto a uniform grid of points. It is possible to specify the bounds and extents of the uniform grid using the properties panel. By default, the bounds are set to the bounds of the input dataset. The output of the filter is an Image-Data.
Some operations can be performed more efficiently on uniform grid datasets. The Resample to Image filter can be used to convert any dataset to Image-Data before performing such operations. For example, Resample To Image can resample an unstructured grid dataset to an Image-Data to efficiently volume-render the data.
Like Resample With Dataset, Resample To Image can accept any type of DataSet or Composite DataSet as input and can work in parallel distributed environments. The output of Resample To Image is distributed evenly among the processes.
Resample With Dataset and Resample To Image replace or supercede existing filters (“Resample With Dataset” and “Image Resampling”) that had inefficient implementations. Resample To Image is already available in VTK 7.0 and ParaView 5.1. We expect to release Resample With Dataset with VTK 7.1 and ParaView 5.2.
12 comments to DataSet Resampling Filters
There is a confusion about Input and Source, I think this sentence is false: “The output DataSet has the same structure as Source, and its point data contains the resampled values from Input.”
But this is a nice blog 🙂
The nomenclature is different in VTK and ParaView. In VTK, Input provides the geometry and Source provides the data to resample, but it is the opposite in ParaView. The above description is correct for ParaView. My initial implementation of the ParaView filter used the VTK names but the older filter used the style described here. So I changed it to avoid any confusion for ParaView users.
Hope that makes sense.
Yes this makes sense, thank you for the explanation. I was not aware of this inversion between VTK and ParaView.
I am learning paraview and come across Resample with Datasets filter. I want to implement it but unable find a step by step way that I can implement it with can.ex2 & disk_out_ref.ex2 datasets.
Can you help me to understand it better.
I am new to 3D visualization of scientific data.
Following are the steps to resample data from disk_out_ref.ex2 on to can.ex2:
1) File > Open > can.ex2
2) Select all Variables in Properties tab
4) File > Open > disk_out_ref.ex2
5) Select all Variables in Properties tab
7) Filters > Alphabetical > Resample With Dataset
8) Click Input, select disk_out_ref.ex2; Click Source, select can.ex2
For more details about ParaView filters and pipelines you can refer to the ParaView users’ guide available here: http://www.paraview.org/paraview-guide/
Hope this helps.
How to resample a Point Source to Image? I just asked this on StackOverflow as well: http://stackoverflow.com/q/39587607/80480
A solution has been posted to the stack overflow question by Utkarsh. I will reproduce it here for easy reference:
“To sample a point source to vtkImageData, use the Point Interpolation Filters instead. Point Volume Interpolator is what you want.”
If you really didn’t want it to be confusing in Paraview, why not call it Input Data and Output Geometry?
Really nice idea: the Resample with Dataset in Paraview filter always generate a lot of confusion when it deals with Input and Source. Maybe this hint could be posted in the uservoice site as a new feature request…
Hi, I think that there is an error in the labels included in the image of the section “Resample with Dataset”. The figure represented on the middle portion of the image is the source, and the one on the left is the input. Epigraph is OK.
Greetings from BA, Alejandro
The image was generated before I renamed the ports to be consistent with ParaView. The caption has the correct names.
Hello, I am using “Resample With DataSet” filter in ParaView 4.4.0 to sample a 2D dataset from an unstructured mesh to a Cartesian grid. I would like to know the interpolation method that is used by the filter. Is it a bilinear interpolation for 2D datasets. Thanks!