meddlr.ops.complex.center_crop#

meddlr.ops.complex.center_crop(x: Tensor, shape, channels_last: bool = False)[source]#

Apply a center crop to the input image or batch of complex images.

Parameters
  • data (torch.Tensor) – The complex input tensor to be center cropped.

  • shape (int, int) – The output shape. The shape should be smaller than the corresponding dimensions of data.

  • channels_last (bool, optional) – If True, crop dimensions range(1, 1+len(shape)). If False, apply to last non-real/imaginary channel dimensions.

Returns

The center cropped image.

Return type

torch.Tensor