Resampling using cell data?

To be clear, what you mean is that when you run Resample To Image, the cell data does get resampled, but it gets resampled to points in the resulting grid that get inappropriately interpolated, right? If so, this is an issue that has recently come up in another question. There is a trick you can do with a sequence of filters to sample on points at the center of the target cells, convert that to cell data, and copy back to your sample grid.

  1. Do the Resample To Image as you are.
  2. Use the Cell Centers filter on the output to Resample To Image. Make sure to turn on the Vertex Cells property of the filter. This will create a bunch of point cells located at the center of each of the cells in your input data.
  3. Use the Resample With Dataset filter to get the cell data from the original unstructured mesh. This filter has 2 inputs. Set the Source Data Arrays input to your original unstructured mesh. Set the Destination Mesh to the Cell Centers filter.
  4. Use the Point Data to Cell Data filter on the output of Resample with Dataset. Normally, this does an averaging of point data to the cell data, but because the data only has one point per cell, it will just do a simple copy.
  5. Select both the Resample To Image and Point Data to CellData filter in the pipeline browser and then add the Append Attributes filter. This will copy the cell data you generated on those points at the cell centers back to the data structure where you really want it.

Note that the output will now have duplicated all your fields on both points and cells. You can use the Pass Arrays filter to select which ones you actually want to keep.

4 Likes