Skip to content

Commit 044cc3d

Browse files
committed
refactor: improve wording around different interpolation types
1 parent 4aae2dc commit 044cc3d

File tree

1 file changed

+25
-21
lines changed

1 file changed

+25
-21
lines changed

index.md

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ to do so by estimating the transformations' inverse if they choose to.
603603
```
604604
:::
605605

606-
```{hint}
606+
```{note}
607607
Exact reproducibility of pixel values for images transformed and resampled by
608608
the transformation types here may differ across implementation and is therefore
609609
out of the scope of this this specification.
@@ -956,6 +956,11 @@ defining a mapping from an input coordinate system to an output coordinate syste
956956
The array contains either coordinates (absolute positions)
957957
or displacements (relative shifts) for each point in the input space.
958958

959+
```{hint}
960+
The `coordinates` and `displacements` transformations are not invertible in general,
961+
but implementations MAY approximate their inverses.
962+
```
963+
959964
**Array Structure**
960965

961966
The array containing the coordinates or displacements MUST:
@@ -964,6 +969,7 @@ The array containing the coordinates or displacements MUST:
964969
to the corresponding coordinates in the input coordinate system via a coordinate transformation (see details below).
965970
- have one dimension corresponding to every axis of the input coordinate system
966971
- have one additional dimension to hold components of the vector (either coordinates or displacements)
972+
- only be used to represent transformations between coordinate systems that are defined in smooth, regularly sampled coordinate arrays.
967973

968974
Metadata for these coordinate transforms have the following fields:
969975

@@ -972,19 +978,28 @@ Metadata for these coordinate transforms have the following fields:
972978

973979
**interpolation**
974980
: The interpolation attributes MAY be provided.
975-
Its value indicates the interpolation to use if transforming points not on the array's discrete grid. Well-defined values include:
976-
- `"nearest"` for nearest neighbor interpolation,
977-
- `"linear"` for linear interpolation (default)
978-
- `"bspline-cubic"` for cubic interpolation, etc.
981+
Its value indicates the interpolation to use if transforming points not on the array's discrete grid.
982+
983+
The interpolation methods listed in this specification document refer to the methods described in {cite:t}`thevenaz2000image` and are not exhaustive.
984+
- `"nearest"` for nearest neighbor interpolation (see {cite:t}`thevenaz2000image`, section 8.1),
985+
- `"linear"` for linear interpolation (default, see {cite:t}`thevenaz2000image`, section 8.2),
986+
- `"bspline-cubic"` for cubic interpolation (see {cite:t}`thevenaz2000image`, section 8.3 on "cubic B-splines).
979987

980988
Consumers SHOULD clearly communicate to users if a different interpolation method is used.
981-
See also {cite:t}`thevenaz2000image` for more details on interpolation methods.
982-
983-
984989

985990
```{hint}
986-
The `coordinates` and `displacements` transformations are not invertible in general,
987-
but implementations MAY approximate their inverses.
991+
The `interpolation` field refers to the method that is used to interpolate the `coordinate` or `displacement` array,
992+
*not* the method used to interpolate the image when applying the transformation to an image.
993+
The `interpolation` field, if provided, is not normative in the sense that usage of a different method is invalid under the spec.
994+
Implementations may prefer to use faster methods for rendering (i.e., `linear` or `nearest`) but this may lead to pathological cases:
995+
- If `nearest` interpolation is used for a `coordinates` transformation,
996+
the transformed image collapses into a single point at the nearest coordinate in the coordinate field.
997+
- If `nearest` interpolation is used for a `displacements` transformation,
998+
the transformed image is piecewise constant with discontinuities at the boundaries between nearest neighbor regions.
999+
1000+
While choosing the specified interpolation methods can help to avoid these pathologies,
1001+
implementations of the specified interpolation methods may still differ in their results.
1002+
An exact reproducibility of pixel values for images transformed and resampled by this transformation is therefore out of the scope of this specification.
9881003
```
9891004

9901005
**Array metadata**
@@ -1199,17 +1214,6 @@ I.e. the y-displacement is first, because the y-axis is the first element of the
11991214

12001215
:::
12011216

1202-
```{warning}
1203-
The `interpolation` field refers to the method that is used to interpolate the `coordinate` or `displacement` array,
1204-
*not* the method used to interpolate the image when applying the transformation to an image.
1205-
The `interpolation` field, if provided, is not normative in the sense that usage of a different method is invalid under the spec.
1206-
Implementations may prefer to use faster methods for rendering (i.e., `linear` or `nearest`) but this may lead to pathological cases:
1207-
- If `nearest` interpolation is used for a `coordinates` transformation,
1208-
the transformed image collapses into a single point at the nearest coordinate in the coordinate field.
1209-
- If `nearest` interpolation is used for a `displacements` transformation,
1210-
the transformed image is piecewise constant with discontinuities at the boundaries between nearest neighbor regions.
1211-
```
1212-
12131217
##### byDimension
12141218
(byDimension-md)=
12151219

0 commit comments

Comments
 (0)