Resampling-Op

Results from Specification Meeting on February 11th, 2016

  • Resampling is a user requirement
  • Users want to save their preferred resampling options per product type (or maybe even in general)
  • Resampling shall be applicable to multisize products
    • (1) SceneTransforms shall be SceneTransform.IDENTITY
    • (2) All band sizes must be int-divisible by the scaling factor (and its inverse) ← this requirement is important to enable aggregation for the moment
    • (3) Either width and height of the reference band must be both smaller or both bigger than (or both equal to) width and height of the bands to be resampled
    • For interpolation, the operator shall simply scale the images, using one of the pre-defined JAI interpolations (allow nearest neighbour, bi-linear, cubic convolution)
    • For aggregation, the operator shall first use a filter from ceres-jai (first, mean, median, min, max) to determine which value shall be selected
  • For complex cases (cases which do not match (1), (2) or (3)), the ReprojectionOp shall be used
  • If a tool requires resampling / reprojection, a popup dialog shall appear, asking the user to choose one of the ops (if available) or to cancel
  • In the UI, users shall be enabled to set interpolation methods and aggregation methods which are then to be applied to all bands (in future versions, methods can be set to individial bands distinctively)
  • CAREFUL with flags and index codings: Values must not be different from 0 or 1
    • Allow setting for flag aggregation and index aggregation (two parameters): as above
    • For flag and incex interpolation, always use nearest neighbour
    • In later versions, aggregation methods might be stated to individual flag bands and even flags
  • In future releases, the ResamplingOp shall also be able to resample back to multi-size products. This can be used to e.g. resample bands back to their original sizes after an operator has been used. To achieve this, it is necessary to assign to each band its own reference size/resolution.

When to use? What is its purpose?

The Resampling-Op is required whenever within a product there are bands present which do not have the identity-scenetransform, i.e., pixel positions cannot be derived via an affine transform.

→ Shall the ResamplingOp also be used when bands have different imageToModelTransforms?

Every time a user attempts to use a tool on a MS product, but the tool requires a single size product. The ResamplingOp will ask what is the master resolution (model crs) and scale all bands to that resolution. The user will be able to determine how the scaling shall take place.

When exactly shall the UI pop up? How often? What settings will/can be saved? How will the product be handled in SNAP? Shall it appear as a second (or third/fourth) product in the tree? Or shall there be an internal linkage to the resampled product(s)? If so, how is this resampled product presented to the user?

 The resampled product shall appear in the product tree as an usual new product 

What to do if the user wants to re-resample a product?

→ Works as for any other operator.

How shall the actual resampling take place?

Suggestion: The user is presented various resolutions present in the product. He/she can choose any of these as the master resolution (or define his own).

How shall masks be handled?

Masks can be used in almost every Sentinel Toolbox functionality. They do have their own UI (The Mask Manager), but are often used without calling it explicitly. Currently, masks are only supported for those bands which have the same resolution/size or scenetransform as the mask. As consequence, the ResamplingOp would need to be called immediately when a product is opened. This undermines the purpose of the tool. Very similar problems exist for layers and valid pixel expressions.

→ Potential Solution: Keep masks as they are (only applicable to bands with same scenetransform). Allow in MaskManager to create a resampled product, use it if it is available.

Question: Since we have the SceneTransforms, which are the actual instances when the ResamplingOp is needed?

The ResamplingOp is needed in the cases when actual raster data values shall be compared to each other. The SceneTransform can serve to find corresponding pixel positions in rasters, but in some instances the user might want to perform an interpolation to arrive at more refined values. The ResamplingOp is also needed when operations are performed tilewise, as in these instances parts of the product are to be kept in memory. Reading parts from other tiles would counteract this approach.

List of Tools that require the ResamplingOp:

  • About every Operator
    •  When shall the ResamplingOp UI pop up? Before the operator UI comes up? Or after (providing the option to resample during setting the other parameters)?
    • The Definition of a ResamplingOp is required in a graph when calling the Operator from the CL
  • Statistic Views (ScatterPlot, Correlation Plot, ...)
  • MaskManager / LayerManager / Valid Pixel Expression (see above)

List of Tools that do NOT require the ResamplingOp

  • PixelInfoView (already uses scenetransform)
  • Pin- / GcpManager (already uses scenetransform)
  • Vector Data Handling (already uses scenetransform)
  • Spectrum View (can be re-modeled to use scenetransform with ease)
  • Magic Wand Tool (can be re-modeled to use scenetransform with ease)