mrpro.utils.filters.filter_separable

mrpro.utils.filters.filter_separable(x: Tensor, kernels: Sequence[Tensor], dim: Sequence[int], pad_mode: Literal['constant', 'reflect', 'replicate', 'circular', 'none'] = 'constant', pad_value: float = 0.0) Tensor[source]

Apply the separable filter kernels to the tensor x along the axes dim.

Does padding to keep the output the same size as the input.

Parameters:
  • x – Tensor to filter

  • kernels – List of 1D kernels to apply to the tensor x

  • dim – Axes to filter over. Must have the same length as kernels.

  • pad_mode – Padding mode

  • pad_value – Padding value for pad_mode = constant

Returns:

  • The filtered tensor, with the same shape as the input unless pad_mode is ‘none’ and

  • and promoted dtype of the input and the kernels.