mrpro.utils.filters.uniform_filter

mrpro.utils.filters.uniform_filter(x: Tensor, width: int | Sequence[int] | Tensor, dim: int | Sequence[int] | None = None, pad_mode: Literal['constant', 'reflect', 'replicate', 'circular'] = 'constant', pad_value: float = 0.0) → Tensor

Apply a and-uniform filter.

Parameters:
  • x (Tensor) – Tensor to filter

  • width (int | Sequence[int] | Tensor) – Width of uniform kernel. If iterable, must have length equal to the number of axes.

  • dim (int | Sequence[int] | None, default: None) – Axis or axes to filter over. If None, filters over all axes.

  • pad_mode (Literal['constant', 'reflect', 'replicate', 'circular'], default: 'constant') – Padding mode

  • pad_value (float, default: 0.0) – Padding value for pad_mode = constant