meddlr.ops.complex.get_mask#

meddlr.ops.complex.get_mask(x, eps=1e-11, coil_dim=None)[source]#

Returns a binary mask for where x is nonzero with eps tolerance.

  • 0, if both real and imaginary components are zero.

  • 1, if either real and imaginary components are non-zero.

Parameters
  • x (torch.Tensor) – A complex-valued tensor.

  • eps (float) – Tolerance for zer0-value.

  • coil_dim (int) – The coil dimension. When this is provided, if a pixel is non-zero for any coil, we assume that pixel was acquired. This is useful when a coil i has zero signal but the location was actually acquired.

Returns

A binary mask of shape x.shape.

Return type

torch.Tensor