planning
static_interpolation.planning
Classes:
| Name | Description |
|---|---|
InterpolationPlan |
Dataclass containing all precomputed arrays and information needed to perform the interpolation. |
InterpolationPlanner |
Planner that creates InterpolationPlan instances. |
Functions:
| Name | Description |
|---|---|
cubic_kernel |
Cubic interpolation kernel (Keys / Catmull–Rom-like with a = -0.5). |
linear_kernel |
Linear interpolation kernel. |
InterpolationPlan
[source]
dataclass
Dataclass containing all precomputed arrays and information needed to perform the interpolation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
weight_indices
|
NDArray
|
(M,), data indice associated to a specific weight. |
required |
weight_values
|
NDArray
|
(M,), weight values. |
required |
n_weights_per_sample
|
NDArray
|
(n_valid,), number of weight_indices,weight_values used for the interpolation at a given sampling point. |
required |
valid_sample_ids
|
NDArray
|
(n_valid,) Flattened indices of sample points whose mapped coordinates lie on a data plane. |
required |
valid_sample_mask
|
NDArray
|
(n_samples,) Boolean mask whose true values indicate sampling points are mapped onto a data plane. (np.nonzero(valid_sample_mask)[0]==valid_sample_ids) |
required |
out_shape
|
tuple[int, ...]
|
Shape of the fineal interpolated image. |
required |
mean_fill_indices
|
None | NDArray
|
3x3 neighbor indices of each pixel on each data plane. |
required |
nearest_data_id
|
None | NDArray
|
(n_valid,) pixel index of the nearest data point for each sampling point. |
required |
InterpolationPlanner
[source]
Planner that creates InterpolationPlan instances. Currently supports linear and cubic interpolation.
Methods:
| Name | Description |
|---|---|
build |
Creates InterpolationPlan instances. |
build(mapped_grid, layout, policy)
[source]
Creates InterpolationPlan instances.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mapped_grid
|
SamplingGrid
|
sampling grid with points in pixel coordinates. |
required |
layout
|
ImageLayout
|
Pixel panel layout. |
required |
policy
|
InterpolationPolicy
|
Interpolation options. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
InterpolationPlan |
InterpolationPlan
|
Finished interpolation plan. |
cubic_kernel(t)
[source]
Cubic interpolation kernel (Keys / Catmull–Rom-like with a = -0.5).
Parameters t (float): scalar distance
Returns float: Kernel value at t
linear_kernel(t)
[source]
Linear interpolation kernel.
Parameters t (float): scalar distance
Returns float: Kernel value at t.