Skip to content

Consistent field mapping

The MapFieldOntoOutput implementations for the filters are often missing or inconsistent.

Let's refactor the implementations so that:

  • Any filter that modifies points should remap point fields.
  • Any filter that modifies cells should remap cell fields.
  • The worklet method that remaps point fields should be named ProcessPointField.
  • The worklet method that remaps cell fields should be named ProcessCellField.
  • The remapping fields should take an input ArrayHandle and DeviceAdapterTag and return an ArrayHandle<ValueType> with default storage (no fancy array handles), e.g.
template <typename ValueType, typename StorageTagIn, typename DeviceAdapterTag>
using MapSignature = ArrayHandle<ValueType>(const ArrayHandle<ValueType, StorageTagIn>&,
                                            const DeviceAdapterTag &) const

Questions:

  • If a filter doesn't modify points, should DoMapField return false or pass the input through and return true?
  • Does the proposed signature capture all of the possible data needed for remapping? (Policies, etc?)
  • Should the output storage type for mapped fields match the input, or use the default storage?

Current state of the filters:

  • CellAverage No modifications to points or cells.
  • CleanGrid No modification to cells, removes points.
  • ClipWithField Modifies points and cells. !799 (merged)
  • ClipWithImplicitFunction Modifies points and cells. !799 (merged)
  • ContourTreeUniform No modification to points or cells.
  • Entropy No modification to points or cells.
  • ExternalFaces Modifies points and cells. (skipping)
  • ExtractGeometry Modifies cells. !803 (merged)
  • ExtractPoints Modifies cells and points. Cells are not mappable.
  • ExtractStructured Modifies cells and points. Everything looks good!
  • Gradient Field only.
  • Histogram Field only.
  • MarchingCubes !793 (merged) vtk!2924 (merged)
  • Mask Modifies cells. !805 (merged)
  • MaskPoints Modifies points and cells. Cells are not mappable.
  • PointAverage Field only.
  • PointElevation Field only.
  • Tetrahedralize Modifies cells. !806 (merged)
  • Threshold Modifies cells. !808 (merged)
  • ThresholdPoints Modifies points and cells. Cells not mappable.
  • Triangulate Modifies cells. !810 (merged)
  • VectorMagnitude Field only.
  • VertexClustering Modifies points and cells. Skipping for now (See #161 (closed))
Edited by Allison Vacanti