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.
- Do the
Resample To Image
as you are. - Use the
Cell Centers
filter on the output toResample To Image
. Make sure to turn on theVertex 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. - Use the
Resample With Dataset
filter to get the cell data from the original unstructured mesh. This filter has 2 inputs. Set theSource Data Arrays
input to your original unstructured mesh. Set theDestination Mesh
to theCell Centers
filter. - Use the
Point Data to Cell Data
filter on the output ofResample 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. - Select both the
Resample To Image
andPoint Data to CellData
filter in the pipeline browser and then add theAppend 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.